KDBusAddons
kdbusservice.h
30 * href="http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html">Desktop
213 * @param arguments The arguments the executable was called with, starting with the executable file name.
220 * commandLineParser->parse(arguments); // same QCommandLineParser instance as the one used in main()
221 * handleCmdLine(workingDirectory); // shared method with main(), which uses commandLineParser to handle options and positional arguments
226 * and make sure the mainwindow is shown as well as request its activation from the window manager.
230 * "XDG_ACTIVATION_TOKEN" environment variable and unsets it again after the signal, if there is one.
231 * The util method @c KWindowSystem::updateStartupId(QWindow *window) (since KF 5.91) takes care of that.
242 * since parse() doesn't handle those (and exiting the already-running instance would be wrong anyway).
252 * For GUI applications, the signal handler also needs to deal with any platform-specific startup ids
253 * and make sure the mainwindow is shown as well as request its activation from the window manager.
265 * For GUI applications, the signal handler also needs to deal with any platform-specific startup ids
266 * and make sure the mainwindow is shown as well as request its activation from the window manager.
284 KDBUSADDONS_NO_EXPORT void ActivateAction(const QString &action_name, const QVariantList &maybeParameter, const QVariantMap &platform_data);
288 KDBUSADDONS_NO_EXPORT int CommandLine(const QStringList &arguments, const QString &workingDirectory, const QVariantMap &platform_data);
QFlags< StartupOption > StartupOptions
Stores a combination of StartupOption values.
Definition kdbusservice.h:128
QString serviceName() const
Returns the name of the D-Bus service registered by this class.
Definition kdbusservice.cpp:295
void openRequested(const QList< QUrl > &uris)
Signals that one or more files should be opened in the application.
void unregister()
Manually unregister the given serviceName from D-Bus.
Definition kdbusservice.cpp:300
QString errorMessage() const
Returns the error message from the D-Bus registration if it failed.
Definition kdbusservice.cpp:285
bool isRegistered() const
Returns true if the D-Bus registration succeeded.
Definition kdbusservice.cpp:280
void activateActionRequested(const QString &actionName, const QVariant ¶meter)
Signals that an application action should be triggered.
KDBusService(StartupOptions options=Multiple, QObject *parent=nullptr)
Tries to register the current process to D-Bus at an address based on the application name and organi...
Definition kdbusservice.cpp:267
@ NoExitOnFailure
Indicates that the application should not exit if it failed to register with D-Bus.
Definition kdbusservice.h:111
@ Multiple
Indicates that multiple instances of the application may exist.
Definition kdbusservice.h:101
@ Unique
Indicates that only one instance of this application should ever exist.
Definition kdbusservice.h:95
@ Replace
Indicates that if there's already a unique service running, to be quit and replaced with our own.
Definition kdbusservice.h:121
void setExitValue(int value)
Sets the exit value to be used for a duplicate instance.
Definition kdbusservice.cpp:290
void activateRequested(const QStringList &arguments, const QString &workingDirectory)
Signals that the application is to be activated.
QObject(QObject *parent)
Q_ENUM(...)
Q_FLAG(...)
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:52:04 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:52:04 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.