khtmlpart_p.h Source File (khtml Library)

| # khtml Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# khtmlpart_p.h

    00001 #ifndef khtmlpart_p_h
    00002 #define khtmlpart_p_h
    00003
    00004 /* This file is part of the KDE project
    00005  *
    00006  * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
    00007  *                     1999-2001 Lars Knoll <knoll@kde.org>
    00008  *                     1999-2001 Antti Koivisto <koivisto@kde.org>
    00009  *                     2000-2001 Simon Hausmann <hausmann@kde.org>
    00010  *                     2000-2001 Dirk Mueller <mueller@kde.org>
    00011  *                     2000 Stefan Schimanski <1Stein@gmx.de>
    00012  *
    00013  * This library is free software; you can redistribute it and/or
    00014  * modify it under the terms of the GNU Library General Public
    00015  * License as published by the Free Software Foundation; either
    00016  * version 2 of the License, or (at your option) any later version.
    00017  *
    00018  * This library is distributed in the hope that it will be useful,
    00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00021  * Library General Public License for more details.
    00022  *
    00023  * You should have received a copy of the GNU Library General Public License
    00024  * along with this library; see the file COPYING.LIB.  If not, write to
    00025  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00026  * Boston, MA 02111-1307, USA.
    00027  */
    00028 #include <kcursor.h>
    00029 #include <kxmlguifactory.h>
    00030
    00031 #include "khtml_run.h"
    00032 #include "../kutils/kfind.h"
    00033 #include "khtml_factory.h"
    00034 #include "khtml_events.h"
    00035 #include "khtml_ext.h"
    00036 #include "khtml_iface.h"
    00037 #include "khtml_settings.h"
    00038 #include "misc/decoder.h"
    00039 #include "java/kjavaappletcontext.h"
    00040 #include "ecma/kjs_proxy.h"
    00041
    00042 namespace KIO
    00043 {
    00044   class Job;
    00045   class TransferJob;
    00046 }
    00047
    00048 namespace khtml
    00049 {
    00050   struct ChildFrame
    00051   {
    00052       enum Type { Frame, IFrame, Object };
    00053
    00054       ChildFrame() {
    00055           m_bCompleted = false; m_bPreloaded = false; m_type = Frame; m_bNotify = false;
    00056           m_bPendingRedirection = false;
    00057       }
    00058
    00059       ~ChildFrame() { if (m_run) m_run->abort(); }
    00060
    00061     QGuardedPtr<khtml::RenderPart> m_frame;
    00062     QGuardedPtr<KParts::ReadOnlyPart> m_part;
    00063     QGuardedPtr<KParts::BrowserExtension> m_extension;
    00064     QGuardedPtr<KParts::LiveConnectExtension> m_liveconnect;
    00065     QString m_serviceName;
    00066     QString m_serviceType;
    00067     bool m_bCompleted;
    00068     QString m_name;
    00069     KParts::URLArgs m_args;
    00070     QGuardedPtr<KHTMLRun> m_run;
    00071     bool m_bPreloaded;
    00072     KURL m_workingURL;
    00073     Type m_type;
    00074     QStringList m_params;
    00075     bool m_bNotify;
    00076     bool m_bPendingRedirection;
    00077   };
    00078
    00079 }
    00080
    00081 class FrameList : public QValueList<khtml::ChildFrame>
    00082 {
    00083 public:
    00084     Iterator find( const QString &name );
    00085 };
    00086
    00087 typedef FrameList::ConstIterator ConstFrameIt;
    00088 typedef FrameList::Iterator FrameIt;
    00089
    00090 static int khtml_part_dcop_counter = 0;
    00091
    00092 class KHTMLPartPrivate
    00093 {
    00094 public:
    00095   KHTMLPartPrivate(QObject* parent)
    00096   {
    00097     m_doc = 0L;
    00098     m_decoder = 0L;
    00099     m_jscript = 0L;
    00100     m_runningScripts = 0;
    00101     m_kjs_lib = 0;
    00102     m_job = 0L;
    00103     m_bComplete = true;
    00104     m_bLoadEventEmitted = true;
    00105     m_cachePolicy = KIO::CC_Verify;
    00106     m_manager = 0L;
    00107     m_settings = new KHTMLSettings(*KHTMLFactory::defaultHTMLSettings());
    00108     m_bClearing = false;
    00109     m_bCleared = false;
    00110     m_zoomFactor = 100;
    00111     m_bDnd = true;
    00112     m_startOffset = m_endOffset = 0;
    00113     m_startBeforeEnd = true;
    00114     m_linkCursor = KCursor::handCursor();
    00115     m_loadedObjects = 0;
    00116     m_totalObjectCount = 0;
    00117     m_jobPercent = 0;
    00118     m_haveEncoding = false;
    00119     m_activeFrame = 0L;
    00120     m_find = 0;
    00121     m_ssl_in_use = false;
    00122 #ifndef Q_WS_QWS
    00123     m_javaContext = 0;
    00124 #endif
    00125     m_cacheId = 0;
    00126     m_frameNameId = 1;
    00127
    00128     m_restored = false;
    00129
    00130     m_focusNodeNumber = -1;
    00131     m_focusNodeRestored = false;
    00132
    00133     m_bJScriptForce = false;
    00134     m_bJScriptOverride = false;
    00135     m_bJavaForce = false;
    00136     m_bJavaOverride = false;
    00137     m_bPluginsForce = false;
    00138     m_bPluginsOverride = false;
    00139     m_onlyLocalReferences = false;
    00140
    00141     m_metaRefreshEnabled = true;
    00142     m_bHTTPRefresh = false;
    00143
    00144     m_bFirstData = true;
    00145     m_submitForm = 0;
    00146     m_delayRedirect = 0;
    00147
    00148     // inherit settings from parent
    00149     if(parent && parent->inherits("KHTMLPart"))
    00150     {
    00151         KHTMLPart* part = static_cast<KHTMLPart*>(parent);
    00152         if(part->d)
    00153         {
    00154             m_bJScriptForce = part->d->m_bJScriptForce;
    00155             m_bJScriptOverride = part->d->m_bJScriptOverride;
    00156             m_bJavaForce = part->d->m_bJavaForce;
    00157             m_bJavaOverride = part->d->m_bJavaOverride;
    00158             m_bPluginsForce = part->d->m_bPluginsForce;
    00159             m_bPluginsOverride = part->d->m_bPluginsOverride;
    00160             // Same for SSL settings
    00161             m_ssl_in_use = part->d->m_ssl_in_use;
    00162             m_onlyLocalReferences = part->d->m_onlyLocalReferences;
    00163             m_zoomFactor = part->d->m_zoomFactor;
    00164         }
    00165     }
    00166
    00167     m_focusNodeNumber = -1;
    00168     m_focusNodeRestored = false;
    00169     m_opener = 0;
    00170     m_openedByJS = false;
    00171     m_newJSInterpreterExists = false;
    00172     m_dcopobject = 0;
    00173     m_jobspeed = 0;
    00174     m_dcop_counter = ++khtml_part_dcop_counter;
    00175   }
    00176   ~KHTMLPartPrivate()
    00177   {
    00178     delete m_dcopobject;
    00179     delete m_extension;
    00180     delete m_settings;
    00181     delete m_jscript;
    00182     if ( m_kjs_lib)
    00183        m_kjs_lib->unload();
    00184 #ifndef Q_WS_QWS
    00185     delete m_javaContext;
    00186 #endif
    00187   }
    00188
    00189   FrameList m_frames;
    00190   QValueList<khtml::ChildFrame> m_objects;
    00191
    00192   QGuardedPtr<KHTMLView> m_view;
    00193   KHTMLPartBrowserExtension *m_extension;
    00194   KHTMLPartBrowserHostExtension *m_hostExtension;
    00195   DOM::DocumentImpl *m_doc;
    00196   khtml::Decoder *m_decoder;
    00197   QString m_encoding;
    00198   QString m_sheetUsed;
    00199   long m_cacheId;
    00200   QString scheduledScript;
    00201   DOM::Node scheduledScriptNode;
    00202
    00203   KJSProxy *m_jscript;
    00204   KLibrary *m_kjs_lib;
    00205   int m_runningScripts;
    00206   bool m_bBackRightClick :1;
    00207   bool m_bJScriptEnabled :1;
    00208   bool m_bJScriptDebugEnabled :1;
    00209   bool m_bJavaEnabled :1;
    00210   bool m_bPluginsEnabled :1;
    00211   bool m_bJScriptForce :1;
    00212   bool m_bJScriptOverride :1;
    00213   bool m_bJavaForce :1;
    00214   bool m_bJavaOverride :1;
    00215   bool m_bPluginsForce :1;
    00216   bool m_metaRefreshEnabled :1;
    00217   bool m_bPluginsOverride :1;
    00218   bool m_restored :1;
    00219   int m_frameNameId;
    00220   int m_dcop_counter;
    00221   DCOPObject *m_dcopobject;
    00222
    00223 #ifndef Q_WS_QWS
    00224   KJavaAppletContext *m_javaContext;
    00225 #endif
    00226
    00227   KHTMLSettings *m_settings;
    00228
    00229   KIO::TransferJob * m_job;
    00230
    00231   QString m_statusBarText[3];
    00232   unsigned long m_jobspeed;
    00233   QString m_lastModified;
    00234   QString m_httpHeaders;
    00235   QString m_pageServices;
    00236
    00237   // QStrings for SSL metadata
    00238   // Note: When adding new variables don't forget to update ::saveState()/::restoreState()!
    00239   bool m_ssl_in_use;
    00240   QString m_ssl_peer_certificate,
    00241           m_ssl_peer_chain,
    00242           m_ssl_peer_ip,
    00243           m_ssl_cipher,
    00244           m_ssl_cipher_desc,
    00245           m_ssl_cipher_version,
    00246           m_ssl_cipher_used_bits,
    00247           m_ssl_cipher_bits,
    00248           m_ssl_cert_state,
    00249           m_ssl_parent_ip,
    00250           m_ssl_parent_cert;
    00251
    00252   bool m_bComplete:1;
    00253   bool m_bLoadEventEmitted:1;
    00254   bool m_haveEncoding:1;
    00255   bool m_bHTTPRefresh:1;
    00256   bool m_onlyLocalReferences :1;
    00257   bool m_redirectLockHistory:1;
    00258
    00259   KURL m_workingURL;
    00260
    00261   KIO::CacheControl m_cachePolicy;
    00262   QTimer m_redirectionTimer;
    00263   QTime m_parsetime;
    00264   int m_delayRedirect;
    00265   QString m_redirectURL;
    00266
    00267   KAction *m_paViewDocument;
    00268   KAction *m_paViewFrame;
    00269   KAction *m_paViewInfo;
    00270   KAction *m_paSaveBackground;
    00271   KAction *m_paSaveDocument;
    00272   KAction *m_paSaveFrame;
    00273   KAction *m_paSecurity;
    00274   KSelectAction *m_paSetEncoding;
    00275   KSelectAction *m_paUseStylesheet;
    00276   KHTMLZoomFactorAction *m_paIncZoomFactor;
    00277   KHTMLZoomFactorAction *m_paDecZoomFactor;
    00278   KAction *m_paLoadImages;
    00279   KAction *m_paFind;
    00280   KAction *m_paFindNext;
    00281   KAction *m_paPrintFrame;
    00282   KAction *m_paSelectAll;
    00283   KAction *m_paDebugDOMTree;
    00284   KAction *m_paDebugRenderTree;
    00285
    00286   KParts::PartManager *m_manager;
    00287
    00288   QString m_popupMenuXML;
    00289   KHTMLPart::GUIProfile m_guiProfile;
    00290
    00291   int m_zoomFactor;
    00292
    00293   QString m_strSelectedURL;
    00294   QString m_strSelectedURLTarget;
    00295   QString m_referrer;
    00296   QString m_pageReferrer;
    00297
    00298   struct SubmitForm
    00299   {
    00300     const char *submitAction;
    00301     QString submitUrl;
    00302     QByteArray submitFormData;
    00303     QString target;
    00304     QString submitContentType;
    00305     QString submitBoundary;
    00306   };
    00307
    00308   SubmitForm *m_submitForm;
    00309
    00310   bool m_bMousePressed;
    00311   bool m_bRightMousePressed;
    00312   DOM::Node m_mousePressNode; //node under the mouse when the mouse was pressed (set in the mouse handler)
    00313
    00314   DOM::Node m_selectionStart;
    00315   long m_startOffset;
    00316   DOM::Node m_selectionEnd;
    00317   long m_endOffset;
    00318   QString m_overURL;
    00319   QString m_overURLTarget;
    00320
    00321   bool m_startBeforeEnd:1;
    00322   bool m_bDnd:1;
    00323   bool m_bFirstData:1;
    00324   bool m_bClearing:1;
    00325   bool m_bCleared:1;
    00326   bool m_bSecurityInQuestion:1;
    00327   bool m_focusNodeRestored:1;
    00328
    00329   int m_focusNodeNumber;
    00330
    00331   QPoint m_dragStartPos;
    00332 #ifdef KHTML_NO_SELECTION
    00333   QPoint m_dragLastPos;
    00334 #endif
    00335
    00336   QCursor m_linkCursor;
    00337   QTimer m_scrollTimer;
    00338
    00339   unsigned long m_loadedObjects;
    00340   unsigned long m_totalObjectCount;
    00341   unsigned int m_jobPercent;
    00342
    00343   QTimer m_progressUpdateTimer;
    00344
    00345   QStringList m_pluginPageQuestionAsked;
    00346
    00348   struct StringPortion
    00349   {
    00350       // Just basic ref/deref on our node to make sure it doesn't get deleted
    00351       StringPortion( int i, DOM::NodeImpl* n ) : index(i), node(n) { if (node) node->ref(); }
    00352       StringPortion() : index(0), node(0) {} // for QValueList
    00353       StringPortion( const StringPortion& other ) : node(0) { operator=(other); }
    00354       StringPortion& operator=( const StringPortion& other ) {
    00355           index=other.index;
    00356           if (other.node) other.node->ref();
    00357           if (node) node->deref();
    00358           node=other.node;
    00359           return *this;
    00360       }
    00361       ~StringPortion() { if (node) node->deref(); }
    00362
    00363       int index;
    00364       DOM::NodeImpl *node;
    00365   };
    00366   QValueList<StringPortion> m_stringPortions;
    00367
    00368   KFind *m_find;
    00369
    00370   struct findState
    00371   {
    00372     findState()
    00373     { options = 0; }
    00374     QStringList history;
    00375     QString text;
    00376     int options;
    00377   };
    00378
    00379   findState m_lastFindState;
    00380
    00381   DOM::NodeImpl *m_findNode; // current node
    00382   DOM::NodeImpl *m_findNodeEnd; // end node
    00383   int m_findPos; // current pos in current node
    00384   int m_findPosEnd; // pos in end node
    00386
    00387   //QGuardedPtr<KParts::Part> m_activeFrame;
    00388   KParts::Part * m_activeFrame;
    00389   QGuardedPtr<KHTMLPart> m_opener;
    00390   bool m_openedByJS;
    00391   bool m_newJSInterpreterExists; // set to 1 by setOpenedByJS, for window.open
    00392 };
    00393
    00394 #endif

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:34:08 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001