mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-24 10:52:52 +00:00
310 lines
13 KiB
Text
310 lines
13 KiB
Text
//
|
|
// Copyright 2008 Jim Bublitz <jbublitz@nwinternet.com>
|
|
// Earlier copyrights 1998 - 2007 Jim Bublitz also apply
|
|
|
|
// Generated by twine
|
|
|
|
// This file is part of PyKDE4.
|
|
|
|
// PyKDE4 is free software; you can redistribute it and/or modify
|
|
// it under the terms of the GNU Lesser General Public License as
|
|
// published by the Free Software Foundation; either version 2.1 of
|
|
// the License, or (at your option) any later version.
|
|
|
|
// PyKDE4 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 General Public License for more details.
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
%ModuleHeaderCode
|
|
//ctscc
|
|
#include <kparts/browserextension.h>
|
|
#include <kparts/browserinterface.h>
|
|
#include <kparts/browserrun.h>
|
|
#include <kparts/fileinfoextension.h>
|
|
#include <kparts/historyprovider.h>
|
|
#include <kparts/htmlextension.h>
|
|
#include <kparts/mainwindow.h>
|
|
#include <kparts/part.h>
|
|
#include <kparts/partmanager.h>
|
|
#include <kparts/plugin.h>
|
|
#include <qobject.h>
|
|
#include <kparts/scriptableextension.h>
|
|
#include <kparts/statusbarextension.h>
|
|
#include <kparts/textextension.h>
|
|
%End
|
|
|
|
namespace KParts
|
|
{
|
|
|
|
class BrowserArguments
|
|
{
|
|
%TypeHeaderCode
|
|
#include <kparts/browserextension.h>
|
|
%End
|
|
|
|
|
|
public:
|
|
BrowserArguments ();
|
|
BrowserArguments (const KParts::BrowserArguments& args);
|
|
QStringList docState;
|
|
bool softReload;
|
|
QByteArray postData;
|
|
QString frameName;
|
|
bool trustedSource;
|
|
private:
|
|
~BrowserArguments ();
|
|
};
|
|
// BrowserArguments
|
|
|
|
|
|
class WindowArgs
|
|
{
|
|
%TypeHeaderCode
|
|
#include <kparts/browserextension.h>
|
|
%End
|
|
|
|
|
|
public:
|
|
WindowArgs ();
|
|
WindowArgs (const KParts::WindowArgs& args);
|
|
WindowArgs (const QRect& _geometry, bool _fullscreen, bool _menuBarVisible, bool _toolBarsVisible, bool _statusBarVisible, bool _resizable);
|
|
WindowArgs (int _x, int _y, int _width, int _height, bool _fullscreen, bool _menuBarVisible, bool _toolBarsVisible, bool _statusBarVisible, bool _resizable);
|
|
void setX (int x);
|
|
int x () const;
|
|
void setY (int y);
|
|
int y () const;
|
|
void setWidth (int w);
|
|
int width () const;
|
|
void setHeight (int h);
|
|
int height () const;
|
|
void setFullScreen (bool fs);
|
|
bool isFullScreen () const;
|
|
void setMenuBarVisible (bool visible);
|
|
bool isMenuBarVisible () const;
|
|
void setToolBarsVisible (bool visible);
|
|
bool toolBarsVisible () const;
|
|
void setStatusBarVisible (bool visible);
|
|
bool isStatusBarVisible () const;
|
|
void setResizable (bool resizable);
|
|
bool isResizable () const;
|
|
void setLowerWindow (bool lower);
|
|
bool lowerWindow () const;
|
|
void setScrollBarsVisible (bool visible);
|
|
bool scrollBarsVisible () const;
|
|
~WindowArgs ();
|
|
};
|
|
// WindowArgs
|
|
|
|
|
|
class OpenUrlEvent : KParts::Event
|
|
{
|
|
%TypeHeaderCode
|
|
#include <kparts/browserextension.h>
|
|
%End
|
|
|
|
|
|
public:
|
|
OpenUrlEvent (KParts::ReadOnlyPart* part, const KUrl& url, const KParts::OpenUrlArguments& args = KParts::OpenUrlArguments(), const KParts::BrowserArguments& browserArgs = KParts::BrowserArguments());
|
|
KParts::ReadOnlyPart* part () const;
|
|
KUrl url () const;
|
|
KParts::OpenUrlArguments arguments () const;
|
|
KParts::BrowserArguments browserArguments () const;
|
|
static bool test (const QEvent* event);
|
|
~OpenUrlEvent ();
|
|
};
|
|
// OpenUrlEvent
|
|
|
|
|
|
class BrowserExtension : QObject
|
|
{
|
|
%TypeHeaderCode
|
|
#include <kparts/browserextension.h>
|
|
%End
|
|
|
|
|
|
public:
|
|
explicit BrowserExtension (KParts::ReadOnlyPart* parent);
|
|
|
|
enum PopupFlag
|
|
{
|
|
DefaultPopupItems,
|
|
ShowNavigationItems,
|
|
ShowUp,
|
|
ShowReload,
|
|
ShowBookmark,
|
|
ShowCreateDirectory,
|
|
ShowTextSelectionItems,
|
|
NoDeletion,
|
|
IsLink,
|
|
ShowUrlOperations,
|
|
ShowProperties
|
|
};
|
|
|
|
typedef QFlags<KParts::BrowserExtension::PopupFlag> PopupFlags;
|
|
|
|
virtual void setBrowserArguments (const KParts::BrowserArguments& args);
|
|
KParts::BrowserArguments browserArguments () const;
|
|
virtual int xOffset ();
|
|
virtual int yOffset ();
|
|
virtual void saveState (QDataStream& stream);
|
|
virtual void restoreState (QDataStream& stream);
|
|
bool isURLDropHandlingEnabled () const;
|
|
void setURLDropHandlingEnabled (bool enable);
|
|
void setBrowserInterface (KParts::BrowserInterface* impl);
|
|
KParts::BrowserInterface* browserInterface () const;
|
|
bool isActionEnabled (const char* name) const;
|
|
QString actionText (const char* name) const;
|
|
typedef QMap<QByteArray,QByteArray> ActionSlotMap;
|
|
|
|
static KParts::BrowserExtension::ActionSlotMap actionSlotMap ();
|
|
static KParts::BrowserExtension::ActionSlotMap* actionSlotMapPtr ();
|
|
static KParts::BrowserExtension* childObject (QObject* obj);
|
|
void pasteRequest ();
|
|
//ig typedef QMap<QString,QList<QAction*>> ActionGroupMap;
|
|
|
|
void enableAction (const char* name, bool enabled);
|
|
void setActionText (const char* name, const QString& text);
|
|
void openUrlRequest (const KUrl& url, const KParts::OpenUrlArguments& arguments = KParts::OpenUrlArguments(), const KParts::BrowserArguments& browserArguments = KParts::BrowserArguments());
|
|
void openUrlRequestDelayed (const KUrl& url, const KParts::OpenUrlArguments& arguments, const KParts::BrowserArguments& browserArguments);
|
|
void openUrlNotify ();
|
|
void setLocationBarUrl (const QString& url);
|
|
void setIconUrl (const KUrl& url);
|
|
void createNewWindow (const KUrl& url, const KParts::OpenUrlArguments& arguments = KParts::OpenUrlArguments(), const KParts::BrowserArguments& browserArguments = KParts::BrowserArguments(), const KParts::WindowArgs& windowArgs = KParts::WindowArgs(), KParts::ReadOnlyPart** part = 0) [void (const KUrl&, const KParts::OpenUrlArguments& = KParts::OpenUrlArguments(), const KParts::BrowserArguments& = KParts::BrowserArguments(), const KParts::WindowArgs& = KParts::WindowArgs(), KParts::ReadOnlyPart** = 0)];
|
|
%MethodCode
|
|
Py_BEGIN_ALLOW_THREADS
|
|
sipCpp->KParts::BrowserExtension::createNewWindow (*a0, *a1, *a2, *a3, &a4);
|
|
Py_END_ALLOW_THREADS
|
|
%End
|
|
|
|
void loadingProgress (int percent);
|
|
void speedProgress (int bytesPerSecond);
|
|
void infoMessage (const QString&);
|
|
//ig void popupMenu (const QPoint& global, const KFileItemList& items, const KParts::OpenUrlArguments& args = KParts::OpenUrlArguments(), const KParts::BrowserArguments& browserArgs = KParts::BrowserArguments(), KParts::BrowserExtension::PopupFlags flags = KParts::BrowserExtension::DefaultPopupItems, const KParts::BrowserExtension::ActionGroupMap& actionGroups = KParts::BrowserExtension::ActionGroupMap());
|
|
//ig void popupMenu (const QPoint& global, const KUrl& url, mode_t mode = -1, const KParts::OpenUrlArguments& args = KParts::OpenUrlArguments(), const KParts::BrowserArguments& browserArgs = KParts::BrowserArguments(), KParts::BrowserExtension::PopupFlags flags = KParts::BrowserExtension::DefaultPopupItems, const KParts::BrowserExtension::ActionGroupMap& actionGroups = KParts::BrowserExtension::ActionGroupMap());
|
|
void selectionInfo (const KFileItemList& items);
|
|
void selectionInfo (const QString& text);
|
|
void selectionInfo (const KUrl::List& urls);
|
|
void mouseOverInfo (const KFileItem& item);
|
|
void addWebSideBar (const KUrl& url, const QString& name);
|
|
void moveTopLevelWidget (int x, int y);
|
|
void resizeTopLevelWidget (int w, int h);
|
|
void requestFocus (KParts::ReadOnlyPart* part);
|
|
void setPageSecurity (int);
|
|
void itemsRemoved (const KFileItemList& items);
|
|
typedef QMap<QByteArray,int> ActionNumberMap;
|
|
|
|
|
|
|
|
// Subclasses of QObject
|
|
|
|
%ConvertToSubClassCode
|
|
// CTSCC for subclasses of 'QObject'
|
|
sipType = NULL;
|
|
|
|
if (dynamic_cast<KParts::BrowserExtension*>(sipCpp))
|
|
sipType = sipType_KParts_BrowserExtension;
|
|
else if (dynamic_cast<KParts::BrowserHostExtension*>(sipCpp))
|
|
sipType = sipType_KParts_BrowserHostExtension;
|
|
else if (dynamic_cast<KParts::BrowserInterface*>(sipCpp))
|
|
sipType = sipType_KParts_BrowserInterface;
|
|
else if (dynamic_cast<KParts::FileInfoExtension*>(sipCpp))
|
|
sipType = sipType_KParts_FileInfoExtension;
|
|
else if (dynamic_cast<KParts::HistoryProvider*>(sipCpp))
|
|
sipType = sipType_KParts_HistoryProvider;
|
|
else if (dynamic_cast<KParts::HtmlExtension*>(sipCpp))
|
|
sipType = sipType_KParts_HtmlExtension;
|
|
else if (dynamic_cast<KParts::LiveConnectExtension*>(sipCpp))
|
|
sipType = sipType_KParts_LiveConnectExtension;
|
|
else if (dynamic_cast<KParts::Part*>(sipCpp))
|
|
{
|
|
sipType = sipType_KParts_Part;
|
|
if (dynamic_cast<KParts::ReadOnlyPart*>(sipCpp))
|
|
{
|
|
sipType = sipType_KParts_ReadOnlyPart;
|
|
if (dynamic_cast<KParts::ReadWritePart*>(sipCpp))
|
|
sipType = sipType_KParts_ReadWritePart;
|
|
}
|
|
}
|
|
else if (dynamic_cast<KParts::PartManager*>(sipCpp))
|
|
sipType = sipType_KParts_PartManager;
|
|
else if (dynamic_cast<KParts::Plugin*>(sipCpp))
|
|
sipType = sipType_KParts_Plugin;
|
|
else if (dynamic_cast<KParts::ScriptableExtension*>(sipCpp))
|
|
sipType = sipType_KParts_ScriptableExtension;
|
|
else if (dynamic_cast<KParts::StatusBarExtension*>(sipCpp))
|
|
sipType = sipType_KParts_StatusBarExtension;
|
|
else if (dynamic_cast<KParts::TextExtension*>(sipCpp))
|
|
sipType = sipType_KParts_TextExtension;
|
|
else if (dynamic_cast<KParts::BrowserRun*>(sipCpp))
|
|
sipType = sipType_KParts_BrowserRun;
|
|
else if (dynamic_cast<KParts::MainWindow*>(sipCpp))
|
|
sipType = sipType_KParts_MainWindow;
|
|
%End
|
|
|
|
~BrowserExtension ();
|
|
};
|
|
// BrowserExtension
|
|
|
|
|
|
class BrowserHostExtension : QObject
|
|
{
|
|
%TypeHeaderCode
|
|
#include <kparts/browserextension.h>
|
|
%End
|
|
|
|
|
|
public:
|
|
BrowserHostExtension (KParts::ReadOnlyPart* parent /TransferThis/);
|
|
virtual QStringList frameNames () const;
|
|
virtual const QList<KParts::ReadOnlyPart*> frames () const;
|
|
virtual KParts::BrowserHostExtension* findFrameParent (KParts::ReadOnlyPart* callingPart, const QString& frame);
|
|
virtual bool openUrlInFrame (const KUrl& url, const KParts::OpenUrlArguments& arguments, const KParts::BrowserArguments& browserArguments);
|
|
static KParts::BrowserHostExtension* childObject (QObject* obj);
|
|
~BrowserHostExtension ();
|
|
};
|
|
// BrowserHostExtension
|
|
|
|
|
|
class LiveConnectExtension : QObject
|
|
{
|
|
%TypeHeaderCode
|
|
#include <kparts/browserextension.h>
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
enum Type
|
|
{
|
|
TypeVoid,
|
|
TypeBool,
|
|
TypeFunction,
|
|
TypeNumber,
|
|
TypeObject,
|
|
TypeString
|
|
};
|
|
|
|
//ig typedef QList<QPair<KParts::LiveConnectExtension::Type,QString>> ArgList;
|
|
|
|
LiveConnectExtension (KParts::ReadOnlyPart* parent /TransferThis/);
|
|
virtual bool get (const unsigned long objid, const QString& field, KParts::LiveConnectExtension::Type& type /In/, unsigned long& retobjid, QString& value);
|
|
virtual bool put (const unsigned long objid, const QString& field, const QString& value);
|
|
virtual bool call (const unsigned long objid, const QString& func, const QStringList& args, KParts::LiveConnectExtension::Type& type /In/, unsigned long& retobjid, QString& value);
|
|
virtual void unregister (const unsigned long objid);
|
|
static KParts::LiveConnectExtension* childObject (QObject* obj);
|
|
//ig void partEvent (const unsigned long objid, const QString& event, const KParts::LiveConnectExtension::ArgList& args);
|
|
~LiveConnectExtension ();
|
|
};
|
|
// LiveConnectExtension
|
|
|
|
};
|
|
// KParts
|
|
|
|
|
|
|
|
|