KParts
part.cpp
Go to the documentation of this file.
156 void PartBase::loadPlugins(QObject *parent, KXMLGUIClient *parentGUIClient, const KComponentData &instance)
161 Plugin::loadPlugins( parent, parentGUIClient, instance, d->m_pluginLoadingMode == LoadPlugins, d->m_pluginInterfaceVersion );
605 // Use same extension as remote file. This is important for mimetype-determination (e.g. koffice)
610 if (!ext.isEmpty() && m_url.query().isNull()) // not if the URL has a query, e.g. cgi.pl?something
The Browser Extension is an extension (yes, no kidding) to KParts::ReadOnlyPart, which allows a bette...
Definition: browserextension.h:320
void setLocalFilePath(const QString &localFilePath)
Sets the local file path associated with this part.
Definition: part.cpp:487
QString i18n(const char *text)
ReadWritePart(QObject *parent=0)
Constructor See parent constructor for instructions.
Definition: part.cpp:769
Overwrite
QString toLocalFile(AdjustPathOption trailing=LeaveTrailingSlash) const
int xOffset() const
xOffset is the horizontal scrolling of the part's widget (in case it's a scrollview).
Definition: part.cpp:1101
KGuiItem discard()
bool addResourceType(const char *type, const QString &relativename, bool priority=true)
bool waitSaveComplete()
Waits for any pending upload job to finish and returns whether the last save() action was successful.
Definition: part.cpp:1034
QMap< QString, QString > & metaData()
Meta-data to associate with the KIO operation that will be used to open the URL.
Definition: part.cpp:1131
void urlChanged(const KUrl &url)
Emitted by the part when url() changes.
void setActionRequestedByUser(bool userRequested)
Definition: part.cpp:1146
virtual bool openFile()
If the part uses the standard implementation of openUrl(), it must reimplement this,...
Definition: part.cpp:569
This event is sent by the part manager when the active part changes.
Definition: event.h:82
MimetypeJob * mimetype(const KUrl &url, JobFlags flags=DefaultFlags)
HideProgressInfo
QString name() const
KStandardDirs * dirs()
static QDebug kError(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
virtual void embed(QWidget *parentWidget)
Embed this part into a host widget.
Definition: part.cpp:215
FileCopyJob * file_move(const KUrl &src, const KUrl &dest, int permissions=-1, JobFlags flags=DefaultFlags)
StatJob * mostLocalUrl(const KUrl &url, JobFlags flags=DefaultFlags)
void setSuffix(const QString &suffix)
QString mimeType() const
The mimetype to use when opening the url, when known by the calling application.
Definition: part.cpp:1121
virtual bool queryClose()
If the document has been modified, ask the user to save changes.
Definition: part.cpp:808
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
QString localFilePath() const
Returns the local file path associated with this part.
Definition: part.cpp:480
static void emitFilesAdded(const QString &directory)
void setPath(const QString &path)
DefaultFlags
static int warningYesNoCancel(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonYes=KStandardGuiItem::yes(), const KGuiItem &buttonNo=KStandardGuiItem::no(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
QString componentName() const
BrowserExtension * browserExtension() const
This convenience method returns the browserExtension for this part, or 0 if there isn't any.
Definition: part.cpp:748
FileCopyJob * file_copy(const KUrl &src, const KUrl &dest, int permissions=-1, JobFlags flags=DefaultFlags)
virtual Part * hitTest(QWidget *widget, const QPoint &globalPos)
Returns the part (this, or a child part) at the given global position.
Definition: part.cpp:271
void canceled(const QString &errMsg)
Emit this if loading is canceled by the user or by an error.
OpenUrlArguments & operator=(const OpenUrlArguments &other)
Definition: part.cpp:1081
void sigQueryClose(bool *handled, bool *abortClosing)
set handled to true, if you don't want the default handling set abortClosing to true,...
void setWindowCaption(const QString &caption)
Emitted by the part, to set the caption of the window(s) hosting this part.
void setPluginLoadingMode(PluginLoadingMode loadingMode)
Set how plugins should be loaded.
Definition: part.cpp:164
QWidget * hostContainer(const QString &containerName)
Convenience method for KXMLGUIFactory::container.
Definition: part.cpp:338
CopyJob * link(const KUrl &src, const KUrl &destDir, JobFlags flags=DefaultFlags)
virtual void partActivateEvent(PartActivateEvent *event)
Convenience method which is called when the Part received a PartActivateEvent .
Definition: part.cpp:326
void setPluginInterfaceVersion(int version)
If you change the binary interface offered by your part, you can avoid crashes from old plugins lying...
Definition: part.cpp:171
static QString protocolClass(const QString &protocol)
virtual void setComponentData(const KComponentData &componentData)
const KShortcut & reload()
This event is sent to a Part when its GUI has been activated or deactivated.
Definition: event.h:59
bool openStream(const QString &mimeType, const KUrl &url)
Initiate sending data to this part.
Definition: part.cpp:726
int yOffset() const
yOffset is the vertical scrolling of the part's widget (in case it's a scrollview).
Definition: part.cpp:1111
void insertCatalog(const QString &catalog)
int error() const
KXMLGUIFactory * factory() const
QString protocol() const
QString catalogName() const
PluginLoadingMode
We have three different policies, whether to load new plugins or not.
Definition: part.h:119
static KUrl getSaveUrl(const KUrl &startDir=KUrl(), const QString &filter=QString(), QWidget *parent=0, const QString &caption=QString())
KLocale * locale()
virtual void partSelectEvent(PartSelectEvent *event)
Convenience method which is called when the Part received a PartSelectEvent .
Definition: part.cpp:330
void setReload(bool b)
Indicates that the url should be loaded from the network even if it matches the current url of the pa...
Definition: part.cpp:1096
void setArguments(const OpenUrlArguments &arguments)
Sets the arguments to use for the next openUrl call.
Definition: part.cpp:753
void setLocalFileTemporary(bool temp)
Definition: part.cpp:504
void setProgressInfoEnabled(bool show)
Call this to turn off the progress info dialog used by the internal KIO job.
Definition: part.cpp:512
KIconLoader * iconLoader()
Use this icon loader to load any icons that are specific to this part, i.e.
Definition: part.cpp:246
virtual QString errorString() const
static Ptr findByUrl(const KUrl &url, mode_t mode=0, bool is_local_file=false, bool fast_mode=false, int *accuracy=0)
void loadPlugins(QObject *parent, KXMLGUIClient *parentGUIClient, const KComponentData &componentData)
Load the Plugins honoring the PluginLoadingMode.
Definition: part.cpp:156
void setAutoDeletePart(bool autoDeletePart)
By default, the part deletes itself when its widget is deleted.
Definition: part.cpp:238
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:535
bool isLocalFile() const
virtual void setReadWrite(bool readwrite=true)
Changes the behavior of this part to readonly or readwrite.
Definition: part.cpp:782
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
KGuiItem save()
The part manager is an object which knows about a collection of parts (even nested ones) and handles ...
Definition: partmanager.h:47
QString url(AdjustPathOption trailing=LeaveTrailingSlash) const
bool actionRequestedByUser() const
True if the user requested that the URL be opened.
Definition: part.cpp:1141
QWidget * container(const QString &containerName, KXMLGUIClient *client, bool useTagName=false)
virtual void setComponentData(const KComponentData &componentData)
Set the componentData(KComponentData) for this part.
Definition: part.cpp:137
virtual void guiActivateEvent(GUIActivateEvent *event)
Convenience method which is called when the Part received a GUIActivateEvent .
Definition: part.cpp:334
PartManager * manager() const
Returns the part manager handling this part, if any (0L otherwise).
Definition: part.cpp:264
virtual KComponentData componentData() const
static void loadPlugins(QObject *parent, const KComponentData &instance)
Load the plugin libraries from the directories appropriate to instance and make the Plugin objects ch...
Definition: plugin.cpp:136
virtual ~ReadWritePart()
Destructor Applications using a ReadWritePart should make sure, before destroying it,...
Definition: part.cpp:774
virtual void guiActivateEvent(GUIActivateEvent *event)
Reimplemented from Part, so that the window caption is set to the current url (decoded) when the part...
Definition: part.cpp:712
QString fileName(const DirectoryOptions &options=IgnoreTrailingSlash) const
bool isProgressInfoEnabled() const
Returns whether the part shows the progress info dialog used by internal KIO job.
Definition: part.cpp:519
ReadOnlyPart(QObject *parent=0)
Constructor See also Part for the setXXX methods to call.
Definition: part.cpp:450
OpenUrlArguments is the set of arguments that specify how a URL should be opened by KParts::ReadOnlyP...
Definition: part.h:404
void setAutoDeleteWidget(bool autoDeleteWidget)
By default, the widget is deleted by the part when the part is deleted.
Definition: part.cpp:232
This event is sent when a part is selected or deselected.
Definition: event.h:103
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jan 18 2020 19:03:14 by doxygen 1.8.15 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jan 18 2020 19:03:14 by doxygen 1.8.15 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.