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

tdeparts

  • tdeparts
browserextension.cpp
1 /* This file is part of the KDE project
2 Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
3 (C) 1999 David Faure <faure@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#include "browserextension.h"
21
22#include <tqapplication.h>
23#include <tqclipboard.h>
24#include <tqtimer.h>
25#include <tqobjectlist.h>
26#include <tqmetaobject.h>
27#include <tqregexp.h>
28#include <tqstrlist.h>
29#include <tqstylesheet.h>
30
31#include <kdebug.h>
32#include <tdelocale.h>
33#include <tdemessagebox.h>
34#include <kstaticdeleter.h>
35#include <kurifilter.h>
36#include <assert.h>
37
38using namespace KParts;
39
40const char *OpenURLEvent::s_strOpenURLEvent = "KParts/BrowserExtension/OpenURLevent";
41
42class OpenURLEvent::OpenURLEventPrivate
43{
44public:
45 OpenURLEventPrivate()
46 {
47 }
48 ~OpenURLEventPrivate()
49 {
50 }
51};
52
53OpenURLEvent::OpenURLEvent( ReadOnlyPart *part, const KURL &url, const URLArgs &args )
54: Event( s_strOpenURLEvent ), m_part( part ), m_url( url ), m_args( args )
55{
56// d = new OpenURLEventPrivate();
57}
58
59OpenURLEvent::~OpenURLEvent()
60{
61// delete d;
62}
63
64namespace KParts
65{
66
67struct URLArgsPrivate
68{
69 URLArgsPrivate() {
70 doPost = false;
71 redirectedRequest = false;
72 lockHistory = false;
73 newTab = false;
74 forcesNewWindow = false;
75 }
76 TQString contentType; // for POST
77 TQMap<TQString, TQString> metaData;
78 bool doPost;
79 bool redirectedRequest;
80 bool lockHistory;
81 bool newTab;
82 bool forcesNewWindow;
83};
84
85}
86
87URLArgs::URLArgs()
88{
89 reload = false;
90 xOffset = 0;
91 yOffset = 0;
92 trustedSource = false;
93 d = 0L; // Let's build it on demand for now
94}
95
96
97URLArgs::URLArgs( bool _reload, int _xOffset, int _yOffset, const TQString &_serviceType )
98{
99 reload = _reload;
100 xOffset = _xOffset;
101 yOffset = _yOffset;
102 serviceType = _serviceType;
103 d = 0L; // Let's build it on demand for now
104}
105
106URLArgs::URLArgs( const URLArgs &args )
107{
108 d = 0L;
109 (*this) = args;
110}
111
112URLArgs &URLArgs::operator=(const URLArgs &args)
113{
114 if (this == &args) return *this;
115
116 delete d; d= 0;
117
118 reload = args.reload;
119 xOffset = args.xOffset;
120 yOffset = args.yOffset;
121 serviceType = args.serviceType;
122 postData = args.postData;
123 frameName = args.frameName;
124 docState = args.docState;
125 trustedSource = args.trustedSource;
126
127 if ( args.d )
128 d = new URLArgsPrivate( * args.d );
129
130 return *this;
131}
132
133URLArgs::~URLArgs()
134{
135 delete d;
136 d = 0;
137}
138
139void URLArgs::setContentType( const TQString & contentType )
140{
141 if (!d)
142 d = new URLArgsPrivate;
143 d->contentType = contentType;
144}
145
146void URLArgs::setRedirectedRequest( bool redirected )
147{
148 if (!d)
149 d = new URLArgsPrivate;
150 d->redirectedRequest = redirected;
151}
152
153bool URLArgs::redirectedRequest () const
154{
155 return d ? d->redirectedRequest : false;
156}
157
158TQString URLArgs::contentType() const
159{
160 return d ? d->contentType : TQString::null;
161}
162
163TQMap<TQString, TQString> &URLArgs::metaData()
164{
165 if (!d)
166 d = new URLArgsPrivate;
167 return d->metaData;
168}
169
170void URLArgs::setDoPost( bool enable )
171{
172 if ( !d )
173 d = new URLArgsPrivate;
174 d->doPost = enable;
175}
176
177bool URLArgs::doPost() const
178{
179 return d ? d->doPost : false;
180}
181
182void URLArgs::setLockHistory( bool lock )
183{
184 if (!d)
185 d = new URLArgsPrivate;
186 d->lockHistory = lock;
187}
188
189bool URLArgs::lockHistory() const
190{
191 return d ? d->lockHistory : false;
192}
193
194void URLArgs::setNewTab( bool newTab )
195{
196 if (!d)
197 d = new URLArgsPrivate;
198 d->newTab = newTab;
199}
200
201bool URLArgs::newTab() const
202{
203 return d ? d->newTab : false;
204}
205
206void URLArgs::setForcesNewWindow( bool forcesNewWindow )
207{
208 if (!d)
209 d = new URLArgsPrivate;
210 d->forcesNewWindow = forcesNewWindow;
211}
212
213bool URLArgs::forcesNewWindow() const
214{
215 return d ? d->forcesNewWindow : false;
216}
217
218namespace KParts
219{
220
221struct WindowArgsPrivate
222{
223};
224
225}
226
227WindowArgs::WindowArgs()
228{
229 x = y = width = height = -1;
230 fullscreen = false;
231 menuBarVisible = true;
232 toolBarsVisible = true;
233 statusBarVisible = true;
234 scrollBarsVisible = true;
235 resizable = true;
236 lowerWindow = false;
237 d = 0;
238}
239
240WindowArgs::WindowArgs( const WindowArgs &args )
241{
242 d = 0;
243 (*this) = args;
244}
245
246WindowArgs::~WindowArgs()
247{
248 delete d;
249}
250
251WindowArgs &WindowArgs::operator=( const WindowArgs &args )
252{
253 if ( this == &args ) return *this;
254
255 delete d; d = 0;
256
257 x = args.x;
258 y = args.y;
259 width = args.width;
260 height = args.height;
261 fullscreen = args.fullscreen;
262 menuBarVisible = args.menuBarVisible;
263 toolBarsVisible = args.toolBarsVisible;
264 statusBarVisible = args.statusBarVisible;
265 scrollBarsVisible = args.scrollBarsVisible;
266 resizable = args.resizable;
267 lowerWindow = args.lowerWindow;
268
269 /*
270 if ( args.d )
271 {
272 [ ... ]
273 }
274 */
275
276 return *this;
277}
278
279WindowArgs::WindowArgs( const TQRect &_geometry, bool _fullscreen, bool _menuBarVisible,
280 bool _toolBarsVisible, bool _statusBarVisible, bool _resizable )
281{
282 d = 0;
283 x = _geometry.x();
284 y = _geometry.y();
285 width = _geometry.width();
286 height = _geometry.height();
287 fullscreen = _fullscreen;
288 menuBarVisible = _menuBarVisible;
289 toolBarsVisible = _toolBarsVisible;
290 statusBarVisible = _statusBarVisible;
291 resizable = _resizable;
292 lowerWindow = false;
293}
294
295WindowArgs::WindowArgs( int _x, int _y, int _width, int _height, bool _fullscreen,
296 bool _menuBarVisible, bool _toolBarsVisible,
297 bool _statusBarVisible, bool _resizable )
298{
299 d = 0;
300 x = _x;
301 y = _y;
302 width = _width;
303 height = _height;
304 fullscreen = _fullscreen;
305 menuBarVisible = _menuBarVisible;
306 toolBarsVisible = _toolBarsVisible;
307 statusBarVisible = _statusBarVisible;
308 resizable = _resizable;
309 lowerWindow = false;
310}
311
312namespace KParts
313{
314
315// Internal class, use to store the status of the actions
316class KBitArray
317{
318public:
319 int val;
320 KBitArray() { val = 0; }
321 bool operator [](int index) { return (val & (1 << index)) ? true : false; }
322 void setBit(int index, bool value) {
323 if (value) val = val | (1 << index);
324 else val = val & ~(1 << index);
325 }
326};
327
328class BrowserExtensionPrivate
329{
330public:
331 BrowserExtensionPrivate()
332 {
333 m_browserInterface = 0;
334 }
335 ~BrowserExtensionPrivate()
336 {
337 }
338
339 struct DelayedRequest {
340 KURL m_delayedURL;
341 KParts::URLArgs m_delayedArgs;
342 };
343 TQValueList<DelayedRequest> m_requests;
344 bool m_urlDropHandlingEnabled;
345 KBitArray m_actionStatus;
346 TQMap<int, TQString> m_actionText;
347 BrowserInterface *m_browserInterface;
348};
349
350}
351
352BrowserExtension::ActionSlotMap * BrowserExtension::s_actionSlotMap = 0L;
353static KStaticDeleter<BrowserExtension::ActionSlotMap> actionSlotMapsd;
354BrowserExtension::ActionNumberMap * BrowserExtension::s_actionNumberMap = 0L;
355static KStaticDeleter<BrowserExtension::ActionNumberMap> actionNumberMapsd;
356
357BrowserExtension::BrowserExtension( KParts::ReadOnlyPart *parent,
358 const char *name )
359: TQObject( parent, name), m_part( parent )
360{
361 //kdDebug() << "BrowserExtension::BrowserExtension() " << this << endl;
362 d = new BrowserExtensionPrivate;
363 d->m_urlDropHandlingEnabled = false;
364
365 if ( !s_actionSlotMap )
366 // Create the action-slot map
367 createActionSlotMap();
368
369 // Set the initial status of the actions depending on whether
370 // they're supported or not
371 ActionSlotMap::ConstIterator it = s_actionSlotMap->begin();
372 ActionSlotMap::ConstIterator itEnd = s_actionSlotMap->end();
373 TQStrList slotNames = metaObject()->slotNames();
374 for ( int i=0 ; it != itEnd ; ++it, ++i )
375 {
376 // Does the extension have a slot with the name of this action ?
377 d->m_actionStatus.setBit( i, slotNames.contains( it.key()+"()" ) );
378 }
379
380 connect( m_part, TQ_SIGNAL( completed() ),
381 this, TQ_SLOT( slotCompleted() ) );
382 connect( this, TQ_SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ),
383 this, TQ_SLOT( slotOpenURLRequest( const KURL &, const KParts::URLArgs & ) ) );
384 connect( this, TQ_SIGNAL( enableAction( const char *, bool ) ),
385 this, TQ_SLOT( slotEnableAction( const char *, bool ) ) );
386 connect( this, TQ_SIGNAL( setActionText( const char *, const TQString& ) ),
387 this, TQ_SLOT( slotSetActionText( const char *, const TQString& ) ) );
388}
389
390BrowserExtension::~BrowserExtension()
391{
392 //kdDebug() << "BrowserExtension::~BrowserExtension() " << this << endl;
393 delete d;
394}
395
396void BrowserExtension::setURLArgs( const URLArgs &args )
397{
398 m_args = args;
399}
400
401URLArgs BrowserExtension::urlArgs() const
402{
403 return m_args;
404}
405
406int BrowserExtension::xOffset()
407{
408 return 0;
409}
410
411int BrowserExtension::yOffset()
412{
413 return 0;
414}
415
416void BrowserExtension::saveState( TQDataStream &stream )
417{
418 stream << m_part->url() << (TQ_INT32)xOffset() << (TQ_INT32)yOffset();
419}
420
421void BrowserExtension::restoreState( TQDataStream &stream )
422{
423 KURL u;
424 TQ_INT32 xOfs, yOfs;
425 stream >> u >> xOfs >> yOfs;
426
427 URLArgs args( urlArgs() );
428 args.xOffset = xOfs;
429 args.yOffset = yOfs;
430
431 setURLArgs( args );
432
433 m_part->openURL( u );
434}
435
436bool BrowserExtension::isURLDropHandlingEnabled() const
437{
438 return d->m_urlDropHandlingEnabled;
439}
440
441void BrowserExtension::setURLDropHandlingEnabled( bool enable )
442{
443 d->m_urlDropHandlingEnabled = enable;
444}
445
446void BrowserExtension::slotCompleted()
447{
448 //empty the argument stuff, to avoid bogus/invalid values when opening a new url
449 setURLArgs( URLArgs() );
450}
451
452void BrowserExtension::pasteRequest()
453{
454 TQCString plain( "plain" );
455 TQString url = TQApplication::clipboard()->text(plain, TQClipboard::Selection).stripWhiteSpace();
456 // Remove linefeeds and any whitespace surrounding it.
457 url.remove(TQRegExp("[\\ ]*\\n+[\\ ]*"));
458
459 // Check if it's a URL
460 TQStringList filters = KURIFilter::self()->pluginNames();
461 filters.remove( "kuriikwsfilter" );
462 filters.remove( "localdomainurifilter" );
463 KURIFilterData filterData;
464 filterData.setData( url );
465 filterData.setCheckForExecutables( false );
466 if ( KURIFilter::self()->filterURI( filterData, filters ) )
467 {
468 switch ( filterData.uriType() )
469 {
470 case KURIFilterData::LOCAL_FILE:
471 case KURIFilterData::LOCAL_DIR:
472 case KURIFilterData::NET_PROTOCOL:
473 slotOpenURLRequest( filterData.uri(), KParts::URLArgs() );
474 break;
475 case KURIFilterData::ERROR:
476 KMessageBox::sorry( m_part->widget(), filterData.errorMsg() );
477 break;
478 default:
479 break;
480 }
481 }
482 else if ( KURIFilter::self()->filterURI( filterData, "kuriikwsfilter" ) && url.length() < 250 )
483 {
484 if ( KMessageBox::questionYesNo( m_part->widget(),
485 i18n( "<qt>Do you want to search the Internet for <b>%1</b>?" ).arg( TQStyleSheet::escape(url) ),
486 i18n( "Internet Search" ), KGuiItem( i18n( "&Search" ), "edit-find"),
487 KStdGuiItem::cancel(), "MiddleClickSearch" ) == KMessageBox::Yes)
488 slotOpenURLRequest( filterData.uri(), KParts::URLArgs() );
489 }
490}
491
492void BrowserExtension::slotOpenURLRequest( const KURL &url, const KParts::URLArgs &args )
493{
494 //kdDebug() << this << " BrowserExtension::slotOpenURLRequest(): url=" << url.url() << endl;
495 BrowserExtensionPrivate::DelayedRequest req;
496 req.m_delayedURL = url;
497 req.m_delayedArgs = args;
498 d->m_requests.append( req );
499 TQTimer::singleShot( 0, this, TQ_SLOT( slotEmitOpenURLRequestDelayed() ) );
500}
501
502void BrowserExtension::slotEmitOpenURLRequestDelayed()
503{
504 if (d->m_requests.isEmpty()) return;
505 BrowserExtensionPrivate::DelayedRequest req = d->m_requests.front();
506 d->m_requests.pop_front();
507 emit openURLRequestDelayed( req.m_delayedURL, req.m_delayedArgs );
508 // tricky: do not do anything here! (no access to member variables, etc.)
509}
510
511void BrowserExtension::setBrowserInterface( BrowserInterface *impl )
512{
513 d->m_browserInterface = impl;
514}
515
516BrowserInterface *BrowserExtension::browserInterface() const
517{
518 return d->m_browserInterface;
519}
520
521void BrowserExtension::slotEnableAction( const char * name, bool enabled )
522{
523 //kdDebug() << "BrowserExtension::slotEnableAction " << name << " " << enabled << endl;
524 ActionNumberMap::ConstIterator it = s_actionNumberMap->find( name );
525 if ( it != s_actionNumberMap->end() )
526 {
527 d->m_actionStatus.setBit( it.data(), enabled );
528 //kdDebug() << "BrowserExtension::slotEnableAction setting bit " << it.data() << " to " << enabled << endl;
529 }
530 else
531 kdWarning() << "BrowserExtension::slotEnableAction unknown action " << name << endl;
532}
533
534bool BrowserExtension::isActionEnabled( const char * name ) const
535{
536 int actionNumber = (*s_actionNumberMap)[ name ];
537 return d->m_actionStatus[ actionNumber ];
538}
539
540void BrowserExtension::slotSetActionText( const char * name, const TQString& text )
541{
542 kdDebug() << "BrowserExtension::slotSetActionText " << name << " " << text << endl;
543 ActionNumberMap::ConstIterator it = s_actionNumberMap->find( name );
544 if ( it != s_actionNumberMap->end() )
545 {
546 d->m_actionText[ it.data() ] = text;
547 }
548 else
549 kdWarning() << "BrowserExtension::slotSetActionText unknown action " << name << endl;
550}
551
552TQString BrowserExtension::actionText( const char * name ) const
553{
554 int actionNumber = (*s_actionNumberMap)[ name ];
555 TQMap<int, TQString>::ConstIterator it = d->m_actionText.find( actionNumber );
556 if ( it != d->m_actionText.end() )
557 return *it;
558 return TQString::null;
559}
560
561// for compatibility
562BrowserExtension::ActionSlotMap BrowserExtension::actionSlotMap()
563{
564 return *actionSlotMapPtr();
565}
566
567BrowserExtension::ActionSlotMap * BrowserExtension::actionSlotMapPtr()
568{
569 if (!s_actionSlotMap)
570 createActionSlotMap();
571 return s_actionSlotMap;
572}
573
574void BrowserExtension::createActionSlotMap()
575{
576 assert(!s_actionSlotMap);
577 s_actionSlotMap = actionSlotMapsd.setObject( s_actionSlotMap, new ActionSlotMap );
578
579 s_actionSlotMap->insert( "cut", TQ_SLOT( cut() ) );
580 s_actionSlotMap->insert( "copy", TQ_SLOT( copy() ) );
581 s_actionSlotMap->insert( "paste", TQ_SLOT( paste() ) );
582 s_actionSlotMap->insert( "rename", TQ_SLOT( rename() ) );
583 s_actionSlotMap->insert( "trash", TQ_SLOT( trash() ) );
584 s_actionSlotMap->insert( "del", TQ_SLOT( del() ) );
585 s_actionSlotMap->insert( "properties", TQ_SLOT( properties() ) );
586 s_actionSlotMap->insert( "editMimeType", TQ_SLOT( editMimeType() ) );
587 s_actionSlotMap->insert( "print", TQ_SLOT( print() ) );
588 // Tricky. Those aren't actions in fact, but simply methods that a browserextension
589 // can have or not. No need to return them here.
590 //s_actionSlotMap->insert( "reparseConfiguration", TQ_SLOT( reparseConfiguration() ) );
591 //s_actionSlotMap->insert( "refreshMimeTypes", TQ_SLOT( refreshMimeTypes() ) );
592 // nothing for setSaveViewPropertiesLocally either
593
594 // Create the action-number map
595 assert(!s_actionNumberMap);
596 s_actionNumberMap = actionNumberMapsd.setObject( s_actionNumberMap, new ActionNumberMap );
597 ActionSlotMap::ConstIterator it = s_actionSlotMap->begin();
598 ActionSlotMap::ConstIterator itEnd = s_actionSlotMap->end();
599 for ( int i=0 ; it != itEnd ; ++it, ++i )
600 {
601 //kdDebug(1202) << " action " << it.key() << " number " << i << endl;
602 s_actionNumberMap->insert( it.key(), i );
603 }
604}
605
606BrowserExtension *BrowserExtension::childObject( TQObject *obj )
607{
608 if ( !obj || obj->childrenListObject().isEmpty() )
609 return 0L;
610
611 // we try to do it on our own, in hope that we are faster than
612 // queryList, which looks kind of big :-)
613 const TQObjectList children = obj->childrenListObject();
614 TQObjectListIt it( children );
615 for (; it.current(); ++it )
616 if ( it.current()->inherits( "KParts::BrowserExtension" ) )
617 return static_cast<KParts::BrowserExtension *>( it.current() );
618
619 return 0L;
620}
621
622namespace KParts
623{
624
625class BrowserHostExtension::BrowserHostExtensionPrivate
626{
627public:
628 BrowserHostExtensionPrivate()
629 {
630 }
631 ~BrowserHostExtensionPrivate()
632 {
633 }
634
635 KParts::ReadOnlyPart *m_part;
636};
637
638}
639
640BrowserHostExtension::BrowserHostExtension( KParts::ReadOnlyPart *parent, const char *name )
641 : TQObject( parent, name )
642{
643 d = new BrowserHostExtensionPrivate;
644 d->m_part = parent;
645}
646
647BrowserHostExtension::~BrowserHostExtension()
648{
649 delete d;
650}
651
652TQStringList BrowserHostExtension::frameNames() const
653{
654 return TQStringList();
655}
656
657const TQPtrList<KParts::ReadOnlyPart> BrowserHostExtension::frames() const
658{
659 return TQPtrList<KParts::ReadOnlyPart>();
660}
661
662bool BrowserHostExtension::openURLInFrame( const KURL &, const KParts::URLArgs & )
663{
664 return false;
665}
666
667BrowserHostExtension *BrowserHostExtension::childObject( TQObject *obj )
668{
669 if ( !obj || obj->childrenListObject().isEmpty() )
670 return 0L;
671
672 // we try to do it on our own, in hope that we are faster than
673 // queryList, which looks kind of big :-)
674 const TQObjectList children = obj->childrenListObject();
675 TQObjectListIt it( children );
676 for (; it.current(); ++it )
677 if ( it.current()->inherits( "KParts::BrowserHostExtension" ) )
678 return static_cast<KParts::BrowserHostExtension *>( it.current() );
679
680 return 0L;
681}
682
683void BrowserExtension::virtual_hook( int, void* )
684{ /*BASE::virtual_hook( id, data );*/ }
685
686BrowserHostExtension *
687BrowserHostExtension::findFrameParent(KParts::ReadOnlyPart *callingPart, const TQString &frame)
688{
689 FindFrameParentParams param;
690 param.parent = 0;
691 param.callingPart = callingPart;
692 param.frame = frame;
693 virtual_hook(VIRTUAL_FIND_FRAME_PARENT, &param);
694 return param.parent;
695}
696
697void BrowserHostExtension::virtual_hook( int, void* )
698{ /*BASE::virtual_hook( id, data );*/ }
699
700LiveConnectExtension::LiveConnectExtension( KParts::ReadOnlyPart *parent, const char *name ) : TQObject( parent, name) {}
701
702bool LiveConnectExtension::get( const unsigned long, const TQString &, Type &, unsigned long &, TQString & ) {
703 return false;
704}
705
706bool LiveConnectExtension::put( const unsigned long, const TQString &, const TQString & ) {
707 return false;
708}
709
710bool LiveConnectExtension::call( const unsigned long, const TQString &, const TQStringList &, Type &, unsigned long &, TQString & ) {
711 return false;
712}
713
714void LiveConnectExtension::unregister( const unsigned long ) {}
715
716LiveConnectExtension *LiveConnectExtension::childObject( TQObject *obj )
717{
718 if ( !obj || obj->childrenListObject().isEmpty() )
719 return 0L;
720
721 // we try to do it on our own, in hope that we are faster than
722 // queryList, which looks kind of big :-)
723 const TQObjectList children = obj->childrenListObject();
724 TQObjectListIt it( children );
725 for (; it.current(); ++it )
726 if ( it.current()->inherits( "KParts::LiveConnectExtension" ) )
727 return static_cast<KParts::LiveConnectExtension *>( it.current() );
728
729 return 0L;
730}
731
732#include "browserextension.moc"
KGuiItem
KMessageBox::questionYesNo
static int questionYesNo(TQWidget *parent, const TQString &text, const TQString &caption=TQString::null, const KGuiItem &buttonYes=KStdGuiItem::yes(), const KGuiItem &buttonNo=KStdGuiItem::no(), const TQString &dontAskAgainName=TQString::null, int options=Notify)
KMessageBox::sorry
static void sorry(TQWidget *parent, const TQString &text, const TQString &caption=TQString::null, int options=Notify)
KParts::BrowserExtension
The Browser Extension is an extension (yes, no kidding) to KParts::ReadOnlyPart, which allows a bette...
Definition: browserextension.h:309
KParts::BrowserExtension::pasteRequest
void pasteRequest()
Asks the hosting browser to perform a paste (using openURLRequestDelayed)
Definition: browserextension.cpp:452
KParts::BrowserExtension::xOffset
virtual int xOffset()
Returns the current x offset.
Definition: browserextension.cpp:406
KParts::BrowserExtension::urlArgs
URLArgs urlArgs() const
Retrieve the set of parameters to use for opening the URL (this must be called from openURL() in the ...
Definition: browserextension.cpp:401
KParts::BrowserExtension::actionSlotMapPtr
static ActionSlotMap * actionSlotMapPtr()
Definition: browserextension.cpp:567
KParts::BrowserExtension::enableAction
void enableAction(const char *name, bool enabled)
Enables or disable a standard action held by the browser.
KParts::BrowserExtension::setURLArgs
virtual void setURLArgs(const URLArgs &args)
Set the parameters to use for opening the next URL.
Definition: browserextension.cpp:396
KParts::BrowserExtension::BrowserExtension
BrowserExtension(KParts::ReadOnlyPart *parent, const char *name=0L)
Constructor.
Definition: browserextension.cpp:357
KParts::BrowserExtension::isActionEnabled
bool isActionEnabled(const char *name) const
Definition: browserextension.cpp:534
KParts::BrowserExtension::isURLDropHandlingEnabled
bool isURLDropHandlingEnabled() const
Returns whether url drop handling is enabled.
Definition: browserextension.cpp:436
KParts::BrowserExtension::childObject
static BrowserExtension * childObject(TQObject *obj)
Queries obj for a child object which inherits from this BrowserExtension class.
Definition: browserextension.cpp:606
KParts::BrowserExtension::actionSlotMap
static ActionSlotMap actionSlotMap()
Returns a map containing the action names as keys and corresponding TQ_SLOT()'ified method names as d...
Definition: browserextension.cpp:562
KParts::BrowserExtension::restoreState
virtual void restoreState(TQDataStream &stream)
Used by the browser to restore the view in the state it was when we left it.
Definition: browserextension.cpp:421
KParts::BrowserExtension::saveState
virtual void saveState(TQDataStream &stream)
Used by the browser to save the current state of the view (in order to restore it if going back in na...
Definition: browserextension.cpp:416
KParts::BrowserExtension::actionText
TQString actionText(const char *name) const
Definition: browserextension.cpp:552
KParts::BrowserExtension::yOffset
virtual int yOffset()
Returns the current y offset.
Definition: browserextension.cpp:411
KParts::BrowserExtension::openURLRequestDelayed
void openURLRequestDelayed(const KURL &url, const KParts::URLArgs &args=KParts::URLArgs())
This signal is emitted when openURLRequest is called, after a 0-seconds timer.
KParts::BrowserExtension::openURLRequest
void openURLRequest(const KURL &url, const KParts::URLArgs &args=KParts::URLArgs())
Asks the host (browser) to open url.
KParts::BrowserExtension::setURLDropHandlingEnabled
void setURLDropHandlingEnabled(bool enable)
Enables or disables url drop handling.
Definition: browserextension.cpp:441
KParts::BrowserExtension::setActionText
void setActionText(const char *name, const TQString &text)
Change the text of a standard action held by the browser.
KParts::BrowserHostExtension
An extension class for container parts, i.e.
Definition: browserextension.h:725
KParts::BrowserHostExtension::openURLInFrame
virtual bool openURLInFrame(const KURL &url, const KParts::URLArgs &urlArgs)
Opens the given url in a hosted child frame.
Definition: browserextension.cpp:662
KParts::BrowserHostExtension::frames
virtual const TQPtrList< KParts::ReadOnlyPart > frames() const
Returns a list of pointers to all hosted child objects.
Definition: browserextension.cpp:657
KParts::BrowserHostExtension::frameNames
virtual TQStringList frameNames() const
Returns a list of the names of all hosted child objects.
Definition: browserextension.cpp:652
KParts::BrowserHostExtension::findFrameParent
BrowserHostExtension * findFrameParent(KParts::ReadOnlyPart *callingPart, const TQString &frame)
Returns the part that contains frame and that may be accessed by callingPart.
Definition: browserextension.cpp:687
KParts::BrowserHostExtension::childObject
static BrowserHostExtension * childObject(TQObject *obj)
Queries obj for a child object which inherits from this BrowserHostExtension class.
Definition: browserextension.cpp:667
KParts::BrowserInterface
The purpose of this interface is to allow a direct communication between a KPart and the hosting brow...
Definition: browserinterface.h:39
KParts::Event
Base class for all KParts events.
Definition: event.h:37
KParts::LiveConnectExtension
An extension class for LiveConnect, i.e.
Definition: browserextension.h:793
KParts::LiveConnectExtension::unregister
virtual void unregister(const unsigned long objid)
notifies the part that there is no reference anymore to objid
Definition: browserextension.cpp:714
KParts::LiveConnectExtension::put
virtual bool put(const unsigned long objid, const TQString &field, const TQString &value)
put a field value in objid, return true on success
Definition: browserextension.cpp:706
KParts::LiveConnectExtension::get
virtual bool get(const unsigned long objid, const TQString &field, Type &type, unsigned long &retobjid, TQString &value)
get a field value from objid, return true on success
Definition: browserextension.cpp:702
KParts::LiveConnectExtension::call
virtual bool call(const unsigned long objid, const TQString &func, const TQStringList &args, Type &type, unsigned long &retobjid, TQString &value)
calls a function of objid, return true on success
Definition: browserextension.cpp:710
KParts::Part::widget
virtual TQWidget * widget()
Definition: part.cpp:171
KParts::ReadOnlyPart
Base class for any "viewer" part.
Definition: part.h:339
KParts::ReadOnlyPart::openURL
virtual bool openURL(const KURL &url)
Only reimplement openURL if you don't want the network transparency support to download from the url ...
Definition: part.cpp:333
KParts::ReadOnlyPart::url
KURL url() const
Returns the currently in part used URL.
Definition: part.h:390
KStaticDeleter
KURL
kdWarning
kdbgstream kdWarning(int area=0)
endl
kndbgstream & endl(kndbgstream &s)
kdDebug
kdbgstream kdDebug(int area=0)
TDEStdAccel::name
TQString name(StdAccel id)
KParts::URLArgs
URLArgs is a set of arguments bundled into a structure, to allow specifying how a URL should be opene...
Definition: browserextension.h:58
KParts::URLArgs::setContentType
void setContentType(const TQString &contentType)
TDEHTML-specific field, header defining the type of the POST data.
Definition: browserextension.cpp:139
KParts::URLArgs::docState
TQStringList docState
This buffer can be used by the part to save and restore its contents.
Definition: browserextension.h:70
KParts::URLArgs::contentType
TQString contentType() const
TDEHTML-specific field, header defining the type of the POST data.
Definition: browserextension.cpp:158
KParts::URLArgs::setNewTab
void setNewTab(bool newTab)
Whether the URL should be opened in a new tab instead in a new window.
Definition: browserextension.cpp:194
KParts::URLArgs::xOffset
int xOffset
xOffset is the horizontal scrolling of the part's widget (in case it's a scrollview).
Definition: browserextension.h:81
KParts::URLArgs::setDoPost
void setDoPost(bool enable)
TDEHTML-specific field, whether to do a POST instead of a GET, for the next openURL.
Definition: browserextension.cpp:170
KParts::URLArgs::redirectedRequest
bool redirectedRequest() const
Definition: browserextension.cpp:153
KParts::URLArgs::metaData
TQMap< TQString, TQString > & metaData()
Meta-data to associate with the next TDEIO operation.
Definition: browserextension.cpp:163
KParts::URLArgs::frameName
TQString frameName
The frame in which to open the URL.
Definition: browserextension.h:139
KParts::URLArgs::setLockHistory
void setLockHistory(bool lock)
Whether to lock the history when opening the next URL.
Definition: browserextension.cpp:182
KParts::URLArgs::reload
bool reload
reload is set when the cache shouldn't be used (forced reload).
Definition: browserextension.h:75
KParts::URLArgs::doPost
bool doPost() const
TDEHTML-specific field, whether to do a POST instead of a GET, for the next openURL.
Definition: browserextension.cpp:177
KParts::URLArgs::setRedirectedRequest
void setRedirectedRequest(bool redirected)
Set the redirect flag to indicate URL is a result of either a META redirect or HTTP redirect.
Definition: browserextension.cpp:146
KParts::URLArgs::yOffset
int yOffset
yOffset vertical scrolling position, xOffset.
Definition: browserextension.h:85
KParts::URLArgs::serviceType
TQString serviceType
The servicetype (usually mimetype) to use when opening the next URL.
Definition: browserextension.h:89
KParts::URLArgs::setForcesNewWindow
void setForcesNewWindow(bool forcesNewWindow)
Set whether the URL specifies to be opened in a new window.
Definition: browserextension.cpp:206
KParts::URLArgs::forcesNewWindow
bool forcesNewWindow() const
Whether the URL specifies to be opened in a new window.
Definition: browserextension.cpp:213
KParts::URLArgs::postData
TQByteArray postData
TDEHTML-specific field, contents of the HTTP POST data.
Definition: browserextension.h:94
KParts::URLArgs::trustedSource
bool trustedSource
If true, the part who asks for a URL to be opened can be 'trusted' to execute applications.
Definition: browserextension.h:146
KParts::WindowArgs
The WindowArgs are used to specify arguments to the "create new window" call (see the createNewWindow...
Definition: browserextension.h:185
tdelocale.h

tdeparts

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

tdeparts

Skip menu "tdeparts"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeparts by doxygen 1.9.4
This website is maintained by Timothy Pearson.