KHtml

khtml_iface.h
1 /* This file is part of the KDE project
2  * Copyright (C) 2002 Stephan Kulow <[email protected]>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB. If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef __khtml_Iface_h__
21 #define __khtml_Iface_h__
22 
23 #include <khtml_part.h>
24 #include <QDBusAbstractAdaptor>
25 
26 class KHTMLPart;
27 
28 /**
29  * D-BUS interface for KHTML
30  */
32 {
33  Q_OBJECT
34  Q_CLASSINFO("D-Bus Interface", "org.kde.KHTMLPart")
45 
46 public:
47 
49  virtual ~KHTMLPartIface();
50 
51 public Q_SLOTS:
52  /**
53  * @return the current URL
54  */
55  QString url() const;
56 
57  bool closeUrl();
58 
59  /**
60  * Enable/disable Javascript support. Note that this will
61  * in either case permanently override the default usersetting.
62  * If you want to have the default UserSettings, don't call this
63  * method.
64  */
65  void setJScriptEnabled(bool enable);
66 
67  /**
68  * Returns @p true if Javascript support is enabled or @p false
69  * otherwise.
70  */
71  bool jScriptEnabled() const;
72 
73  /**
74  * Enable/disable the automatic forwarding by <meta http-equiv="refresh" ....>
75  */
76  void setMetaRefreshEnabled(bool enable);
77 
78  /**
79  * Returns @p true if automtaic forwarding is enabled.
80  */
81  bool metaRefreshEnabled() const;
82 
83  /**
84  * Enables or disables Drag'n'Drop support. A drag operation is started if
85  * the users drags a link.
86  */
87  void setDndEnabled(bool b);
88 
89  /**
90  * Returns whether Dragn'n'Drop support is enabled or not.
91  */
92  bool dndEnabled() const;
93 
94  /**
95  * Enables/disables Java applet support. Note that calling this function
96  * will permanently override the User settings about Java applet support.
97  * Not calling this function is the only way to let the default settings
98  * apply.
99  */
100  void setJavaEnabled(bool enable);
101 
102  /**
103  * Return if Java applet support is enabled/disabled.
104  */
105  bool javaEnabled() const;
106 
107  /**
108  * Enables or disables plugins via, default is enabled
109  */
110  void setPluginsEnabled(bool enable);
111 
112  /**
113  * Returns trie if plugins are enabled/disabled.
114  */
115  bool pluginsEnabled() const;
116 
117  /**
118  * Specifies whether images contained in the document should be loaded
119  * automatically or not.
120  *
121  * @note Request will be ignored if called before begin().
122  */
123  void setAutoloadImages(bool enable);
124 
125  /**
126  * Returns whether images contained in the document are loaded automatically
127  * or not.
128  * @note that the returned information is unrelieable as long as no begin()
129  * was called.
130  */
131  bool autoloadImages() const;
132 
133  /**
134  * Security option.
135  *
136  * Specify whether only local references ( stylesheets, images, scripts, subdocuments )
137  * should be loaded. ( default false - everything is loaded, if the more specific
138  * options allow )
139  */
140  void setOnlyLocalReferences(bool enable);
141 
142  /**
143  * Returns whether references should be loaded ( default false )
144  **/
145  bool onlyLocalReferences() const;
146 
147  /**
148  * Sets the encoding the page uses.
149  *
150  * This can be different from the charset. The widget will try to reload
151  * the current page in the new encoding, if url() is not empty.
152  */
153  bool setEncoding(const QString &name);
154 
155  /**
156  * Returns the encoding the page currently uses.
157  *
158  * Note that the encoding might be different from the charset.
159  */
160  QString encoding() const;
161 
162  /**
163  * Sets a user defined style sheet to be used on top of the HTML 4
164  * default style sheet.
165  *
166  * This gives a wide range of possibilities to
167  * change the layout of the page.
168  */
169  void setUserStyleSheet(const QString &styleSheet);
170 
171  /**
172  * Sets the fixed font style.
173  *
174  * @param name The font name to use for fixed text, e.g.
175  * the <tt>&lt;pre&gt;</tt> tag.
176  */
177  void setFixedFont(const QString &name);
178 
179  /**
180  * Finds the anchor named @p name.
181  *
182  * If the anchor is found, the widget
183  * scrolls to the closest position. Returns @p true if the anchor has
184  * been found.
185  */
186  bool gotoAnchor(const QString &name);
187 
188  /**
189  * Go to next Anchor.
190  *
191  * This is useful to navigate from outside of the navigator.
192  */
193  bool nextAnchor();
194 
195  /**
196  * Go to previous Anchor.
197  */
198  bool prevAnchor();
199 
200  /**
201  * Activate the node that currently has the focus
202  * (emulates pressing Return)
203  */
204  void activateNode();
205 
206  /**
207  * Returns the text the user has marked.
208  */
209  QString selectedText() const;
210 
211  /**
212  * Marks all text in the document as selected.
213  */
214  void selectAll();
215 
216  /**
217  * Last-modified date (in raw string format), if received in the [HTTP] headers.
218  */
219  QString lastModified() const;
220 
221  /**
222  * Print the contents of the current html view.
223  * @param quick if true, fully automated printing, without the print dialog.
224  */
225  Q_NOREPLY void print(bool quick);
226 
227  void debugRenderTree();
228  void debugDOMTree();
229  void viewDocumentSource();
230  void viewFrameSource();
231  void saveBackground(const QString &url);
232  void saveDocument(const QString &url);
233 
234  /**
235  * Evaluate a given piece of Javascript code
236  */
237  QString evalJS(const QString &script);
238 
239  /**
240  * Stops display of animated images
241  */
242  void stopAnimations();
243 
244 Q_SIGNALS:
245  void configurationChanged();
246 
247 private:
248  KHTMLPart *part;
249 };
250 
251 #endif
252 
void setAutoloadImages(bool enable)
Specifies whether images contained in the document should be loaded automatically or not...
Definition: khtml_iface.cpp:94
D-BUS interface for KHTML.
Definition: khtml_iface.h:31
Q_CLASSINFO(Name, Value)
void setFixedFont(const QString &name)
Sets the fixed font style.
bool setEncoding(const QString &name)
Sets the encoding the page uses.
bool nextAnchor()
Go to next Anchor.
QString evalJS(const QString &script)
Evaluate a given piece of Javascript code.
This class is khtml&#39;s main class.
Definition: khtml_part.h:208
Q_NOREPLY void print(bool quick)
Print the contents of the current html view.
void setUserStyleSheet(const QString &styleSheet)
Sets a user defined style sheet to be used on top of the HTML 4 default style sheet.
Q_SIGNALSQ_SIGNALS
bool metaRefreshEnabled() const
Returns true if automtaic forwarding is enabled.
bool dndEnabled() const
Returns whether Dragn&#39;n&#39;Drop support is enabled or not.
void activateNode()
Activate the node that currently has the focus (emulates pressing Return)
bool javaEnabled() const
Return if Java applet support is enabled/disabled.
Q_OBJECTQ_OBJECT
QString encoding() const
Returns the encoding the page currently uses.
void setDndEnabled(bool b)
Enables or disables Drag&#39;n&#39;Drop support.
Definition: khtml_iface.cpp:64
QString lastModified() const
Last-modified date (in raw string format), if received in the [HTTP] headers.
void setMetaRefreshEnabled(bool enable)
Enable/disable the automatic forwarding by <meta http-equiv="refresh" ....
bool pluginsEnabled() const
Returns trie if plugins are enabled/disabled.
void setOnlyLocalReferences(bool enable)
Security option.
bool onlyLocalReferences() const
Returns whether references should be loaded ( default false )
Q_PROPERTY(...)
QString url() const
bool jScriptEnabled() const
Returns true if Javascript support is enabled or false otherwise.
void selectAll()
Marks all text in the document as selected.
bool prevAnchor()
Go to previous Anchor.
void setPluginsEnabled(bool enable)
Enables or disables plugins via, default is enabled.
Definition: khtml_iface.cpp:84
QString selectedText() const
Returns the text the user has marked.
void setJScriptEnabled(bool enable)
Enable/disable Javascript support.
Definition: khtml_iface.cpp:44
bool gotoAnchor(const QString &name)
Finds the anchor named name.
void setJavaEnabled(bool enable)
Enables/disables Java applet support.
Definition: khtml_iface.cpp:74
bool autoloadImages() const
Returns whether images contained in the document are loaded automatically or not. ...
Q_SLOTSQ_SLOTS
void stopAnimations()
Stops display of animated images.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:04 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.