21 #ifndef __TDEAPPLICATION_H__ 22 #define __TDEAPPLICATION_H__ 25 #include "tdeversion.h" 26 #include "tdelibs_export.h" 33 typedef unsigned long Atom;
34 #if !defined(TQ_WS_X11) 38 #include <tqapplication.h> 40 #include <kinstance.h> 49 #define kapp TDEApplication::kApplication() 51 class TDEApplicationPrivate;
129 TDEApplication(
bool allowStyles=
true,
bool GUIenabled=
true,
bool SMenabled=
true);
133 #ifdef TDEAPPLICATION_BINARY_COMPAT_HACK 138 #endif // TDEAPPLICATION_BINARY_COMPAT_HACK 188 TDEApplication(Display *display,
bool disable_argb, TQt::HANDLE visual, TQt::HANDLE colormap,
bool allowStyles);
213 TDEApplication(Display *display, TQt::HANDLE visual = 0, TQt::HANDLE colormap = 0,
214 bool allowStyles=
true);
240 TDEApplication(Display *display,
int& argc,
char** argv,
const TQCString& rAppName,
241 bool allowStyles=
true,
bool GUIenabled=
true);
269 const TQCString& rAppName,
bool allowStyles=
true,
bool GUIenabled=
true,
bool SMenabled=
true) TDE_DEPRECATED;
273 #ifdef TDEAPPLICATION_BINARY_COMPAT_HACK 278 const TQCString& rAppName,
bool allowStyles,
bool GUIenabled) TDE_DEPRECATED;
279 #endif // TDEAPPLICATION_BINARY_COMPAT_HACK 285 static void addCmdLineOptions();
318 bool isRestored()
const {
return TQApplication::isSessionRestored(); }
326 void disableSessionManagement();
334 void enableSessionManagement();
343 ShutdownConfirmDefault = -1,
347 ShutdownConfirmNo = 0,
351 ShutdownConfirmYes = 1
361 ShutdownTypeDefault = -1,
365 ShutdownTypeNone = 0,
369 ShutdownTypeReboot = 1,
383 ShutdownModeDefault = -1,
388 ShutdownModeSchedule = 0,
392 ShutdownModeTryNow = 1,
396 ShutdownModeForceNow = 2,
400 ShutdownModeInteractive = 3
418 bool requestShutDown(
ShutdownConfirm confirm = ShutdownConfirmDefault,
435 void propagateSessionManager();
442 void commitData( TQSessionManager& sm );
449 void saveState( TQSessionManager& sm );
460 bool sessionSaving()
const;
474 static void disableAutoDcopRegistration();
480 TQPixmap icon()
const;
486 TQString iconName()
const;
492 TQPixmap miniIcon()
const;
498 TQString miniIconName()
const;
510 void setTopWidget( TQWidget *topWidget );
524 void invokeHelp(
const TQString& anchor,
525 const TQString& appname,
526 const TQCString& startup_id )
const;
529 void invokeHelp(
const TQString& anchor = TQString::null,
530 const TQString& appname = TQString::null )
const;
546 void invokeHTMLHelp(
const TQString& aFilename,
const TQString& aTopic = TQString::null )
const TDE_DEPRECATED;
556 void invokeMailer(
const TQString &address,
const TQString &subject,
const TQCString& startup_id );
558 void invokeMailer(
const TQString &address,
const TQString &subject );
569 void invokeMailer(
const KURL &mailtoURL,
const TQCString& startup_id,
bool allowAttachments );
571 void invokeMailer(
const KURL &mailtoURL,
const TQCString& startup_id );
573 void invokeMailer(
const KURL &mailtoURL );
590 void invokeMailer(
const TQString &to,
const TQString &cc,
const TQString &bcc,
591 const TQString &subject,
const TQString &body,
592 const TQString &messageFile,
const TQStringList &attachURLs,
593 const TQCString& startup_id );
595 void invokeMailer(
const TQString &to,
const TQString &cc,
const TQString &bcc,
596 const TQString &subject,
const TQString &body,
597 const TQString &messageFile = TQString::null,
const TQStringList &attachURLs = TQStringList());
610 void invokeBrowser(
const TQString &url,
const TQCString& startup_id );
616 void invokeBrowser(
const TQString &url );
687 void broadcastKeyCode(
unsigned int keyCode);
695 static TQCString launcher();
717 static int startServiceByName(
const TQString& _name,
const TQString &URL,
718 TQString *error=0, TQCString *dcopService=0,
int *pid=0,
const TQCString &startup_id =
"",
bool noWait =
false );
740 static int startServiceByName(
const TQString& _name,
const TQStringList &URLs=TQStringList(),
741 TQString *error=0, TQCString *dcopService=0,
int *pid=0,
const TQCString &startup_id =
"",
bool noWait =
false );
763 static int startServiceByDesktopPath(
const TQString& _name,
const TQString &URL,
764 TQString *error=0, TQCString *dcopService=0,
int *pid = 0,
const TQCString &startup_id =
"",
bool noWait =
false );
786 static int startServiceByDesktopPath(
const TQString& _name,
const TQStringList &URLs=TQStringList(),
787 TQString *error=0, TQCString *dcopService=0,
int *pid = 0,
const TQCString &startup_id =
"",
bool noWait =
false );
809 static int startServiceByDesktopName(
const TQString& _name,
const TQString &URL,
810 TQString *error=0, TQCString *dcopService=0,
int *pid = 0,
const TQCString &startup_id =
"",
bool noWait =
false );
832 static int startServiceByDesktopName(
const TQString& _name,
const TQStringList &URLs=TQStringList(),
833 TQString *error=0, TQCString *dcopService=0,
int *pid = 0,
const TQCString &startup_id =
"",
bool noWait =
false );
852 static int tdeinitExec(
const TQString& name,
const TQStringList &args,
853 TQString *error,
int *pid,
const TQCString& startup_id );
855 static int tdeinitExec(
const TQString& name,
const TQStringList &args=TQStringList(),
856 TQString *error=0,
int *pid = 0 );
875 static int tdeinitExecWait(
const TQString& name,
const TQStringList &args,
876 TQString *error,
int *pid,
const TQCString& startup_id );
878 static int tdeinitExecWait(
const TQString& name,
const TQStringList &args=TQStringList(),
879 TQString *error=0,
int *pid = 0 );
889 TQString caption()
const;
894 TDE_DEPRECATED TDEStyle*
tdestyle()
const {
return 0; }
913 TQString makeStdCaption(
const TQString &userCaption,
914 bool withAppName=
true,
bool modified=
false )
const;
923 TQString tempSaveName(
const TQString& pFilename )
const;
934 TQString checkRecoverFile(
const TQString& pFilename,
bool& bRecover )
const;
936 #if defined(TQ_WS_X11) 942 Display *getDisplay() {
return display; }
949 void getX11RGBAInformation(Display *dpy);
958 static bool isCompositionManagerAvailable();
968 bool detectCompositionManagerAvailable(
bool force_available=
false,
bool available=
true);
978 static Display* openX11RGBADisplay();
985 TQt::HANDLE getX11RGBAVisual(Display *dpy);
992 TQt::HANDLE getX11RGBAColormap(Display *dpy);
1010 bool isX11CompositionAvailable();
1019 void enableStyles();
1028 void disableStyles();
1039 void installX11EventFilter( TQWidget* filter );
1045 void removeX11EventFilter(
const TQWidget* filter );
1051 static int random();
1058 static TQString randomString(
int length);
1069 void addKipcEventMask(
int id);
1079 void removeKipcEventMask(
int id);
1086 TQCString startupId()
const;
1095 void setStartupId(
const TQCString& startup_id );
1103 void updateUserTimestamp(
unsigned long time = 0 );
1110 unsigned long userTimestamp()
const;
1120 void updateRemoteUserTimestamp(
const TQCString& dcopId,
unsigned long time = 0 );
1127 TQString geometryArgument()
const;
1133 void installKDEPropertyMap();
1140 bool authorize(
const TQString &genericAction);
1149 bool authorizeTDEAction(
const char *action);
1164 bool authorizeURLAction(
const TQString &action,
const KURL &baseURL,
const KURL &destURL);
1175 void allowURLAction(
const TQString &action,
const KURL &_baseURL,
const KURL &_destURL);
1184 bool authorizeControlModule(
const TQString &menuId);
1194 TQStringList authorizeControlModules(
const TQStringList &menuIds);
1205 static ButtonState keyboardMouseState();
1208 enum { ShiftModifier = 1<<0,
1209 LockModifier = 1<<1,
1210 ControlModifier = 1<<2,
1220 static uint keyboardModifiers() TDE_DEPRECATED;
1223 enum { Button1Pressed = 1<<8,
1224 Button2Pressed = 1<<9,
1225 Button3Pressed = 1<<10,
1226 Button4Pressed = 1<<11,
1227 Button5Pressed = 1<<12 };
1232 static uint mouseState() TDE_DEPRECATED;
1239 static int currentX11VT();
1267 TDEApplication( Display *display, TQt::HANDLE visual, TQt::HANDLE colormap,
1273 bool x11EventFilter( XEvent * );
1315 void invokeEditSlot(
const char *slot );
1318 void dcopFailure(
const TQString &);
1319 void dcopBlockUserInput(
bool );
1320 void x11FilterDestroyed();
1321 void checkAppStartedSlot();
1324 TQString sessionConfigName()
const;
1327 static bool s_dcopClientNeedsPostInit;
1329 bool bSessionManagement;
1330 struct oldPixmapType { TQPixmap a, b; };
1333 TQPixmap *icon, *miniIcon;
1335 char unused[
sizeof(oldPixmapType)];
1338 TQString aMiniIconName;
1342 void init(
bool GUIenabled );
1344 void parseCommandLine( );
1346 void read_app_startup_id();
1348 void dcopAutoRegistration();
1349 void dcopClientPostInit();
1350 void initUrlActionRestrictions();
1353 #if defined(TQ_WS_X11) 1354 TQt::HANDLE argb_x11_visual;
1355 TQt::HANDLE argb_x11_colormap;
1362 bool notify(TQObject *receiver, TQEvent *event);
1367 int xErrhandler( Display*,
void* );
1372 int xioErrhandler( Display* );
1377 void iceIOErrorHandler( _IceConn *conn );
1382 static bool loadedByKdeinit;
1387 static void startKdeinit();
1393 SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS };
1403 static TQPalette createApplicationPalette();
1409 static TQPalette createApplicationPalette(
TDEConfig *config,
int contrast );
1418 static void installSigpipeHandler();
1426 static bool guiEnabled();
1435 void tdedisplayPaletteChanged();
1444 void tdedisplayStyleChanged();
1457 void tdedisplayFontChanged();
1464 void appearanceChanged();
1469 void toolbarAppearanceChanged(
int);
1476 void backgroundChanged(
int desk);
1484 void settingsChanged(
int category);
1490 void iconChanged(
int group);
1501 void kipcMessage(
int id,
int data);
1532 void saveYourself();
1547 void updateIconLoaders();
1553 void coreFakeKeyPress(
unsigned int keyCode);
1557 void tdedisplaySetPalette();
1558 void tdedisplaySetStyle();
1559 void tdedisplaySetFont();
1560 void applyGUIStyle();
1561 static void sigpipeHandler(
int);
1568 virtual void virtual_hook(
int id,
void* data );
1570 TDEApplicationPrivate* d;
1591 TDECORE_EXPORT
bool checkAccess(
const TQString& pathname,
int mode);
1593 class KSessionManagedPrivate;
1626 virtual bool saveState( TQSessionManager& sm );
1636 virtual bool commitData( TQSessionManager& sm );
1639 virtual void virtual_hook(
int id,
void* data );
1641 KSessionManagedPrivate *d;
Access KDE Configuration entries.
static TDEApplication * KApp
Current application object.
Represents and parses a URL.
Charset font and encoder/decoder handling.
ShutdownType
The possible values for the sdtype parameter of requestShutDown().
CaptionLayout
Position of the caption (presumably in the application window's title bar).
Controls and provides information to all KDE applications.
ShutdownConfirm
The possible values for the confirm parameter of requestShutDown().
ShutdownMode
The possible values for the sdmode parameter of requestShutDown().
TDE_DEPRECATED TDEStyle * tdestyle() const
static TDEApplication * kApplication()
Returns the current application object.
bool isRestored() const
Is the application restored from the session manager?
SettingsCategory
Valid values for the settingsChanged signal.
Provides highlevel access to session management on a per-object base.
Access to KDE global objects for use in shared libraries.