KDELibs4Support

kuniqueapplication.h
1 /* This file is part of the KDE libraries
2  Copyright (c) 1999 Preston Brown <[email protected]>
3  Copyright (c) 2000-2001 Waldo Bastian <[email protected]>
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 KUNIQUEAPP_H
22 #define KUNIQUEAPP_H
23 
24 #include <kdelibs4support_export.h>
25 #include <kapplication.h>
26 
56 class KDELIBS4SUPPORT_DEPRECATED_EXPORT KUniqueApplication : public KApplication
57 {
58  Q_OBJECT
59 public:
69  KDELIBS4SUPPORT_DEPRECATED explicit KUniqueApplication(bool GUIenabled = true,
70  bool configUnique = false);
71 
78  static void addCmdLineOptions();
79 
84  enum StartFlag {
96  NonUniqueInstance = 0x1
97  };
98  Q_DECLARE_FLAGS(StartFlags, StartFlag)
99 
100 
134  static bool start(StartFlags flags);
135  // BIC: merge with start(StartFlags flags = StartFlags())
136  static bool start();
137 
141  virtual ~KUniqueApplication();
142 
184  virtual int newInstance();
185 
190  bool restoringSession();
191 
195 #ifndef KDELIBS4SUPPORT_NO_DEPRECATED
196  KDELIBS4SUPPORT_DEPRECATED static void setHandleAutoStarted();
197 #endif
198 
199 private:
200  friend class KUniqueApplicationAdaptor;
201  class Private;
202  Private *const d;
203 
204  Q_PRIVATE_SLOT(d, void _k_newInstanceNoFork())
205 };
206 Q_DECLARE_OPERATORS_FOR_FLAGS(KUniqueApplication::StartFlags)
207 
208 #endif
Controls and provides information to all KDE applications.
Definition: kapplication.h:76
StartFlag
These flags can be used to specify how new instances of unique applications are created.
KUniqueApplication is a KApplication which only uses a single process.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 22:56:39 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.