IDBFactoryBackendProxy.h revision 563af33bc48281d19dce701398dbb88cb54fd7ec
1563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark/* 2563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 4563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * 5563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * Redistribution and use in source and binary forms, with or without 6563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * modification, are permitted provided that the following conditions 7563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * are met: 8563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * 9563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * 1. Redistributions of source code must retain the above copyright 10563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * notice, this list of conditions and the following disclaimer. 11563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * 2. Redistributions in binary form must reproduce the above copyright 12563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * notice, this list of conditions and the following disclaimer in the 13563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * documentation and/or other materials provided with the distribution. 14563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of 15563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * its contributors may be used to endorse or promote products derived 16563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * from this software without specific prior written permission. 17563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * 18563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 19563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 22563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark */ 29563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark#ifndef JSOBJECTS_H 30563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark#define JSOBJECTS_H 31563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 32563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark#include <qobject.h> 33563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark#include <qdebug.h> 34563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark#include <qpoint.h> 35563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark#include <qstringlist.h> 36563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark#include <qsize.h> 37563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 38563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkclass QWebFrame; 39563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarknamespace WebCore { 40563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark class DumpRenderTree; 41563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark} 42563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkclass LayoutTestController : public QObject 43563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark{ 44563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark Q_OBJECT 45563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkpublic: 46563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark LayoutTestController(WebCore::DumpRenderTree *drt); 47563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 48563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool isLoading() const { return m_isLoading; } 49563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void setLoading(bool loading) { m_isLoading = loading; } 50563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 51563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool shouldDumpAsText() const { return m_textDump; } 52563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool shouldDumpBackForwardList() const { return m_dumpBackForwardList; } 53563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool shouldDumpChildrenAsText() const { return m_dumpChildrenAsText; } 54563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool shouldWaitUntilDone() const { return m_waitForDone; } 55563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool canOpenWindows() const { return m_canOpenWindows; } 56563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool shouldDumpTitleChanges() const { return m_dumpTitleChanges; } 57563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 58563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void reset(); 59563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 60563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkprotected: 61563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void timerEvent(QTimerEvent *); 62563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 63563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarksignals: 64563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void done(); 65563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 66563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkpublic slots: 67563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void maybeDump(bool ok); 68563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void dumpAsText() { m_textDump = true; } 69563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void dumpChildFramesAsText() { m_dumpChildrenAsText = true; } 70563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void setCanOpenWindows() { m_canOpenWindows = true; } 71563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void waitUntilDone(); 72563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void notifyDone(); 73563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void dumpBackForwardList() { m_dumpBackForwardList = true; } 74563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void dumpEditingCallbacks(); 75563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void dumpResourceLoadCallbacks(); 76563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void queueBackNavigation(int howFarBackward); 77563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void queueForwardNavigation(int howFarForward); 78563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void queueLoad(const QString &url, const QString &target = QString()); 79563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void queueReload(); 80563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void queueScript(const QString &url); 81563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void provisionalLoad(); 82563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void setCloseRemainingWindowsWhenComplete(bool=false) {} 83563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark int windowCount(); 84563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void display() {} 85563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void clearBackForwardList(); 86563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void dumpTitleChanges() { m_dumpTitleChanges = true; } 87563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark QString encodeHostName(const QString &host); 88563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark QString decodeHostName(const QString &host); 89563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void dumpSelectionRect() const {} 90563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void setJavaScriptProfilingEnabled(bool enable); 91563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void setFixedLayoutSize(int width, int height); 92563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void setUseFixedLayout(bool enable); 93563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 94563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool pauseAnimationAtTimeOnElementWithId(const QString &animationName, double time, const QString &elementId); 95563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool pauseTransitionAtTimeOnElementWithId(const QString &propertyName, double time, const QString &elementId); 96563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark unsigned numberOfActiveAnimations() const; 97563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 98563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkprivate slots: 99563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void processWork(); 100563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 101563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkprivate: 102563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool m_isLoading; 103563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool m_textDump; 104563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool m_dumpBackForwardList; 105563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool m_dumpChildrenAsText; 106563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool m_canOpenWindows; 107563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool m_waitForDone; 108563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark bool m_dumpTitleChanges; 109563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark int m_timeoutTimer; 110563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark QWebFrame *m_topLoadingFrame; 111563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark WebCore::DumpRenderTree *m_drt; 112563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark}; 113563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 114563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkclass QWebPage; 115563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkclass QWebFrame; 116563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 117563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkclass EventSender : public QObject 118563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark{ 119563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark Q_OBJECT 120563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkpublic: 121563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark EventSender(QWebPage *parent); 122563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 123563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkpublic slots: 124563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void mouseDown(); 125563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void mouseUp(); 126563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void mouseMoveTo(int x, int y); 127563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void leapForward(int ms); 128563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void keyDown(const QString &string, const QStringList &modifiers=QStringList()); 129563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void clearKillRing() {} 130563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 131563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkprivate: 132563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark QPoint m_mousePos; 133563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark QWebPage *m_page; 134563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark int m_timeLeap; 135563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark QWebFrame *frameUnderMouse() const; 136563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark}; 137563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 138563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkclass TextInputController : public QObject 139563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark{ 140563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark Q_OBJECT 141563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkpublic: 142563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark TextInputController(QWebPage *parent); 143563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 144563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkpublic slots: 145563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark void doCommand(const QString &command); 146563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark// void setMarkedText(const QString &str, int from, int length); 147563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark// bool hasMarkedText(); 148563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark// void unmarkText(); 149563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark// QList<int> markedRange(); 150563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark// QList<int> selectedRange(); 151563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark// void validAttributesForMarkedText(); 152563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark// void inserText(const QString &); 153563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark// void firstRectForCharacterRange(); 154563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark// void characterIndexForPoint(int, int); 155563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark// void substringFromRange(int, int); 156563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark// void conversationIdentifier(); 157563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark}; 158563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark 159563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark#endif 160