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

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • 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 
29 class 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 
40 typedef unsigned long Atom;
41 #if !defined(Q_WS_X11)
42 typedef 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 
53 struct _IceConn;
54 class QPixmap;
55 
56 #define kapp KApplication::kApplication()
57 
58 class KApplicationPrivate;
59 
82 class KDEUI_EXPORT KApplication : public QApplication
83 {
84  Q_OBJECT
85  Q_CLASSINFO("D-Bus Interface", "org.kde.KApplication")
86 public:
100  explicit KApplication(bool GUIenabled = true);
101 
102 #ifdef Q_WS_X11
103 
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
165 
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
218 
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
276 
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
303 
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
361 
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 
406 public 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 
418 Q_SIGNALS:
446  void saveYourself();
447 
448 protected:
452  KApplication(bool GUIenabled, const KComponentData &cData);
453 
454 #ifdef Q_WS_X11
455 
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 
470 private:
471  KApplication(const KApplication&);
472  KApplication& operator=(const KApplication&);
473 
474 private:
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 
Atom
unsigned long Atom
Definition: kapplication.h:29
KApplication
Controls and provides information to all KDE applications.
Definition: kapplication.h:82
QEvent
QWidget
krandom.h
IconSize
int IconSize(KIconLoader::Group group)
Definition: kiconloader.cpp:1598
QApplication::commitData
virtual void commitData(QSessionManager &manager)
QByteArray
QSessionManager
KCmdLineArgs::parsedArgs
static KCmdLineArgs * parsedArgs(const QByteArray &id=QByteArray())
QX11Info::display
Display * display()
KCmdLineArgs
QApplication
kiconloader.h
QApplication::saveState
virtual void saveState(QSessionManager &manager)
KIconLoader::Desktop
Desktop icons.
Definition: kiconloader.h:131
KApplication::KApp
static KApplication * KApp
Current application object.
Definition: kapplication.h:468
KCmdLineArgs::isSet
bool isSet(const QByteArray &option) const
QIcon::pixmap
QPixmap pixmap(const QSize &size, Mode mode, State state) const
random
int random()
kglobal.h
KIconLoader::Small
Small icons, e.g. for buttons.
Definition: kiconloader.h:139
QObject
kcmdlineargs.h
Qt::HANDLE
typedef HANDLE
QString
QCoreApplication::quit
void quit()
QStringList
QPixmap
QApplication::x11EventFilter
virtual bool x11EventFilter(XEvent *event)
kicontheme.h
KConfig
QApplication::isSessionRestored
bool isSessionRestored() const
QApplication::windowIcon
QIcon windowIcon()
kdeui_export.h
KCmdLineArgs::getOption
QString getOption(const QByteArray &option) const
KApplication::loadedByKdeinit
static bool loadedByKdeinit
Definition: kapplication.h:404
kcomponentdata.h
QApplication::notify
virtual bool notify(QObject *receiver, QEvent *e)
randomString
QString randomString(int length)
KComponentData
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:58 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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