#include <tdeuniqueapplication.h>
Public Member Functions | |
TDEUniqueApplication (bool allowStyles=true, bool GUIenabled=true, bool configUnique=false) | |
virtual | ~TDEUniqueApplication () |
bool | process (const TQCString &fun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData) |
virtual int | newInstance () |
bool | restoringSession () |
Public Member Functions inherited from TDEApplication | |
TDEApplication (bool allowStyles=true, bool GUIenabled=true, bool SMenabled=true) | |
TDEApplication (int &argc, char **argv, const TQCString &rAppName, bool allowStyles=true, bool GUIenabled=true, bool SMenabled=true) TDE_DEPRECATED | |
TDEConfig * | sessionConfig () |
bool | isRestored () const |
void | disableSessionManagement () |
void | enableSessionManagement () |
bool | requestShutDown (ShutdownConfirm confirm=ShutdownConfirmDefault, ShutdownType sdtype=ShutdownTypeDefault, ShutdownMode sdmode=ShutdownModeDefault) |
void | propagateSessionManager () |
void | commitData (TQSessionManager &sm) |
void | saveState (TQSessionManager &sm) |
bool | sessionSaving () const |
TQPixmap | icon () const |
TQString | iconName () const |
TQPixmap | miniIcon () const |
TQString | miniIconName () const |
void | setTopWidget (TQWidget *topWidget) |
void | invokeHelp (const TQString &anchor, const TQString &appname, const TQCString &startup_id) const |
void | invokeHelp (const TQString &anchor=TQString::null, const TQString &appname=TQString::null) const |
void | invokeHTMLHelp (const TQString &aFilename, const TQString &aTopic=TQString::null) const TDE_DEPRECATED |
void | invokeMailer (const TQString &address, const TQString &subject, const TQCString &startup_id) |
void | invokeMailer (const TQString &address, const TQString &subject) |
void | invokeMailer (const KURL &mailtoURL, const TQCString &startup_id, bool allowAttachments) |
void | invokeMailer (const KURL &mailtoURL, const TQCString &startup_id) |
void | invokeMailer (const KURL &mailtoURL) |
void | invokeMailer (const TQString &to, const TQString &cc, const TQString &bcc, const TQString &subject, const TQString &body, const TQString &messageFile, const TQStringList &attachURLs, const TQCString &startup_id) |
void | invokeMailer (const TQString &to, const TQString &cc, const TQString &bcc, const TQString &subject, const TQString &body, const TQString &messageFile=TQString::null, const TQStringList &attachURLs=TQStringList()) |
TQString | caption () const |
TDE_DEPRECATED TDEStyle * | tdestyle () const |
TQString | makeStdCaption (const TQString &userCaption, bool withAppName=true, bool modified=false) const |
TQString | tempSaveName (const TQString &pFilename) const |
TQString | checkRecoverFile (const TQString &pFilename, bool &bRecover) const |
void | getX11RGBAInformation (Display *dpy) |
bool | detectCompositionManagerAvailable (bool force_available=false, bool available=true) |
TQt::HANDLE | getX11RGBAVisual (Display *dpy) |
TQt::HANDLE | getX11RGBAColormap (Display *dpy) |
bool | isX11CompositionAvailable () |
void | enableStyles () |
void | disableStyles () |
void | installX11EventFilter (TQWidget *filter) |
void | removeX11EventFilter (const TQWidget *filter) |
void | addKipcEventMask (int id) |
void | removeKipcEventMask (int id) |
TQCString | startupId () const |
void | setStartupId (const TQCString &startup_id) |
void | updateUserTimestamp (unsigned long time=0) |
unsigned long | userTimestamp () const |
void | updateRemoteUserTimestamp (const TQCString &dcopId, unsigned long time=0) |
TQString | geometryArgument () const |
void | installKDEPropertyMap () |
bool | authorize (const TQString &genericAction) |
bool | authorizeTDEAction (const char *action) |
bool | authorizeURLAction (const TQString &action, const KURL &baseURL, const KURL &destURL) |
void | allowURLAction (const TQString &action, const KURL &_baseURL, const KURL &_destURL) |
bool | authorizeControlModule (const TQString &menuId) |
TQStringList | authorizeControlModules (const TQStringList &menuIds) |
bool | notify (TQObject *receiver, TQEvent *event) |
int | xErrhandler (Display *, void *) |
int | xioErrhandler (Display *) |
void | iceIOErrorHandler (_IceConn *conn) |
Public Member Functions inherited from TDEInstance | |
TDEInstance (const TQCString &instanceName) | |
TDEInstance (const TDEAboutData *aboutData) | |
TDEInstance (TDEInstance *src) | |
virtual | ~TDEInstance () |
TDEStandardDirs * | dirs () const |
TDEConfig * | config () const |
TDESharedConfig * | sharedConfig () const |
void | setConfigReadOnly (bool ro) |
TDEIconLoader * | iconLoader () const |
void | newIconLoader () const |
const TDEAboutData * | aboutData () const |
TQCString | instanceName () const |
KMimeSourceFactory * | mimeSourceFactory () const |
Public Member Functions inherited from DCOPObject | |
DCOPObject (TQObject *obj) | |
DCOPObject (const TQCString &objId) | |
TQCString | objId () const |
bool | setObjId (const TQCString &objId) |
virtual bool | processDynamic (const TQCString &fun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData) |
virtual QCStringList | functionsDynamic () |
virtual QCStringList | interfacesDynamic () |
virtual QCStringList | interfaces () |
virtual QCStringList | functions () |
void | emitDCOPSignal (const TQCString &signal, const TQByteArray &data) |
bool | connectDCOPSignal (const TQCString &sender, const TQCString &senderObj, const TQCString &signal, const TQCString &slot, bool Volatile) |
bool | disconnectDCOPSignal (const TQCString &sender, const TQCString &senderObj, const TQCString &signal, const TQCString &slot) |
DCOPClient * | callingDcopClient () |
Static Public Member Functions | |
static void | addCmdLineOptions () |
static bool | start () |
static void | setHandleAutoStarted () |
Static Public Member Functions inherited from TDEApplication | |
static void | addCmdLineOptions () |
static TDEApplication * | kApplication () |
static DCOPClient * | dcopClient () |
static void | disableAutoDcopRegistration () |
static TQCString | launcher () |
static int | startServiceByName (const TQString &_name, const TQString &URL, TQString *error=0, TQCString *dcopService=0, int *pid=0, const TQCString &startup_id="", bool noWait=false) |
static int | startServiceByName (const TQString &_name, const TQStringList &URLs=TQStringList(), TQString *error=0, TQCString *dcopService=0, int *pid=0, const TQCString &startup_id="", bool noWait=false) |
static int | startServiceByDesktopPath (const TQString &_name, const TQString &URL, TQString *error=0, TQCString *dcopService=0, int *pid=0, const TQCString &startup_id="", bool noWait=false) |
static int | startServiceByDesktopPath (const TQString &_name, const TQStringList &URLs=TQStringList(), TQString *error=0, TQCString *dcopService=0, int *pid=0, const TQCString &startup_id="", bool noWait=false) |
static int | startServiceByDesktopName (const TQString &_name, const TQString &URL, TQString *error=0, TQCString *dcopService=0, int *pid=0, const TQCString &startup_id="", bool noWait=false) |
static int | startServiceByDesktopName (const TQString &_name, const TQStringList &URLs=TQStringList(), TQString *error=0, TQCString *dcopService=0, int *pid=0, const TQCString &startup_id="", bool noWait=false) |
static int | tdeinitExec (const TQString &name, const TQStringList &args, TQString *error, int *pid, const TQCString &startup_id) |
static int | tdeinitExec (const TQString &name, const TQStringList &args=TQStringList(), TQString *error=0, int *pid=0) |
static int | tdeinitExecWait (const TQString &name, const TQStringList &args, TQString *error, int *pid, const TQCString &startup_id) |
static int | tdeinitExecWait (const TQString &name, const TQStringList &args=TQStringList(), TQString *error=0, int *pid=0) |
static bool | isCompositionManagerAvailable () |
static Display * | openX11RGBADisplay () |
static int | random () |
static TQString | randomString (int length) |
static ButtonState | keyboardMouseState () |
static uint | keyboardModifiers () TDE_DEPRECATED |
static uint | mouseState () TDE_DEPRECATED |
static int | currentX11VT () |
static void | startKdeinit () |
static TQPalette | createApplicationPalette () |
static TQPalette | createApplicationPalette (TDEConfig *config, int contrast) |
static void | installSigpipeHandler () |
static bool | guiEnabled () |
Static Public Member Functions inherited from DCOPObject | |
static bool | hasObject (const TQCString &objId) |
static DCOPObject * | find (const TQCString &objId) |
static TQPtrList< DCOPObject > | match (const TQCString &partialId) |
static TQCString | objectName (TQObject *obj) |
Protected Member Functions | |
virtual void | virtual_hook (int id, void *data) |
Protected Member Functions inherited from TDEApplication | |
TDEApplication (bool allowStyles, bool GUIenabled, TDEInstance *_instance) | |
void | invokeEditSlot (const char *slot) |
Protected Member Functions inherited from TDEInstance | |
TDEInstance (const TDEInstance &) | |
void | setConfigName (const TQString &name) |
Additional Inherited Members | |
Public Types inherited from TDEApplication | |
enum | CaptionLayout { CaptionAppLast =1 , CaptionAppFirst , CaptionNoApp } |
enum | ShutdownConfirm { ShutdownConfirmDefault = -1 , ShutdownConfirmNo = 0 , ShutdownConfirmYes = 1 } |
enum | ShutdownType { ShutdownTypeDefault = -1 , ShutdownTypeNone = 0 , ShutdownTypeReboot = 1 , ShutdownTypeHalt = 2 } |
enum | ShutdownMode { ShutdownModeDefault = -1 , ShutdownModeSchedule = 0 , ShutdownModeTryNow = 1 , ShutdownModeForceNow = 2 , ShutdownModeInteractive = 3 } |
enum | { ShiftModifier = 1<<0 , LockModifier = 1<<1 , ControlModifier = 1<<2 , Modifier1 = 1<<3 , Modifier2 = 1<<4 , Modifier3 = 1<<5 , Modifier4 = 1<<6 , Modifier5 = 1<<7 } |
enum | { Button1Pressed = 1<<8 , Button2Pressed = 1<<9 , Button3Pressed = 1<<10 , Button4Pressed = 1<<11 , Button5Pressed = 1<<12 } |
enum | SettingsCategory { SETTINGS_MOUSE , SETTINGS_COMPLETION , SETTINGS_PATHS , SETTINGS_POPUPMENU , SETTINGS_QT , SETTINGS_SHORTCUTS } |
Public Slots inherited from TDEApplication | |
void | invokeBrowser (const TQString &url, const TQCString &startup_id) |
void | invokeBrowser (const TQString &url) |
void | cut () |
void | copy () |
void | paste () |
void | clear () |
void | selectAll () |
void | broadcastKeyCode (unsigned int keyCode) |
void | ref () |
void | deref () |
Signals inherited from TDEApplication | |
void | tdedisplayPaletteChanged () |
void | tdedisplayStyleChanged () |
void | tdedisplayFontChanged () |
void | appearanceChanged () |
void | toolbarAppearanceChanged (int) |
void | backgroundChanged (int desk) |
void | settingsChanged (int category) |
void | iconChanged (int group) |
void | kipcMessage (int id, int data) |
void | saveYourself () |
void | shutDown () |
void | updateIconLoaders () |
void | coreFakeKeyPress (unsigned int keyCode) |
Static Public Attributes inherited from TDEApplication | |
static bool | loadedByKdeinit = false |
Protected Attributes inherited from TDEApplication | |
Atom | kipcCommAtom |
int | kipcEventMask |
int | pArgc |
Static Protected Attributes inherited from TDEApplication | |
static TDEApplication * | KApp = 0L |
Detailed Description
Maintains only a single instance of a running application at a time.
If another instance is started, it will determine (via DCOP) whether it is the first instance or a second instance. If it is a second instance, it will forward on the information to the first instance and then quit.
The .desktop file for the application should state X-DCOP-ServiceType=Unique, see tdeapplication.h
If your application is used to open files, it should also support the –tempfile option (see TDECmdLineArgs::addTempFileOption()), to delete tempfiles after use. Add X-TDE-HasTempFileOption=true to the .desktop file to indicate this.
- See also
- TDEApplication DCOPObject
Definition at line 48 of file tdeuniqueapplication.h.
Constructor & Destructor Documentation
◆ TDEUniqueApplication()
TDEUniqueApplication::TDEUniqueApplication | ( | bool | allowStyles = true , |
bool | GUIenabled = true , |
||
bool | configUnique = false |
||
) |
Constructor.
Takes command line arguments from TDECmdLineArgs
- Parameters
-
allowStyles Set to false to disable the loading on plugin based styles. This is only useful to applications that do not display a GUI normally. If you do create an application with allowStyles
set to false it normally runs in the background but under special circumstances displays widgets. Call TDEApplication::enableStyles() before displaying any widgets.GUIenabled Set to false to disable all GUI stuff. This implies no styles either. configUnique If true, the uniqueness of the application will depend on the value of the "MultipleInstances" key in the "KDE" group of the application config file.
Definition at line 317 of file tdeuniqueapplication.cpp.
◆ ~TDEUniqueApplication()
|
virtual |
Destructor.
Definition at line 358 of file tdeuniqueapplication.cpp.
Member Function Documentation
◆ addCmdLineOptions()
|
static |
Adds command line options specific for TDEUniqueApplication.
Should be called before calling TDEUniqueApplication constructor and / or start().
Definition at line 87 of file tdeuniqueapplication.cpp.
◆ newInstance()
|
virtual |
Creates a new "instance" of the application.
Usually this will involve making some calls into the GUI portion of your application asking for a new window to be created, possibly with some data already loaded based on the arguments received.
Command line arguments have been passed to TDECmdLineArgs before this function is called and can be checked in the usual way.
The default implementation ensures the mainwindow of the already running instance is shown and activated if necessary. You should prefer using it from your overridden method instead of doing it directly.
Note that newInstance() is called also in the first started application process.
- Returns
- An exit value. The calling process will exit with this value.
Definition at line 476 of file tdeuniqueapplication.cpp.
◆ process()
|
virtual |
Dispatches any incoming DCOP message for a new instance.
If it is not a request for a new instance, return false. Overloaded from DCOPObject to make sure that the application stays unique.
- Parameters
-
fun DCOP function signature data the data for the arguments replyType the type of the reply value replyData the reply
- See also
- DCOPObject
Reimplemented from DCOPObject.
Definition at line 403 of file tdeuniqueapplication.cpp.
◆ restoringSession()
bool TDEUniqueApplication::restoringSession | ( | ) |
Returns whether newInstance() is being called while session restoration is in progress.
- Since
- KDE 3.3
Definition at line 471 of file tdeuniqueapplication.cpp.
◆ start()
|
static |
Forks and registers with dcop.
The command line arguments are being sent via DCOP to newInstance() and will be received once the application enters the event loop.
Typically this is used like:
Note that it's not necessary to call start() explicitly. It will be called automatically before creating TDEUniqueApplication if it hasn't been called yet, without any performance impact.
- Returns
- true if registration is successful. false if another process was already running.
Definition at line 93 of file tdeuniqueapplication.cpp.
The documentation for this class was generated from the following files: