• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • khtml
 

khtml

  • khtml
khtml_iface.cc
1 /* This file is part of the KDE project
2  *
3  * Copyright (C) 2002 Stephan Kulow <coolo@kde.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #include "khtml_iface.h"
22 #include "khtml_part.h"
23 #include "khtmlview.h"
24 #include "khtml_ext.h"
25 #include <kio/global.h>
26 #include <tqapplication.h>
27 #include <tqvariant.h>
28 
29 KHTMLPartIface::KHTMLPartIface( KHTMLPart *_part )
30  : DCOPObject( _part->dcopObjectId() ), part(_part)
31 {
32 }
33 
34 KHTMLPartIface::~KHTMLPartIface()
35 {
36 }
37 
38 KURL KHTMLPartIface::url() const
39 {
40  return part->url();
41 }
42 
43 void KHTMLPartIface::setJScriptEnabled( bool enable )
44 {
45  part->setJScriptEnabled(enable);
46 }
47 
48 bool KHTMLPartIface::jScriptEnabled() const
49 {
50  return part->jScriptEnabled();
51 }
52 
53 bool KHTMLPartIface::closeURL()
54 {
55  return part->closeURL();
56 }
57 
58 bool KHTMLPartIface::metaRefreshEnabled() const
59 {
60  return part->metaRefreshEnabled();
61 }
62 
63 void KHTMLPartIface::setDNDEnabled( bool b )
64 {
65  part->setDNDEnabled(b);
66 }
67 
68 bool KHTMLPartIface::dndEnabled() const
69 {
70  return part->dndEnabled();
71 }
72 
73 void KHTMLPartIface::setJavaEnabled( bool enable )
74 {
75  part->setJavaEnabled( enable );
76 }
77 
78 bool KHTMLPartIface::javaEnabled() const
79 {
80  return part->javaEnabled();
81 }
82 
83 void KHTMLPartIface::setPluginsEnabled( bool enable )
84 {
85  part->setPluginsEnabled( enable );
86 }
87 
88 bool KHTMLPartIface::pluginsEnabled() const
89 {
90  return part->pluginsEnabled();
91 }
92 
93 void KHTMLPartIface::setAutoloadImages( bool enable )
94 {
95  part->setAutoloadImages( enable );
96 }
97 
98 bool KHTMLPartIface::autoloadImages() const
99 {
100  return part->autoloadImages();
101 }
102 
103 void KHTMLPartIface::setOnlyLocalReferences(bool enable)
104 {
105  part->setOnlyLocalReferences(enable);
106 }
107 
108 void KHTMLPartIface::setMetaRefreshEnabled( bool enable )
109 {
110  part->setMetaRefreshEnabled(enable);
111 }
112 
113 bool KHTMLPartIface::onlyLocalReferences() const
114 {
115  return part->onlyLocalReferences();
116 }
117 
118 bool KHTMLPartIface::setEncoding( const TQString &name )
119 {
120  return part->setEncoding(name);
121 }
122 
123 TQString KHTMLPartIface::encoding() const
124 {
125  return part->encoding();
126 }
127 
128 void KHTMLPartIface::setFixedFont( const TQString &name )
129 {
130  part->setFixedFont(name);
131 
132 }
133 
134 bool KHTMLPartIface::gotoAnchor( const TQString &name )
135 {
136  return part->gotoAnchor(name);
137 }
138 
139 bool KHTMLPartIface::nextAnchor()
140 {
141  return part->nextAnchor();
142 }
143 
144 bool KHTMLPartIface::prevAnchor()
145 {
146  return part->prevAnchor();
147 }
148 
149 void KHTMLPartIface::activateNode()
150 {
151  KParts::ReadOnlyPart* p = part->currentFrame();
152  if ( p && p->widget() ) {
153  TQKeyEvent ev( TQKeyEvent::KeyPress, Qt::Key_Return, '\n', 0, "\n" );
154  TQApplication::sendEvent( p->widget(), &ev );
155  }
156 }
157 
158 void KHTMLPartIface::selectAll()
159 {
160  part->selectAll();
161 }
162 
163 TQString KHTMLPartIface::lastModified() const
164 {
165  return part->lastModified();
166 }
167 
168 void KHTMLPartIface::debugRenderTree()
169 {
170  part->slotDebugRenderTree();
171 }
172 
173 void KHTMLPartIface::debugDOMTree()
174 {
175  part->slotDebugDOMTree();
176 }
177 
178 void KHTMLPartIface::stopAnimations()
179 {
180  part->slotStopAnimations();
181 }
182 
183 void KHTMLPartIface::viewDocumentSource()
184 {
185  part->slotViewDocumentSource();
186 }
187 
188 void KHTMLPartIface::saveBackground(const TQString &destination)
189 {
190  KURL back = part->backgroundURL();
191  if (back.isEmpty())
192  return;
193 
194  KIO::MetaData metaData;
195  metaData["referrer"] = part->referrer();
196  KHTMLPopupGUIClient::saveURL( back, KURL( destination ), metaData );
197 }
198 
199 void KHTMLPartIface::saveDocument(const TQString &destination)
200 {
201  KURL srcURL( part->url() );
202 
203  if ( srcURL.fileName(false).isEmpty() )
204  srcURL.setFileName( "index.html" );
205 
206  KIO::MetaData metaData;
207  // Referrer unknown?
208  KHTMLPopupGUIClient::saveURL( srcURL, KURL( destination ), metaData, part->cacheId() );
209 }
210 
211 void KHTMLPartIface::setUserStyleSheet(const TQString &styleSheet)
212 {
213  part->setUserStyleSheet(styleSheet);
214 }
215 
216 TQString KHTMLPartIface::selectedText() const
217 {
218  return part->selectedText();
219 }
220 
221 void KHTMLPartIface::viewFrameSource()
222 {
223  part->slotViewFrameSource();
224 }
225 
226 TQString KHTMLPartIface::evalJS(const TQString &script)
227 {
228  return part->executeScript(DOM::Node(), script).toString();
229 }
230 
231 void KHTMLPartIface::print( bool quick ) {
232  part->view()->print( quick );
233 }

khtml

Skip menu "khtml"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

khtml

Skip menu "khtml"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for khtml by doxygen 1.8.3.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |