25 #include "tdeversion.h"
26 #include "tdelibs_export.h"
33 #include <tqtglobaldefines.h>
35 typedef unsigned long Atom;
36 #if !defined(TQ_WS_X11)
40 #include <tqapplication.h>
42 #include <kinstance.h>
51 #define kapp TDEApplication::kApplication()
53 class TDEApplicationPrivate;
131 TDEApplication(
bool allowStyles=
true,
bool GUIenabled=
true,
bool SMenabled=
true);
135 #ifdef TDEAPPLICATION_BINARY_COMPAT_HACK
190 TDEApplication(Display *display,
bool disable_argb, TQt::HANDLE visual, TQt::HANDLE colormap,
bool allowStyles);
215 TDEApplication(Display *display, TQt::HANDLE visual = 0, TQt::HANDLE colormap = 0,
216 bool allowStyles=
true);
242 TDEApplication(Display *display,
int& argc,
char** argv,
const TQCString& rAppName,
243 bool allowStyles=
true,
bool GUIenabled=
true);
271 const TQCString& rAppName,
bool allowStyles=
true,
bool GUIenabled=
true,
bool SMenabled=
true) KDE_DEPRECATED;
275 #ifdef TDEAPPLICATION_BINARY_COMPAT_HACK
280 const TQCString& rAppName,
bool allowStyles,
bool GUIenabled) KDE_DEPRECATED;
287 static void addCmdLineOptions();
320 bool isRestored()
const {
return TQApplication::isSessionRestored(); }
328 void disableSessionManagement();
336 void enableSessionManagement();
345 ShutdownConfirmDefault = -1,
349 ShutdownConfirmNo = 0,
353 ShutdownConfirmYes = 1
363 ShutdownTypeDefault = -1,
367 ShutdownTypeNone = 0,
371 ShutdownTypeReboot = 1,
385 ShutdownModeDefault = -1,
390 ShutdownModeSchedule = 0,
394 ShutdownModeTryNow = 1,
398 ShutdownModeForceNow = 2,
402 ShutdownModeInteractive = 3
420 bool requestShutDown( ShutdownConfirm confirm = ShutdownConfirmDefault,
421 ShutdownType sdtype = ShutdownTypeDefault,
422 ShutdownMode sdmode = ShutdownModeDefault );
437 void propagateSessionManager();
444 void commitData( TQSessionManager& sm );
451 void saveState( TQSessionManager& sm );
462 bool sessionSaving()
const;
476 static void disableAutoDcopRegistration();
488 TQString iconName()
const;
500 TQString miniIconName()
const;
512 void setTopWidget( TQWidget *topWidget );
526 void invokeHelp(
const TQString& anchor,
527 const TQString& appname,
528 const TQCString& startup_id )
const;
531 void invokeHelp(
const TQString& anchor = TQString::null,
532 const TQString& appname = TQString::null )
const;
548 void invokeHTMLHelp(
const TQString& aFilename,
const TQString& aTopic = TQString::null )
const KDE_DEPRECATED;
558 void invokeMailer(
const TQString &address,
const TQString &subject,
const TQCString& startup_id );
560 void invokeMailer(
const TQString &address,
const TQString &subject );
571 void invokeMailer(
const KURL &mailtoURL,
const TQCString& startup_id,
bool allowAttachments );
573 void invokeMailer(
const KURL &mailtoURL,
const TQCString& startup_id );
575 void invokeMailer(
const KURL &mailtoURL );
592 void invokeMailer(
const TQString &to,
const TQString &cc,
const TQString &bcc,
593 const TQString &subject,
const TQString &body,
594 const TQString &messageFile,
const TQStringList &attachURLs,
595 const TQCString& startup_id );
597 void invokeMailer(
const TQString &to,
const TQString &cc,
const TQString &bcc,
598 const TQString &subject,
const TQString &body,
599 const TQString &messageFile = TQString::null,
const TQStringList &attachURLs = TQStringList());
612 void invokeBrowser(
const TQString &url,
const TQCString& startup_id );
618 void invokeBrowser(
const TQString &url );
689 void broadcastKeyCode(
unsigned int keyCode);
697 static TQCString launcher();
719 static int startServiceByName(
const TQString& _name,
const TQString &URL,
720 TQString *error=0, TQCString *dcopService=0,
int *pid=0,
const TQCString &startup_id =
"",
bool noWait =
false );
742 static int startServiceByName(
const TQString& _name,
const TQStringList &URLs=TQStringList(),
743 TQString *error=0, TQCString *dcopService=0,
int *pid=0,
const TQCString &startup_id =
"",
bool noWait =
false );
765 static int startServiceByDesktopPath(
const TQString& _name,
const TQString &URL,
766 TQString *error=0, TQCString *dcopService=0,
int *pid = 0,
const TQCString &startup_id =
"",
bool noWait =
false );
788 static int startServiceByDesktopPath(
const TQString& _name,
const TQStringList &URLs=TQStringList(),
789 TQString *error=0, TQCString *dcopService=0,
int *pid = 0,
const TQCString &startup_id =
"",
bool noWait =
false );
811 static int startServiceByDesktopName(
const TQString& _name,
const TQString &URL,
812 TQString *error=0, TQCString *dcopService=0,
int *pid = 0,
const TQCString &startup_id =
"",
bool noWait =
false );
834 static int startServiceByDesktopName(
const TQString& _name,
const TQStringList &URLs=TQStringList(),
835 TQString *error=0, TQCString *dcopService=0,
int *pid = 0,
const TQCString &startup_id =
"",
bool noWait =
false );
854 static int tdeinitExec(
const TQString& name,
const TQStringList &args,
855 TQString *error,
int *pid,
const TQCString& startup_id );
857 static int tdeinitExec(
const TQString& name,
const TQStringList &args=TQStringList(),
858 TQString *error=0,
int *pid = 0 );
877 static int tdeinitExecWait(
const TQString& name,
const TQStringList &args,
878 TQString *error,
int *pid,
const TQCString& startup_id );
880 static int tdeinitExecWait(
const TQString& name,
const TQStringList &args=TQStringList(),
881 TQString *error=0,
int *pid = 0 );
891 TQString caption()
const;
896 KDE_DEPRECATED TDEStyle*
tdestyle()
const {
return 0; }
915 TQString makeStdCaption(
const TQString &userCaption,
916 bool withAppName=
true,
bool modified=
false )
const;
925 TQString tempSaveName(
const TQString& pFilename )
const;
936 TQString checkRecoverFile(
const TQString& pFilename,
bool& bRecover )
const;
938 #if defined(TQ_WS_X11)
944 Display *getDisplay() {
return display; }
951 void getX11RGBAInformation(Display *dpy);
960 static bool isCompositionManagerAvailable();
970 bool detectCompositionManagerAvailable(
bool force_available=
false,
bool available=
true);
980 static Display* openX11RGBADisplay();
987 TQt::HANDLE getX11RGBAVisual(Display *dpy);
994 TQt::HANDLE getX11RGBAColormap(Display *dpy);
1012 bool isX11CompositionAvailable();
1021 void enableStyles();
1030 void disableStyles();
1041 void installX11EventFilter( TQWidget* filter );
1047 void removeX11EventFilter(
const TQWidget* filter );
1053 static int random();
1060 static TQString randomString(
int length);
1071 void addKipcEventMask(
int id);
1081 void removeKipcEventMask(
int id);
1088 TQCString startupId()
const;
1097 void setStartupId(
const TQCString& startup_id );
1105 void updateUserTimestamp(
unsigned long time = 0 );
1112 unsigned long userTimestamp()
const;
1122 void updateRemoteUserTimestamp(
const TQCString& dcopId,
unsigned long time = 0 );
1129 TQString geometryArgument()
const;
1135 void installKDEPropertyMap();
1142 bool authorize(
const TQString &genericAction);
1151 bool authorizeTDEAction(
const char *action);
1166 bool authorizeURLAction(
const TQString &action,
const KURL &baseURL,
const KURL &destURL);
1177 void allowURLAction(
const TQString &action,
const KURL &_baseURL,
const KURL &_destURL);
1186 bool authorizeControlModule(
const TQString &menuId);
1196 TQStringList authorizeControlModules(
const TQStringList &menuIds);
1207 static ButtonState keyboardMouseState();
1210 enum { ShiftModifier = 1<<0,
1211 LockModifier = 1<<1,
1212 ControlModifier = 1<<2,
1222 static uint keyboardModifiers() KDE_DEPRECATED;
1225 enum { Button1Pressed = 1<<8,
1226 Button2Pressed = 1<<9,
1227 Button3Pressed = 1<<10,
1228 Button4Pressed = 1<<11,
1229 Button5Pressed = 1<<12 };
1234 static uint mouseState() KDE_DEPRECATED;
1241 static
int currentX11VT();
1269 TDEApplication( Display *display, TQt::HANDLE visual, TQt::HANDLE colormap,
1275 bool x11EventFilter( XEvent * );
1317 void invokeEditSlot(
const char *slot );
1320 void dcopFailure(
const TQString &);
1321 void dcopBlockUserInput(
bool );
1322 void x11FilterDestroyed();
1323 void checkAppStartedSlot();
1326 TQString sessionConfigName()
const;
1329 static bool s_dcopClientNeedsPostInit;
1331 bool bSessionManagement;
1332 struct oldPixmapType { TQPixmap a, b; };
1335 TQPixmap *icon, *miniIcon;
1337 char unused[
sizeof(oldPixmapType)];
1340 TQString aMiniIconName;
1344 void init(
bool GUIenabled );
1346 void parseCommandLine( );
1348 void read_app_startup_id();
1350 void dcopAutoRegistration();
1351 void dcopClientPostInit();
1352 void initUrlActionRestrictions();
1355 #if defined(TQ_WS_X11)
1356 TQt::HANDLE argb_x11_visual;
1357 TQt::HANDLE argb_x11_colormap;
1364 bool notify(TQObject *receiver, TQEvent *event);
1369 int xErrhandler( Display*,
void* );
1374 int xioErrhandler( Display* );
1379 void iceIOErrorHandler( _IceConn *conn );
1384 static bool loadedByKdeinit;
1389 static void startKdeinit();
1395 SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS };
1405 static TQPalette createApplicationPalette();
1411 static TQPalette createApplicationPalette(
TDEConfig *config,
int contrast );
1420 static void installSigpipeHandler();
1428 static bool guiEnabled();
1549 void updateIconLoaders();
1555 void coreFakeKeyPress(
unsigned int keyCode);
1559 void tdedisplaySetPalette();
1560 void tdedisplaySetStyle();
1561 void tdedisplaySetFont();
1562 void applyGUIStyle();
1563 static void sigpipeHandler(
int);
1570 virtual void virtual_hook(
int id,
void* data );
1572 TDEApplicationPrivate* d;
1593 TDECORE_EXPORT
bool checkAccess(
const TQString& pathname,
int mode);
1595 class KSessionManagedPrivate;
1628 virtual bool saveState( TQSessionManager& sm );
1638 virtual bool commitData( TQSessionManager& sm );
1641 virtual void virtual_hook(
int id,
void* data );
1643 KSessionManagedPrivate *d;
Charset font and encoder/decoder handling.
Provides highlevel access to session management on a per-object base.
Represents and parses a URL.
Controls and provides information to all KDE applications.
static TDEApplication * KApp
Current application object.
void appearanceChanged()
Emitted when TDEApplication has changed either its GUI style, its font or its palette in response to ...
void settingsChanged(int category)
Emitted when the global settings have been changed - see TDEGlobalSettings TDEApplication takes care ...
ShutdownType
The possible values for the sdtype parameter of requestShutDown().
void tdedisplayStyleChanged()
Emitted when TDEApplication has changed its GUI style in response to a KControl request.
ShutdownMode
The possible values for the sdmode parameter of requestShutDown().
CaptionLayout
Position of the caption (presumably in the application window's title bar).
void toolbarAppearanceChanged(int)
Emitted when the settings for toolbars have been changed.
void tdedisplayPaletteChanged()
Emitted when TDEApplication has changed its palette due to a KControl request.
void shutDown()
Your application is killed.
TQPixmap miniIcon() const
Returns the mini-icon for the application as a TQPixmap.
TQPixmap icon() const
Returns a TQPixmap with the application icon.
void tdedisplayFontChanged()
Emitted when TDEApplication has changed its font in response to a KControl request.
static TDEApplication * kApplication()
Returns the current application object.
void kipcMessage(int id, int data)
Emitted when a KIPC user message has been received.
void backgroundChanged(int desk)
Emitted when the desktop background has been changed by kcmdisplay.
KDE_DEPRECATED TDEStyle * tdestyle() const
SettingsCategory
Valid values for the settingsChanged signal.
void iconChanged(int group)
Emitted when the global icon settings have been changed.
ShutdownConfirm
The possible values for the confirm parameter of requestShutDown().
bool isRestored() const
Is the application restored from the session manager?
Access KDE Configuration entries.
bool checkAccess(const TQString &pathname, int mode)
Check, if a file may be accessed in a given mode.
Access to KDE global objects for use in shared libraries.