25 #include "kdeversion.h"
26 #include "kdelibs_export.h"
33 #include <tqtglobaldefines.h>
35 typedef unsigned long Atom;
36 #if !defined(Q_WS_X11)
40 #include <tqapplication.h>
42 #include <kinstance.h>
51 #define kapp KApplication::kApplication()
53 class KApplicationPrivate;
131 KApplication(
bool allowStyles=
true,
bool GUIenabled=
true,
bool SMenabled=
true);
135 #ifdef TDEAPPLICATION_BINARY_COMPAT_HACK
139 KApplication(
bool allowStyles=
true,
bool GUIenabled=
true);
190 KApplication(Display *display,
bool disable_argb, Qt::HANDLE visual, Qt::HANDLE colormap,
bool allowStyles);
215 KApplication(Display *display, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0,
216 bool allowStyles=
true);
242 KApplication(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 kdeinitExec(
const TQString& name,
const TQStringList &args,
855 TQString *error,
int *pid,
const TQCString& startup_id );
857 static int kdeinitExec(
const TQString& name,
const TQStringList &args=TQStringList(),
858 TQString *error=0,
int *pid = 0 );
877 static int kdeinitExecWait(
const TQString& name,
const TQStringList &args,
878 TQString *error,
int *pid,
const TQCString& startup_id );
880 static int kdeinitExecWait(
const TQString& name,
const TQStringList &args=TQStringList(),
881 TQString *error=0,
int *pid = 0 );
891 TQString caption()
const;
896 KDE_DEPRECATED KStyle*
kstyle()
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(Q_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 Qt::HANDLE getX11RGBAVisual(Display *dpy);
994 Qt::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 authorizeKAction(
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;
1262 KApplication( Display *display, Qt::HANDLE visual, Qt::HANDLE colormap,
1263 bool allowStyles,
KInstance* _instance );
1268 bool x11EventFilter( XEvent * );
1310 void invokeEditSlot(
const char *slot );
1313 void dcopFailure(
const TQString &);
1314 void dcopBlockUserInput(
bool );
1315 void x11FilterDestroyed();
1316 void checkAppStartedSlot();
1319 TQString sessionConfigName()
const;
1322 static bool s_dcopClientNeedsPostInit;
1324 bool bSessionManagement;
1325 struct oldPixmapType { TQPixmap a, b; };
1328 TQPixmap *icon, *miniIcon;
1330 char unused[
sizeof(oldPixmapType)];
1333 TQString aMiniIconName;
1337 void init(
bool GUIenabled );
1339 void parseCommandLine( );
1341 void read_app_startup_id();
1343 void dcopAutoRegistration();
1344 void dcopClientPostInit();
1345 void initUrlActionRestrictions();
1348 #if defined(Q_WS_X11)
1349 Qt::HANDLE argb_x11_visual;
1350 Qt::HANDLE argb_x11_colormap;
1357 bool notify(TQObject *receiver, TQEvent *event);
1362 int xErrhandler( Display*,
void* );
1367 int xioErrhandler( Display* );
1372 void iceIOErrorHandler( _IceConn *conn );
1377 static bool loadedByKdeinit;
1382 static void startKdeinit();
1388 SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS };
1398 static TQPalette createApplicationPalette();
1404 static TQPalette createApplicationPalette(
KConfig *config,
int contrast );
1413 static void installSigpipeHandler();
1421 static bool guiEnabled();
1542 void updateIconLoaders();
1548 void coreFakeKeyPress(
unsigned int keyCode);
1552 void kdisplaySetPalette();
1553 void kdisplaySetStyle();
1554 void kdisplaySetFont();
1555 void applyGUIStyle();
1556 static void sigpipeHandler(
int);
1563 virtual void virtual_hook(
int id,
void* data );
1565 KApplicationPrivate* d;
1586 KDECORE_EXPORT
bool checkAccess(
const TQString& pathname,
int mode);
1588 class KSessionManagedPrivate;
1621 virtual bool saveState( TQSessionManager& sm );
1631 virtual bool commitData( TQSessionManager& sm );
1634 virtual void virtual_hook(
int id,
void* data );
1636 KSessionManagedPrivate *d;
Controls and provides information to all KDE applications.
void settingsChanged(int category)
Emitted when the global settings have been changed - see KGlobalSettings KApplication takes care of c...
ShutdownMode
The possible values for the sdmode parameter of requestShutDown().
static KApplication * kApplication()
Returns the current application object.
void kdisplayStyleChanged()
Emitted when KApplication has changed its GUI style in response to a KControl request.
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 backgroundChanged(int desk)
Emitted when the desktop background has been changed by kcmdisplay.
void kdisplayFontChanged()
Emitted when KApplication has changed its font in response to a KControl request.
KDE_DEPRECATED KStyle * kstyle() const
void iconChanged(int group)
Emitted when the global icon settings have been changed.
void kdisplayPaletteChanged()
Emitted when KApplication has changed its palette due to a KControl request.
bool isRestored() const
Is the application restored from the session manager?
static KApplication * KApp
Current application object.
ShutdownConfirm
The possible values for the confirm parameter of requestShutDown().
TQPixmap miniIcon() const
Returns the mini-icon for the application as a TQPixmap.
void kipcMessage(int id, int data)
Emitted when a KIPC user message has been received.
void appearanceChanged()
Emitted when KApplication has changed either its GUI style, its font or its palette in response to a ...
SettingsCategory
Valid values for the settingsChanged signal.
ShutdownType
The possible values for the sdtype parameter of requestShutDown().
TQPixmap icon() const
Returns a TQPixmap with the application icon.
void shutDown()
Your application is killed.
Charset font and encoder/decoder handling.
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.
Provides highlevel access to session management on a per-object base.
Represents and parses a URL.