Bayeux  3.4.1
Core Foundation library for SuperNEMO
interface.h
Go to the documentation of this file.
1 /* Author(s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2014-11-30
4  * Last modified: 2014-12-02
5  *
6  * License:
7  *
8  * Copyright (C) 2014 Francois Mauger <mauger@lpccaen.in2p3.fr>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 3 of the License, or (at
13  * your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
23  * Boston, MA 02110-1301, USA.
24  *
25  * Description:
26  *
27  * Qt interface singleton.
28  *
29  */
30 
31 // This code is inspired from the G4Qt class by Laurent Garnier,
32 // from the Geant4 Collaboration.
33 //
34 // ********************************************************************
35 // * License and Disclaimer *
36 // * *
37 // * The Geant4 software is copyright of the Copyright Holders of *
38 // * the Geant4 Collaboration. It is provided under the terms and *
39 // * conditions of the Geant4 Software License, included in the file *
40 // * LICENSE and available at http://cern.ch/geant4/license . These *
41 // * include a list of copyright holders. *
42 // * *
43 // * Neither the authors of this software system, nor their employing *
44 // * institutes,nor the agencies providing financial support for this *
45 // * work make any representation or warranty, express or implied, *
46 // * regarding this software system or assume any liability for its *
47 // * use. Please see the license in the file LICENSE and URL above *
48 // * for the full disclaimer and the limitation of liability. *
49 // * *
50 // * This code implementation is the result of the scientific and *
51 // * technical work of the GEANT4 collaboration. *
52 // * By using, copying, modifying or distributing the software (or *
53 // * any work based on the software) you agree to acknowledge its *
54 // * use in resulting scientific publications, and indicate your *
55 // * acceptance of all terms of the Geant4 Software license. *
56 // ********************************************************************
57 //
58 
59 #ifndef DATATOOLS_QT_INTERFACE_H
60 #define DATATOOLS_QT_INTERFACE_H
61 
62 // Forward declaration:
63 class QApplication;
64 
65 namespace datatools {
66 
67  namespace qt {
68 
69  class interface_impl;
70 
72  class interface
73  {
74 
75  private:
76 
78  interface(int argc_ = 0, char ** argv_ = nullptr, const char * name_ = 0);
79 
80  public:
81 
83  virtual ~interface();
84 
86  static interface & instance();
87 
89  static interface & instance(int argc_, char ** argv_, const char * name_ = 0);
90 
92  bool is_initialized() const;
93 
95  bool is_external_app() const;
96 
97  private:
98 
99  // Should we PIMPL ?
100  // boost::scope_ptr<interface_impl> _impl_;
101 
102  int _argc_ = 0;
103  char ** _argv_ = nullptr;
104  bool _arg_owned_ = false;
105  bool _external_app_ = false;
106  bool _qt_initialized_ = false;
107  QApplication * _qt_app_ = nullptr;
108 
109  };
110 
111  } // end of namespace qt
112 
113 } // end of namespace datatools
114 
115 #endif // DATATOOLS_QT_INTERFACE_H
116 
117 // Local Variables: --
118 // mode: c++ --
119 // c-file-style: "gnu" --
120 // tab-width: 2 --
121 // End: --
Interface to Qt.
Definition: interface.h:72
bool is_external_app() const
Check if Qt application is external.
bool is_initialized() const
Check initialization status.
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
static interface & instance()
Initialize and return the singleton.
virtual ~interface()
Destructor.