• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • kernel
kapplication.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org)
3 Copyright (c) 1998, 1999 KDE Team
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KAPP_H
22#define KAPP_H
23
24// Version macros. Never put this further down.
25// TODO: KDE5 -#include "kdeversion.h"
26#include "kdeversion.h"
27#include <kdeui_export.h>
28
29class KConfig;
30
31#ifdef KDE3_SUPPORT
32#include <krandom.h>
33#include <kcmdlineargs.h>
34#include <kiconloader.h>
35#include <kicontheme.h>
36#include <QtGui/QPixmap>
37#include <QtGui/QIcon>
38#endif
39
40typedef unsigned long Atom;
41#if !defined(Q_WS_X11)
42typedef void Display;
43#endif
44
45#include <QtGui/QApplication>
46#include <kcomponentdata.h>
47#include <kglobal.h>
48
49#ifdef Q_WS_X11
50#include <QtGui/QX11Info>
51#endif
52
53struct _IceConn;
54class QPixmap;
55
56#define kapp KApplication::kApplication()
57
58class KApplicationPrivate;
59
82class KDEUI_EXPORT KApplication : public QApplication
83{
84 Q_OBJECT
85 Q_CLASSINFO("D-Bus Interface", "org.kde.KApplication")
86public:
100 explicit KApplication(bool GUIenabled = true);
101
102#ifdef Q_WS_X11
118 explicit KApplication(Display *display, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
119
137 KApplication(Display *display, int& argc, char** argv, const QByteArray& rAppName,
138 bool GUIenabled=true);
139#endif
140
141 virtual ~KApplication();
142
153 static KApplication* kApplication();
154
162 KConfig* sessionConfig();
163
164#ifdef KDE3_SUPPORT
174 inline KDE_DEPRECATED bool isRestored() const { return QApplication::isSessionRestored(); }
175#endif
176
183 void disableSessionManagement();
184
191 void enableSessionManagement();
192
198 void commitData( QSessionManager& sm );
199
205 void saveState( QSessionManager& sm );
206
215 bool sessionSaving() const;
216
217#ifdef KDE3_SUPPORT
223 inline KDE_DEPRECATED QPixmap icon() const {
224 int size = IconSize(KIconLoader::Desktop);
225 return windowIcon().pixmap(size,size);
226 }
227
233 inline KDE_DEPRECATED QPixmap miniIcon() const {
234 int size = IconSize(KIconLoader::Small);
235 return windowIcon().pixmap(size,size);
236 }
237#endif
238
249 void setTopWidget( QWidget *topWidget );
250
259#ifndef KDE_NO_DEPRECATED
260 static KDE_DEPRECATED QString tempSaveName( const QString& pFilename );
261#endif
262
272 static QString checkRecoverFile( const QString& pFilename, bool& bRecover );
273
274#ifdef KDE3_SUPPORT
275#ifdef Q_WS_X11
281 static inline KDE_DEPRECATED Display *getDisplay() { return QX11Info::display(); }
282#endif
283#endif
284
294 void installX11EventFilter( QWidget* filter );
295
300 void removeX11EventFilter( const QWidget* filter );
301
302#ifdef KDE3_SUPPORT
308 static inline KDE_DEPRECATED int random() { return KRandom::random(); }
309
316 static inline KDE_DEPRECATED QString randomString(int length) { return KRandom::randomString(length); }
317#endif
318
324 QByteArray startupId() const;
325
333 void setStartupId( const QByteArray& startup_id );
338 void clearStartupId();
339
343 void setSynchronizeClipboard(bool synchronize);
344
349 unsigned long userTimestamp() const;
350
358 void updateRemoteUserTimestamp( const QString& service, int time = 0 );
359
360#ifdef KDE3_SUPPORT
375 static inline KDE_DEPRECATED QString geometryArgument() {
376 KCmdLineArgs *args = KCmdLineArgs::parsedArgs("kde");
377 return args->isSet("geometry") ? args->getOption("geometry") : QString();
378 }
379#endif
380
384 bool notify( QObject* receiver, QEvent* event );
385
389 int xErrhandler( Display*, void* );
390
394 int xioErrhandler( Display* );
395
399 void iceIOErrorHandler( _IceConn *conn );
400
404 static bool loadedByKdeinit;
405
406public Q_SLOTS:
412 Q_SCRIPTABLE void updateUserTimestamp( int time = 0 );
413
414 // D-Bus slots:
415 Q_SCRIPTABLE void reparseConfiguration();
416 Q_SCRIPTABLE void quit();
417
418Q_SIGNALS:
446 void saveYourself();
447
448protected:
452 KApplication(bool GUIenabled, const KComponentData &cData);
453
454#ifdef Q_WS_X11
458 KApplication(Display *display, Qt::HANDLE visual, Qt::HANDLE colormap,
459 const KComponentData &cData);
460
464 bool x11EventFilter( XEvent * );
465#endif
466
468 static KApplication *KApp;
469
470private:
471 KApplication(const KApplication&);
472 KApplication& operator=(const KApplication&);
473
474private:
475 //### KDE4: This is to catch invalid implicit conversions, may want to reconsider
476 KApplication(bool, bool);
477
478 friend class KApplicationPrivate;
479 KApplicationPrivate* const d;
480
481 Q_PRIVATE_SLOT(d, void _k_x11FilterDestroyed())
482 Q_PRIVATE_SLOT(d, void _k_checkAppStartedSlot())
483 Q_PRIVATE_SLOT(d, void _k_slot_KToolInvocation_hook(QStringList&, QByteArray&))
484};
485
486#endif
487
KApplication
Controls and provides information to all KDE applications.
Definition: kapplication.h:83
KApplication::KApp
static KApplication * KApp
Current application object.
Definition: kapplication.h:468
KApplication::saveYourself
void saveYourself()
Session management asks you to save the state of your application.
KApplication::loadedByKdeinit
static bool loadedByKdeinit
Definition: kapplication.h:404
KCmdLineArgs
KCmdLineArgs::isSet
bool isSet(const QByteArray &option) const
KCmdLineArgs::parsedArgs
static KCmdLineArgs * parsedArgs(const QByteArray &id=QByteArray())
KCmdLineArgs::getOption
QString getOption(const QByteArray &option) const
KComponentData
KConfig
KIconLoader::Small
@ Small
Small icons, e.g. for buttons.
Definition: kiconloader.h:139
KIconLoader::Desktop
@ Desktop
Desktop icons.
Definition: kiconloader.h:131
QApplication
QObject
QWidget
Atom
unsigned long Atom
Definition: kapplication.h:40
kcmdlineargs.h
kcomponentdata.h
kdeui_export.h
kglobal.h
IconSize
int IconSize(KIconLoader::Group group)
Definition: kiconloader.cpp:1598
kiconloader.h
kicontheme.h
krandom.h
random
int random()
randomString
QString randomString(int length)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal