1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
|
//
// Copyright 2008 Jim Bublitz <jbublitz@nwinternet.com>
// Earlier copyrights 1998 - 2007 Jim Bublitz also apply
// Generated by twine
// This file is part of PyKDE4.
// PyKDE4 is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
// PyKDE4 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
%ModuleHeaderCode
//ctscc
#include <khtml_part.h>
#include <khtmlview.h>
#include <qobject.h>
%End
class KHTMLPart : KParts::ReadOnlyPart
{
%TypeHeaderCode
#include <khtml_part.h>
%End
public:
enum GUIProfile
{
DefaultGUI,
BrowserViewGUI
};
enum DNSPrefetch
{
DNSPrefetchDisabled,
DNSPrefetchEnabled,
DNSPrefetchOnlyWWWAndSLD
};
KHTMLPart (QWidget* parentWidget = 0, QObject* parent /TransferThis/ = 0, KHTMLPart::GUIProfile prof = KHTMLPart::DefaultGUI);
KHTMLPart (KHTMLView* view, QObject* parent /TransferThis/ = 0, KHTMLPart::GUIProfile prof = KHTMLPart::DefaultGUI);
virtual bool openUrl (const KUrl& url);
virtual bool closeUrl ();
virtual void showError (KJob* job);
DOM::HTMLDocument htmlDocument () const;
DOM::Document document () const;
QString documentSource () const;
DOM::Node activeNode () const;
KParts::BrowserExtension* browserExtension () const;
KParts::BrowserHostExtension* browserHostExtension () const;
KHTMLView* view () const;
void setJScriptEnabled (bool enable);
bool jScriptEnabled () const;
//ig KJS::Interpreter* jScriptInterpreter ();
void setStatusMessagesEnabled (bool enable);
bool statusMessagesEnabled () const;
void setMetaRefreshEnabled (bool enable);
bool metaRefreshEnabled () const;
QVariant executeScript (const DOM::Node& n, const QString& script);
void setDNDEnabled (bool b);
bool dndEnabled () const;
void setJavaEnabled (bool enable);
bool javaEnabled () const;
void setPluginsEnabled (bool enable);
bool pluginsEnabled () const;
void setAutoloadImages (bool enable);
bool autoloadImages () const;
void setOnlyLocalReferences (bool enable);
void setDNSPrefetch (KHTMLPart::DNSPrefetch pmode);
KHTMLPart::DNSPrefetch dnsPrefetch () const;
bool onlyLocalReferences () const;
bool isCaretMode () const;
bool isEditable () const;
void setCaretPosition (DOM::Node node, long offset, bool extendSelection = 0);
enum CaretDisplayPolicy
{
CaretVisible,
CaretInvisible,
CaretBlink
};
KHTMLPart::CaretDisplayPolicy caretDisplayPolicyNonFocused () const;
void setCaretDisplayPolicyNonFocused (KHTMLPart::CaretDisplayPolicy policy);
KUrl baseURL () const;
KUrl backgroundURL () const;
void scheduleRedirection (int delay, const QString& url, bool lockHistory = 1);
virtual void begin (const KUrl& url = KUrl(), int xOffset = 0, int yOffset = 0);
virtual void write (const char* str, int len = -1);
virtual void write (const QString& str);
virtual void end ();
void paint (QPainter*, const QRect&, int = 0, bool* /Out/ = 0);
bool setEncoding (const QString& name, bool override = 0);
QString encoding () const;
void setUserStyleSheet (const KUrl& url);
void setUserStyleSheet (const QString& styleSheet);
void setStandardFont (const QString& name);
void setFixedFont (const QString& name);
bool gotoAnchor (const QString& name);
bool nextAnchor ();
bool prevAnchor ();
void setURLCursor (const QCursor& c);
QCursor urlCursor () const;
enum FindOptions
{
FindLinksOnly,
FindNoPopups
};
void findText ();
void findText (const QString& str, long options, QWidget* parent /Transfer/ = 0, KFindDialog* findDialog = 0);
void findTextBegin ();
bool findTextNext (bool reverse = 0);
void setZoomFactor (int percent);
int zoomFactor () const;
void setFontScaleFactor (int percent);
int fontScaleFactor () const;
virtual QString selectedText () const;
QString selectedTextAsHTML () const;
DOM::Range selection () const;
void selection (DOM::Node& startNode, long& startOffset /Out/, DOM::Node& endNode, long& endOffset /Out/) const;
void setSelection (const DOM::Range&);
bool hasSelection () const;
void selectAll ();
void show ();
void hide ();
KParts::PartManager* partManager ();
virtual void saveState (QDataStream& stream);
virtual void restoreState (QDataStream& stream);
DOM::Node nodeUnderMouse () const;
DOM::Node nonSharedNodeUnderMouse () const;
const KHTMLSettings* settings () const;
KHTMLPart* parentPart ();
QStringList frameNames () const;
QList<KParts::ReadOnlyPart*> frames () const;
KHTMLPart* findFrame (const QString& f);
//ig KHTMLPart* findFrameParent (KParts::ReadOnlyPart* callingPart, const QString& f, khtml::ChildFrame** childFrame = 0);
KParts::ReadOnlyPart* currentFrame () const;
bool frameExists (const QString& frameName);
//ig KJSProxy* framejScript (KParts::ReadOnlyPart* framePart);
KParts::ReadOnlyPart* findFramePart (const QString& f);
void setJSStatusBarText (const QString& text);
void setJSDefaultStatusBarText (const QString& text);
QString jsStatusBarText () const;
QString jsDefaultStatusBarText () const;
QString referrer () const;
QString pageReferrer () const;
QString lastModified () const;
void preloadStyleSheet (const QString& url, const QString& stylesheet);
void preloadScript (const QString& url, const QString& script);
bool isPointInsideSelection (int x, int y);
bool restored () const;
void setAlwaysHonourDoctype (bool b = 1);
enum FormNotification
{
NoNotification,
Before,
Only,
Unused
};
void setFormNotification (KHTMLPart::FormNotification fn);
KHTMLPart::FormNotification formNotification () const;
KUrl toplevelURL ();
bool isModified () const;
void setSuppressedPopupIndicator (bool enable, KHTMLPart* originPart = 0);
bool inProgress () const;
signals:
void onURL (const QString& url);
void popupMenu (const QString& url, const QPoint& point);
void selectionChanged ();
void nodeActivated (const DOM::Node&);
void docCreated ();
void caretPositionChanged (const DOM::Node& node, long offset);
void formSubmitNotification (const char* action, const QString& url, const QByteArray& formData, const QString& target, const QString& contentType, const QString& boundary);
void configurationChanged ();
protected:
KUrl completeURL (const QString& url);
void htmlError (int errorCode, const QString& text, const KUrl& reqUrl);
virtual void customEvent (QEvent* event);
//ig virtual void khtmlMousePressEvent (khtml::MousePressEvent* event);
//ig virtual void khtmlMouseDoubleClickEvent (khtml::MouseDoubleClickEvent*);
//ig virtual void khtmlMouseMoveEvent (khtml::MouseMoveEvent* event);
//ig virtual void khtmlMouseReleaseEvent (khtml::MouseReleaseEvent* event);
//ig virtual void khtmlDrawContentsEvent (khtml::DrawContentsEvent*);
virtual void guiActivateEvent (KParts::GUIActivateEvent* event);
virtual bool openFile ();
virtual bool urlSelected (const QString& url, int button, int state, const QString& _target, const KParts::OpenUrlArguments& args = KParts::OpenUrlArguments(), const KParts::BrowserArguments& browserArgs = KParts::BrowserArguments());
virtual KParts::ReadOnlyPart* createPart (QWidget* parentWidget, QObject* parent /Transfer/, const QString& mimetype, QString& serviceName, QStringList& serviceTypes, const QStringList& params);
bool pluginPageQuestionAsked (const QString& mimetype) const;
void setPluginPageQuestionAsked (const QString& mimetype);
enum PageSecurity
{
NotCrypted,
Encrypted,
Mixed
};
//ig void setPageSecurity (KHTMLPart::PageSecurity sec);
virtual bool doOpenStream (const QString& mimeType);
virtual bool doWriteStream (const QByteArray& data);
virtual bool doCloseStream ();
virtual void timerEvent (QTimerEvent*);
bool mayPrefetchHostname (const QString& name);
public:
void setActiveNode (const DOM::Node& node);
void stopAnimations ();
QVariant executeScript (const QString& script);
void setCaretMode (bool enable);
void setEditable (bool enable);
void setCaretVisible (bool show);
void submitFormProxy (const char* action, const QString& url, const QByteArray& formData, const QString& target, const QString& contentType = QString(), const QString& boundary = QString());
protected:
virtual void slotFinished (KJob*);
virtual void startingJob (KIO::Job*);
private:
//force
void setStatusBarText (const QString&, int);
// Subclasses of QObject
//end
%ConvertToSubClassCode
// CTSCC for subclasses of 'QObject'
sipType = NULL;
if (dynamic_cast<KHTMLPart*>(sipCpp))
sipType = sipType_KHTMLPart;
else if (dynamic_cast<KHTMLView*>(sipCpp))
sipType = sipType_KHTMLView;
%End
public:
~KHTMLPart ();
//ig DOM::Editor* editor () const;
protected:
void updateZoomFactor ();
public:
void setForcePermitLocalImages (bool enable);
bool forcePermitLocalImages () const;
//ig KHTMLPartPrivate* impl ();
};
// KHTMLPart
|