browserextension.cpp
/* This file is part of the KDE project
Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
(C) 1999 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "browserextension.h"
#include <qapplication.h>
#include <qclipboard.h>
#include <qtimer.h>
#include <qobjectlist.h>
#include <qmetaobject.h>
#include <qregexp.h>
#include <qstrlist.h>
#include <qstylesheet.h>
#include <kdebug.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kstaticdeleter.h>
#include <kurifilter.h>
#include <assert.h>
using namespace KParts;
const char *OpenURLEvent::s_strOpenURLEvent = "KParts/BrowserExtension/OpenURLevent";
class OpenURLEvent::OpenURLEventPrivate
{
public:
OpenURLEventPrivate()
{
}
~OpenURLEventPrivate()
{
}
};
OpenURLEvent::OpenURLEvent( ReadOnlyPart *part, const KURL &url, const URLArgs &args )
: Event( s_strOpenURLEvent ), m_part( part ), m_url( url ), m_args( args )
{
// d = new OpenURLEventPrivate();
}
OpenURLEvent::~OpenURLEvent()
{
// delete d;
}
namespace KParts
{
struct URLArgsPrivate
{
URLArgsPrivate() {
doPost = false;
redirectedRequest = false;
lockHistory = false;
newTab = false;
forcesNewWindow = false;
}
QString contentType; // for POST
QMap<QString, QString> metaData;
bool doPost;
bool redirectedRequest;
bool lockHistory;
bool newTab;
bool forcesNewWindow;
};
}
URLArgs::URLArgs()
{
reload = false;
xOffset = 0;
yOffset = 0;
trustedSource = false;
d = 0L; // Let's build it on demand for now
}
URLArgs::URLArgs( bool _reload, int _xOffset, int _yOffset, const QString &_serviceType )
{
reload = _reload;
xOffset = _xOffset;
yOffset = _yOffset;
serviceType = _serviceType;
d = 0L; // Let's build it on demand for now
}
URLArgs::URLArgs( const URLArgs &args )
{
d = 0L;
(*this) = args;
}
URLArgs &URLArgs::operator=(const URLArgs &args)
{
if (this == &args) return *this;
delete d; d= 0;
reload = args.reload;
xOffset = args.xOffset;
yOffset = args.yOffset;
serviceType = args.serviceType;
postData = args.postData;
frameName = args.frameName;
docState = args.docState;
trustedSource = args.trustedSource;
if ( args.d )
d = new URLArgsPrivate( * args.d );
return *this;
}
URLArgs::~URLArgs()
{
delete d;
d = 0;
}
void URLArgs::setContentType( const QString & contentType )
{
if (!d)
d = new URLArgsPrivate;
d->contentType = contentType;
}
void URLArgs::setRedirectedRequest( bool redirected )
{
if (!d)
d = new URLArgsPrivate;
d->redirectedRequest = redirected;
}
bool URLArgs::redirectedRequest () const
{
return d ? d->redirectedRequest : false;
}
QString URLArgs::contentType() const
{
return d ? d->contentType : QString::null;
}
QMap<QString, QString> &URLArgs::metaData()
{
if (!d)
d = new URLArgsPrivate;
return d->metaData;
}
void URLArgs::setDoPost( bool enable )
{
if ( !d )
d = new URLArgsPrivate;
d->doPost = enable;
}
bool URLArgs::doPost() const
{
return d ? d->doPost : false;
}
void URLArgs::setLockHistory( bool lock )
{
if (!d)
d = new URLArgsPrivate;
d->lockHistory = lock;
}
bool URLArgs::lockHistory() const
{
return d ? d->lockHistory : false;
}
void URLArgs::setNewTab( bool newTab )
{
if (!d)
d = new URLArgsPrivate;
d->newTab = newTab;
}
bool URLArgs::newTab() const
{
return d ? d->newTab : false;
}
void URLArgs::setForcesNewWindow( bool forcesNewWindow )
{
if (!d)
d = new URLArgsPrivate;
d->forcesNewWindow = forcesNewWindow;
}
bool URLArgs::forcesNewWindow() const
{
return d ? d->forcesNewWindow : false;
}
namespace KParts
{
struct WindowArgsPrivate
{
};
}
WindowArgs::WindowArgs()
{
x = y = width = height = -1;
fullscreen = false;
menuBarVisible = true;
toolBarsVisible = true;
statusBarVisible = true;
scrollBarsVisible = true;
resizable = true;
lowerWindow = false;
d = 0;
}
WindowArgs::WindowArgs( const WindowArgs &args )
{
d = 0;
(*this) = args;
}
WindowArgs::~WindowArgs()
{
delete d;
}
WindowArgs &WindowArgs::operator=( const WindowArgs &args )
{
if ( this == &args ) return *this;
delete d; d = 0;
x = args.x;
y = args.y;
width = args.width;
height = args.height;
fullscreen = args.fullscreen;
menuBarVisible = args.menuBarVisible;
toolBarsVisible = args.toolBarsVisible;
statusBarVisible = args.statusBarVisible;
scrollBarsVisible = args.scrollBarsVisible;
resizable = args.resizable;
lowerWindow = args.lowerWindow;
/*
if ( args.d )
{
[ ... ]
}
*/
return *this;
}
WindowArgs::WindowArgs( const QRect &_geometry, bool _fullscreen, bool _menuBarVisible,
bool _toolBarsVisible, bool _statusBarVisible, bool _resizable )
{
d = 0;
x = _geometry.x();
y = _geometry.y();
width = _geometry.width();
height = _geometry.height();
fullscreen = _fullscreen;
menuBarVisible = _menuBarVisible;
toolBarsVisible = _toolBarsVisible;
statusBarVisible = _statusBarVisible;
resizable = _resizable;
lowerWindow = false;
}
WindowArgs::WindowArgs( int _x, int _y, int _width, int _height, bool _fullscreen,
bool _menuBarVisible, bool _toolBarsVisible,
bool _statusBarVisible, bool _resizable )
{
d = 0;
x = _x;
y = _y;
width = _width;
height = _height;
fullscreen = _fullscreen;
menuBarVisible = _menuBarVisible;
toolBarsVisible = _toolBarsVisible;
statusBarVisible = _statusBarVisible;
resizable = _resizable;
lowerWindow = false;
}
namespace KParts
{
// Internal class, use to store the status of the actions
class KBitArray
{
public:
int val;
KBitArray() { val = 0; }
bool operator [](int index) { return (val & (1 << index)) ? true : false; }
void setBit(int index, bool value) {
if (value) val = val | (1 << index);
else val = val & ~(1 << index);
}
};
class BrowserExtensionPrivate
{
public:
BrowserExtensionPrivate()
{
m_browserInterface = 0;
}
~BrowserExtensionPrivate()
{
}
struct DelayedRequest {
KURL m_delayedURL;
KParts::URLArgs m_delayedArgs;
};
QValueList<DelayedRequest> m_requests;
bool m_urlDropHandlingEnabled;
KBitArray m_actionStatus;
QMap<int, QString> m_actionText;
BrowserInterface *m_browserInterface;
};
}
BrowserExtension::ActionSlotMap * BrowserExtension::s_actionSlotMap = 0L;
static KStaticDeleter<BrowserExtension::ActionSlotMap> actionSlotMapsd;
BrowserExtension::ActionNumberMap * BrowserExtension::s_actionNumberMap = 0L;
static KStaticDeleter<BrowserExtension::ActionNumberMap> actionNumberMapsd;
BrowserExtension::BrowserExtension( KParts::ReadOnlyPart *parent,
const char *name )
: QObject( parent, name), m_part( parent )
{
//kdDebug() << "BrowserExtension::BrowserExtension() " << this << endl;
d = new BrowserExtensionPrivate;
d->m_urlDropHandlingEnabled = false;
if ( !s_actionSlotMap )
// Create the action-slot map
createActionSlotMap();
// Set the initial status of the actions depending on whether
// they're supported or not
ActionSlotMap::ConstIterator it = s_actionSlotMap->begin();
ActionSlotMap::ConstIterator itEnd = s_actionSlotMap->end();
QStrList slotNames = metaObject()->slotNames();
for ( int i=0 ; it != itEnd ; ++it, ++i )
{
// Does the extension have a slot with the name of this action ?
d->m_actionStatus.setBit( i, slotNames.contains( it.key()+"()" ) );
}
connect( m_part, SIGNAL( completed() ),
this, SLOT( slotCompleted() ) );
connect( this, SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ),
this, SLOT( slotOpenURLRequest( const KURL &, const KParts::URLArgs & ) ) );
connect( this, SIGNAL( enableAction( const char *, bool ) ),
this, SLOT( slotEnableAction( const char *, bool ) ) );
connect( this, SIGNAL( setActionText( const char *, const QString& ) ),
this, SLOT( slotSetActionText( const char *, const QString& ) ) );
}
BrowserExtension::~BrowserExtension()
{
//kdDebug() << "BrowserExtension::~BrowserExtension() " << this << endl;
delete d;
}
void BrowserExtension::setURLArgs( const URLArgs &args )
{
m_args = args;
}
URLArgs BrowserExtension::urlArgs() const
{
return m_args;
}
int BrowserExtension::xOffset()
{
return 0;
}
int BrowserExtension::yOffset()
{
return 0;
}
void BrowserExtension::saveState( QDataStream &stream )
{
stream << m_part->url() << (Q_INT32)xOffset() << (Q_INT32)yOffset();
}
void BrowserExtension::restoreState( QDataStream &stream )
{
KURL u;
Q_INT32 xOfs, yOfs;
stream >> u >> xOfs >> yOfs;
URLArgs args( urlArgs() );
args.xOffset = xOfs;
args.yOffset = yOfs;
setURLArgs( args );
m_part->openURL( u );
}
bool BrowserExtension::isURLDropHandlingEnabled() const
{
return d->m_urlDropHandlingEnabled;
}
void BrowserExtension::setURLDropHandlingEnabled( bool enable )
{
d->m_urlDropHandlingEnabled = enable;
}
void BrowserExtension::slotCompleted()
{
//empty the argument stuff, to avoid bogus/invalid values when opening a new url
setURLArgs( URLArgs() );
}
void BrowserExtension::pasteRequest()
{
QCString plain( "plain" );
QString url = QApplication::clipboard()->text(plain, QClipboard::Selection).stripWhiteSpace();
// Remove linefeeds and any whitespace surrounding it.
url.remove(QRegExp("[\\ ]*\\n+[\\ ]*"));
// Check if it's a URL
QStringList filters = KURIFilter::self()->pluginNames();
filters.remove( "kuriikwsfilter" );
filters.remove( "localdomainurifilter" );
KURIFilterData filterData;
filterData.setData( url );
filterData.setCheckForExecutables( false );
if ( KURIFilter::self()->filterURI( filterData, filters ) )
{
switch ( filterData.uriType() )
{
case KURIFilterData::LOCAL_FILE:
case KURIFilterData::LOCAL_DIR:
case KURIFilterData::NET_PROTOCOL:
slotOpenURLRequest( filterData.uri(), KParts::URLArgs() );
break;
case KURIFilterData::ERROR:
KMessageBox::sorry( m_part->widget(), filterData.errorMsg() );
break;
default:
break;
}
}
else if ( KURIFilter::self()->filterURI( filterData, "kuriikwsfilter" ) && url.length() < 250 )
{
if ( KMessageBox::questionYesNo( m_part->widget(),
i18n( "<qt>Do you want to search the Internet for <b>%1</b>?" ).arg( QStyleSheet::escape(url) ),
i18n( "Internet Search" ), KGuiItem( i18n( "&Search" ), "find"),
KStdGuiItem::cancel(), "MiddleClickSearch" ) == KMessageBox::Yes)
slotOpenURLRequest( filterData.uri(), KParts::URLArgs() );
}
}
void BrowserExtension::slotOpenURLRequest( const KURL &url, const KParts::URLArgs &args )
{
//kdDebug() << this << " BrowserExtension::slotOpenURLRequest(): url=" << url.url() << endl;
BrowserExtensionPrivate::DelayedRequest req;
req.m_delayedURL = url;
req.m_delayedArgs = args;
d->m_requests.append( req );
QTimer::singleShot( 0, this, SLOT( slotEmitOpenURLRequestDelayed() ) );
}
void BrowserExtension::slotEmitOpenURLRequestDelayed()
{
if (d->m_requests.isEmpty()) return;
BrowserExtensionPrivate::DelayedRequest req = d->m_requests.front();
d->m_requests.pop_front();
emit openURLRequestDelayed( req.m_delayedURL, req.m_delayedArgs );
// tricky: do not do anything here! (no access to member variables, etc.)
}
void BrowserExtension::setBrowserInterface( BrowserInterface *impl )
{
d->m_browserInterface = impl;
}
BrowserInterface *BrowserExtension::browserInterface() const
{
return d->m_browserInterface;
}
void BrowserExtension::slotEnableAction( const char * name, bool enabled )
{
//kdDebug() << "BrowserExtension::slotEnableAction " << name << " " << enabled << endl;
ActionNumberMap::ConstIterator it = s_actionNumberMap->find( name );
if ( it != s_actionNumberMap->end() )
{
d->m_actionStatus.setBit( it.data(), enabled );
//kdDebug() << "BrowserExtension::slotEnableAction setting bit " << it.data() << " to " << enabled << endl;
}
else
kdWarning() << "BrowserExtension::slotEnableAction unknown action " << name << endl;
}
bool BrowserExtension::isActionEnabled( const char * name ) const
{
int actionNumber = (*s_actionNumberMap)[ name ];
return d->m_actionStatus[ actionNumber ];
}
void BrowserExtension::slotSetActionText( const char * name, const QString& text )
{
kdDebug() << "BrowserExtension::slotSetActionText " << name << " " << text << endl;
ActionNumberMap::ConstIterator it = s_actionNumberMap->find( name );
if ( it != s_actionNumberMap->end() )
{
d->m_actionText[ it.data() ] = text;
}
else
kdWarning() << "BrowserExtension::slotSetActionText unknown action " << name << endl;
}
QString BrowserExtension::actionText( const char * name ) const
{
int actionNumber = (*s_actionNumberMap)[ name ];
QMap<int, QString>::ConstIterator it = d->m_actionText.find( actionNumber );
if ( it != d->m_actionText.end() )
return *it;
return QString::null;
}
// for compatibility
BrowserExtension::ActionSlotMap BrowserExtension::actionSlotMap()
{
return *actionSlotMapPtr();
}
BrowserExtension::ActionSlotMap * BrowserExtension::actionSlotMapPtr()
{
if (!s_actionSlotMap)
createActionSlotMap();
return s_actionSlotMap;
}
void BrowserExtension::createActionSlotMap()
{
assert(!s_actionSlotMap);
s_actionSlotMap = actionSlotMapsd.setObject( s_actionSlotMap, new ActionSlotMap );
s_actionSlotMap->insert( "cut", SLOT( cut() ) );
s_actionSlotMap->insert( "copy", SLOT( copy() ) );
s_actionSlotMap->insert( "paste", SLOT( paste() ) );
s_actionSlotMap->insert( "rename", SLOT( rename() ) );
s_actionSlotMap->insert( "trash", SLOT( trash() ) );
s_actionSlotMap->insert( "del", SLOT( del() ) );
s_actionSlotMap->insert( "properties", SLOT( properties() ) );
s_actionSlotMap->insert( "editMimeType", SLOT( editMimeType() ) );
s_actionSlotMap->insert( "print", SLOT( print() ) );
// Tricky. Those aren't actions in fact, but simply methods that a browserextension
// can have or not. No need to return them here.
//s_actionSlotMap->insert( "reparseConfiguration", SLOT( reparseConfiguration() ) );
//s_actionSlotMap->insert( "refreshMimeTypes", SLOT( refreshMimeTypes() ) );
// nothing for setSaveViewPropertiesLocally either
// Create the action-number map
assert(!s_actionNumberMap);
s_actionNumberMap = actionNumberMapsd.setObject( s_actionNumberMap, new ActionNumberMap );
ActionSlotMap::ConstIterator it = s_actionSlotMap->begin();
ActionSlotMap::ConstIterator itEnd = s_actionSlotMap->end();
for ( int i=0 ; it != itEnd ; ++it, ++i )
{
//kdDebug(1202) << " action " << it.key() << " number " << i << endl;
s_actionNumberMap->insert( it.key(), i );
}
}
BrowserExtension *BrowserExtension::childObject( QObject *obj )
{
if ( !obj || !obj->children() )
return 0L;
// we try to do it on our own, in hope that we are faster than
// queryList, which looks kind of big :-)
const QObjectList *children = obj->children();
QObjectListIt it( *children );
for (; it.current(); ++it )
if ( it.current()->inherits( "KParts::BrowserExtension" ) )
return static_cast<KParts::BrowserExtension *>( it.current() );
return 0L;
}
namespace KParts
{
class BrowserHostExtension::BrowserHostExtensionPrivate
{
public:
BrowserHostExtensionPrivate()
{
}
~BrowserHostExtensionPrivate()
{
}
KParts::ReadOnlyPart *m_part;
};
}
BrowserHostExtension::BrowserHostExtension( KParts::ReadOnlyPart *parent, const char *name )
: QObject( parent, name )
{
d = new BrowserHostExtensionPrivate;
d->m_part = parent;
}
BrowserHostExtension::~BrowserHostExtension()
{
delete d;
}
QStringList BrowserHostExtension::frameNames() const
{
return QStringList();
}
const QPtrList<KParts::ReadOnlyPart> BrowserHostExtension::frames() const
{
return QPtrList<KParts::ReadOnlyPart>();
}
bool BrowserHostExtension::openURLInFrame( const KURL &, const KParts::URLArgs & )
{
return false;
}
BrowserHostExtension *BrowserHostExtension::childObject( QObject *obj )
{
if ( !obj || !obj->children() )
return 0L;
// we try to do it on our own, in hope that we are faster than
// queryList, which looks kind of big :-)
const QObjectList *children = obj->children();
QObjectListIt it( *children );
for (; it.current(); ++it )
if ( it.current()->inherits( "KParts::BrowserHostExtension" ) )
return static_cast<KParts::BrowserHostExtension *>( it.current() );
return 0L;
}
void BrowserExtension::virtual_hook( int, void* )
{ /*BASE::virtual_hook( id, data );*/ }
BrowserHostExtension *
BrowserHostExtension::findFrameParent(KParts::ReadOnlyPart *callingPart, const QString &frame)
{
FindFrameParentParams param;
param.parent = 0;
param.callingPart = callingPart;
param.frame = frame;
virtual_hook(VIRTUAL_FIND_FRAME_PARENT, &param);
return param.parent;
}
void BrowserHostExtension::virtual_hook( int, void* )
{ /*BASE::virtual_hook( id, data );*/ }
LiveConnectExtension::LiveConnectExtension( KParts::ReadOnlyPart *parent, const char *name ) : QObject( parent, name) {}
bool LiveConnectExtension::get( const unsigned long, const QString &, Type &, unsigned long &, QString & ) {
return false;
}
bool LiveConnectExtension::put( const unsigned long, const QString &, const QString & ) {
return false;
}
bool LiveConnectExtension::call( const unsigned long, const QString &, const QStringList &, Type &, unsigned long &, QString & ) {
return false;
}
void LiveConnectExtension::unregister( const unsigned long ) {}
LiveConnectExtension *LiveConnectExtension::childObject( QObject *obj )
{
if ( !obj || !obj->children() )
return 0L;
// we try to do it on our own, in hope that we are faster than
// queryList, which looks kind of big :-)
const QObjectList *children = obj->children();
QObjectListIt it( *children );
for (; it.current(); ++it )
if ( it.current()->inherits( "KParts::LiveConnectExtension" ) )
return static_cast<KParts::LiveConnectExtension *>( it.current() );
return 0L;
}
#include "browserextension.moc"
KParts::BrowserExtension
The Browser Extension is an extension (yes, no kidding) to KParts::ReadOnlyPart, which allows a bette...
Definition: browserextension.h:308
KURL
KParts::URLArgs::frameName
QString frameName
The frame in which to open the URL.
Definition: browserextension.h:139
KParts::URLArgs::setContentType
void setContentType(const QString &contentType)
KHTML-specific field, header defining the type of the POST data.
Definition: browserextension.cpp:139
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::WindowArgs
The WindowArgs are used to specify arguments to the "create new window" call (see the createNewWindow...
Definition: browserextension.h:184
KParts::BrowserInterface
The purpose of this interface is to allow a direct communication between a KPart and the hosting brow...
Definition: browserinterface.h:38
KParts::BrowserExtension::setURLDropHandlingEnabled
void setURLDropHandlingEnabled(bool enable)
Enables or disables url drop handling.
Definition: browserextension.cpp:441
KParts::URLArgs::metaData
QMap< QString, QString > & metaData()
Meta-data to associate with the next KIO operation.
Definition: browserextension.cpp:163
KStaticDeleter
KMessageBox::questionYesNo
static int questionYesNo(QWidget *parent, const QString &text, const QString &caption=QString::null, const KGuiItem &buttonYes=KStdGuiItem::yes(), const KGuiItem &buttonNo=KStdGuiItem::no(), const QString &dontAskAgainName=QString::null, int options=Notify)
KParts::BrowserExtension::saveState
virtual void saveState(QDataStream &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::LiveConnectExtension::call
virtual bool call(const unsigned long objid, const QString &func, const QStringList &args, Type &type, unsigned long &retobjid, QString &value)
calls a function of objid, return true on success
Definition: browserextension.cpp:710
KParts::BrowserHostExtension::frames
virtual const QPtrList< KParts::ReadOnlyPart > frames() const
Returns a list of pointers to all hosted child objects.
Definition: browserextension.cpp:657
KParts::BrowserExtension::actionSlotMap
static ActionSlotMap actionSlotMap()
Returns a map containing the action names as keys and corresponding SLOT()'ified method names as data...
Definition: browserextension.cpp:562
KParts::Part::widget
virtual QWidget * widget()
Definition: part.cpp:171
kdDebug
kdbgstream kdDebug(int area=0)
KParts::URLArgs::contentType
QString contentType() const
KHTML-specific field, header defining the type of the POST data.
Definition: browserextension.cpp:158
KParts::URLArgs::setDoPost
void setDoPost(bool enable)
KHTML-specific field, whether to do a POST instead of a GET, for the next openURL.
Definition: browserextension.cpp:170
klocale.h
KParts::BrowserHostExtension::frameNames
virtual QStringList frameNames() const
Returns a list of the names of all hosted child objects.
Definition: browserextension.cpp:652
KMessageBox::sorry
static void sorry(QWidget *parent, const QString &text, const QString &caption=QString::null, int options=Notify)
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::restoreState
virtual void restoreState(QDataStream &stream)
Used by the browser to restore the view in the state it was when we left it.
Definition: browserextension.cpp:421
KParts::BrowserExtension::enableAction
void enableAction(const char *name, bool enabled)
Enables or disable a standard action held by the browser.
KParts::LiveConnectExtension
An extension class for LiveConnect, i.e.
Definition: browserextension.h:792
KParts::BrowserExtension::isURLDropHandlingEnabled
bool isURLDropHandlingEnabled() const
Returns whether url drop handling is enabled.
Definition: browserextension.cpp:436
KParts::URLArgs::redirectedRequest
bool redirectedRequest() const
Definition: browserextension.cpp:153
KGuiItem
KParts::URLArgs::setForcesNewWindow
void setForcesNewWindow(bool forcesNewWindow)
Set whether the URL specifies to be opened in a new window.
Definition: browserextension.cpp:206
KParts::BrowserExtension::childObject
static BrowserExtension * childObject(QObject *obj)
Queries obj for a child object which inherits from this BrowserExtension class.
Definition: browserextension.cpp:606
KParts::URLArgs::setLockHistory
void setLockHistory(bool lock)
Whether to lock the history when opening the next URL.
Definition: browserextension.cpp:182
kdWarning
kdbgstream kdWarning(int area=0)
KParts::BrowserExtension::BrowserExtension
BrowserExtension(KParts::ReadOnlyPart *parent, const char *name=0L)
Constructor.
Definition: browserextension.cpp:357
KParts::ReadOnlyPart::url
KURL url() const
Returns the currently in part used URL.
Definition: part.h:390
KParts::BrowserHostExtension::childObject
static BrowserHostExtension * childObject(QObject *obj)
Queries obj for a child object which inherits from this BrowserHostExtension class.
Definition: browserextension.cpp:667
KParts::URLArgs::reload
bool reload
reload is set when the cache shouldn't be used (forced reload).
Definition: browserextension.h:75
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::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::actionSlotMapPtr
static ActionSlotMap * actionSlotMapPtr()
Definition: browserextension.cpp:567
KParts::BrowserHostExtension
An extension class for container parts, i.e.
Definition: browserextension.h:724
KParts::URLArgs
URLArgs is a set of arguments bundled into a structure, to allow specifying how a URL should be opene...
Definition: browserextension.h:57
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::BrowserExtension::openURLRequest
void openURLRequest(const KURL &url, const KParts::URLArgs &args=KParts::URLArgs())
Asks the host (browser) to open url.
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::serviceType
QString serviceType
The servicetype (usually mimetype) to use when opening the next URL.
Definition: browserextension.h:89
KParts::URLArgs::docState
QStringList docState
This buffer can be used by the part to save and restore its contents.
Definition: browserextension.h:70
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::LiveConnectExtension::put
virtual bool put(const unsigned long objid, const QString &field, const QString &value)
put a field value in objid, return true on success
Definition: browserextension.cpp:706
KParts::Event
Base class for all KParts events.
Definition: event.h:36
KParts::URLArgs::forcesNewWindow
bool forcesNewWindow() const
Whether the URL specifies to be opened in a new window.
Definition: browserextension.cpp:213
KParts::BrowserExtension::isActionEnabled
bool isActionEnabled(const char *name) const
Definition: browserextension.cpp:534
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::postData
QByteArray postData
KHTML-specific field, contents of the HTTP POST data.
Definition: browserextension.h:94
KParts::BrowserExtension::pasteRequest
void pasteRequest()
Asks the hosting browser to perform a paste (using openURLRequestDelayed)
Definition: browserextension.cpp:452
endl
kndbgstream & endl(kndbgstream &s)
KParts::BrowserHostExtension::findFrameParent
BrowserHostExtension * findFrameParent(KParts::ReadOnlyPart *callingPart, const QString &frame)
Returns the part that contains frame and that may be accessed by callingPart.
Definition: browserextension.cpp:687
KParts::URLArgs::yOffset
int yOffset
yOffset vertical scrolling position, xOffset.
Definition: browserextension.h:85
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::URLArgs::doPost
bool doPost() const
KHTML-specific field, whether to do a POST instead of a GET, for the next openURL.
Definition: browserextension.cpp:177
KParts::BrowserExtension::xOffset
virtual int xOffset()
Returns the current x offset.
Definition: browserextension.cpp:406
KParts::BrowserExtension::setActionText
void setActionText(const char *name, const QString &text)
Change the text of a standard action held by the browser.
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::BrowserExtension::actionText
QString actionText(const char *name) const
Definition: browserextension.cpp:552
KParts::ReadOnlyPart
Base class for any "viewer" part.
Definition: part.h:338
KParts::LiveConnectExtension::get
virtual bool get(const unsigned long objid, const QString &field, Type &type, unsigned long &retobjid, QString &value)
get a field value from objid, return true on success
Definition: browserextension.cpp:702

KDE Home | KDE Accessibility Home | Description of Access Keys