21 #ifndef __tdeparts_browserextension_h__
22 #define __tdeparts_browserextension_h__
24 #include <sys/types.h>
27 #include <tqptrlist.h>
28 #include <tqdatastream.h>
29 #include <tqstringlist.h>
32 #include <tdeparts/part.h>
33 #include <tdeparts/event.h>
36 typedef TQPtrList<KFileItem> KFileItemList;
41 class BrowserInterface;
43 struct URLArgsPrivate;
60 URLArgs(
const URLArgs &args );
61 URLArgs &operator=(
const URLArgs &args);
63 URLArgs(
bool reload,
int xOffset,
int yOffset,
const TQString &serviceType = TQString::null );
99 void setContentType(
const TQString & contentType );
103 TQString contentType()
const;
108 void setDoPost(
bool enable );
121 void setLockHistory(
bool lock );
122 bool lockHistory()
const;
127 void setNewTab(
bool newTab );
134 TQMap<TQString, TQString> &metaData();
152 bool redirectedRequest ()
const;
160 void setRedirectedRequest(
bool redirected);
166 void setForcesNewWindow(
bool forcesNewWindow );
172 bool forcesNewWindow()
const;
177 struct WindowArgsPrivate;
188 WindowArgs(
const WindowArgs &args );
189 WindowArgs &operator=(
const WindowArgs &args );
190 WindowArgs(
const TQRect &_geometry,
bool _fullscreen,
bool _menuBarVisible,
191 bool _toolBarsVisible,
bool _statusBarVisible,
bool _resizable );
192 WindowArgs(
int _x,
int _y,
int _width,
int _height,
bool _fullscreen,
193 bool _menuBarVisible,
bool _toolBarsVisible,
194 bool _statusBarVisible,
bool _resizable );
204 bool toolBarsVisible;
205 bool statusBarVisible;
209 bool scrollBarsVisible;
211 WindowArgsPrivate *d;
228 KURL url()
const {
return m_url; }
229 URLArgs args()
const {
return m_args; }
231 static bool test(
const TQEvent *event ) {
return Event::test( event, s_strOpenURLEvent ); }
234 static const char *s_strOpenURLEvent;
239 class OpenURLEventPrivate;
240 OpenURLEventPrivate *d;
243 class BrowserExtensionPrivate;
311 TQ_PROPERTY(
bool urlDropHandling READ isURLDropHandlingEnabled WRITE setURLDropHandlingEnabled )
320 const char *name = 0L );
325 typedef uint PopupFlags;
344 enum { DefaultPopupItems=0x0000, ShowNavigationItems=0x0001,
345 ShowUp=0x0002, ShowReload=0x0004, ShowBookmark=0x0008,
346 ShowCreateDirectory=0x0010, ShowTextSelectionItems=0x0020,
356 virtual void setURLArgs(
const URLArgs &args );
370 virtual int xOffset();
376 virtual int yOffset();
385 virtual void saveState( TQDataStream &stream );
394 virtual void restoreState( TQDataStream &stream );
401 bool isURLDropHandlingEnabled()
const;
413 void setURLDropHandlingEnabled(
bool enable );
424 bool isActionEnabled(
const char * name )
const;
433 TQString actionText(
const char * name )
const;
435 typedef TQMap<TQCString,TQCString> ActionSlotMap;
464 static ActionSlotMap actionSlotMap();
470 static ActionSlotMap * actionSlotMapPtr();
486 #define signals public
489 #define signals protected
495 void enableAction(
const char * name,
bool enabled );
504 void setActionText(
const char * name,
const TQString& text );
537 void openURLNotify();
542 void setLocationBarURL(
const TQString &url );
547 void setIconURL(
const KURL &url );
576 void loadingProgress(
int percent );
580 void speedProgress(
int bytesPerSecond );
582 void infoMessage(
const TQString & );
588 void popupMenu(
const TQPoint &global,
const KFileItemList &items );
596 void popupMenu(
KXMLGUIClient *client,
const TQPoint &global,
const KFileItemList &items );
598 void popupMenu(
KXMLGUIClient *client,
const TQPoint &global,
const KFileItemList &items,
const KParts::URLArgs &args, KParts::BrowserExtension::PopupFlags i );
608 void popupMenu(
const TQPoint &global,
const KURL &url,
609 const TQString &mimeType, mode_t mode = (mode_t)-1 );
621 const TQPoint &global,
const KURL &url,
622 const TQString &mimeType, mode_t mode = (mode_t)-1 );
634 const TQPoint &global,
const KURL &url,
635 const KParts::URLArgs &args, KParts::BrowserExtension::PopupFlags i, mode_t mode = (mode_t)-1 );
642 void selectionInfo(
const KFileItemList &items );
647 void selectionInfo(
const TQString &text );
658 void mouseOverInfo(
const KFileItem* item );
664 void addWebSideBar(
const KURL &url,
const TQString& name);
669 void moveTopLevelWidget(
int x,
int y );
674 void resizeTopLevelWidget(
int w,
int h );
687 void setPageSecurity(
int );
689 #define TDEPARTS_BROWSEREXTENSION_HAS_ITEMS_REMOVED
694 void itemsRemoved(
const KFileItemList &items );
697 void slotCompleted();
699 void slotEmitOpenURLRequestDelayed();
700 void slotEnableAction(
const char *,
bool );
701 void slotSetActionText(
const char*,
const TQString& );
707 typedef TQMap<TQCString,int> ActionNumberMap;
710 static ActionNumberMap * s_actionNumberMap;
711 static ActionSlotMap * s_actionSlotMap;
712 static void createActionSlotMap();
714 virtual void virtual_hook(
int id,
void* data );
716 BrowserExtensionPrivate *d;
729 const char *name = 0L );
738 virtual TQStringList frameNames()
const;
745 virtual const TQPtrList<KParts::ReadOnlyPart> frames()
const;
772 enum { VIRTUAL_FIND_FRAME_PARENT = 0x10 };
773 struct FindFrameParentParams
780 virtual void virtual_hook(
int id,
void* data );
782 class BrowserHostExtensionPrivate;
783 BrowserHostExtensionPrivate *d;
797 TypeVoid=0, TypeBool, TypeFunction, TypeNumber, TypeObject, TypeString
799 typedef TQValueList<QPair<Type, TQString> > ArgList;
807 virtual bool get(
const unsigned long objid,
const TQString & field, Type & type,
unsigned long & retobjid, TQString & value );
811 virtual bool put(
const unsigned long objid,
const TQString & field,
const TQString & value );
815 virtual bool call(
const unsigned long objid,
const TQString & func,
const TQStringList & args, Type & type,
unsigned long & retobjid, TQString & value );
819 virtual void unregister(
const unsigned long objid );
826 virtual void partEvent(
const unsigned long objid,
const TQString & event,
const ArgList & args );
The Browser Extension is an extension (yes, no kidding) to KParts::ReadOnlyPart, which allows a bette...
The WindowArgs are used to specify arguments to the "create new window" call (see the createNewWindow...
The purpose of this interface is to allow a direct communication between a KPart and the hosting brow...
TQString frameName
The frame in which to open the URL.
An extension class for LiveConnect, i.e.
bool reload
reload is set when the cache shouldn't be used (forced reload).
TQStringList docState
This buffer can be used by the part to save and restore its contents.
The KParts::OpenURLEvent event informs that a given part has opened a given URL.
An extension class for container parts, i.e.
URLArgs is a set of arguments bundled into a structure, to allow specifying how a URL should be opene...
int xOffset
xOffset is the horizontal scrolling of the part's widget (in case it's a scrollview).
Base class for all KParts events.
int yOffset
yOffset vertical scrolling position, xOffset.
bool trustedSource
If true, the part who asks for a URL to be opened can be 'trusted' to execute applications.
TQString serviceType
The servicetype (usually mimetype) to use when opening the next URL.
Base class for any "viewer" part.
TQByteArray postData
TDEHTML-specific field, contents of the HTTP POST data.