KDEUI
kuniqueapplication.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (c) 1999 Preston Brown <pbrown@kde.org> 00003 Copyright (c) 2000-2001 Waldo Bastian <bastian@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef KUNIQUEAPP_H 00022 #define KUNIQUEAPP_H 00023 00024 #include <kapplication.h> 00025 00055 class KDEUI_EXPORT KUniqueApplication : public KApplication 00056 { 00057 Q_OBJECT 00058 public: 00068 explicit KUniqueApplication( bool GUIenabled=true, 00069 bool configUnique=false); 00070 00071 #ifdef Q_WS_X11 00072 00088 explicit KUniqueApplication( Display *display, 00089 Qt::HANDLE visual=0, 00090 Qt::HANDLE colormap=0, 00091 bool configUnique=false); 00092 #endif 00093 00100 static void addCmdLineOptions(); 00101 00106 enum StartFlag 00107 { 00119 NonUniqueInstance = 0x1 00120 }; 00121 Q_DECLARE_FLAGS(StartFlags,StartFlag) 00122 00123 00157 static bool start(StartFlags flags); 00158 // BIC: merge with start(StartFlags flags = StartFlags()) 00159 static bool start(); 00160 00164 virtual ~KUniqueApplication(); 00165 00207 virtual int newInstance(); 00208 00213 bool restoringSession(); 00214 00218 static void setHandleAutoStarted(); 00219 00220 private: 00221 friend class KUniqueApplicationAdaptor; 00222 class Private; 00223 Private * const d; 00224 00225 Q_PRIVATE_SLOT(d, void _k_newInstanceNoFork()) 00226 }; 00227 Q_DECLARE_OPERATORS_FOR_FLAGS(KUniqueApplication::StartFlags) 00228 00229 #endif
KDE 4.6 API Reference