Tulip  4.0.0
Better Visualization Through Research
 All Classes Files Functions Variables Enumerations Enumerator Properties Groups Pages
PreferenceManager.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux 1 and Inria Bordeaux - Sud Ouest
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #ifndef Tulip_PREFERENCEMANAGER_H
22 #define Tulip_PREFERENCEMANAGER_H
23 
24 #include <tulip/tulipconf.h>
25 #include <tulip/Color.h>
26 
27 namespace tlp {
28 
29 /** \brief Class to manage preference
30  * Singleton class to load/store preference need by Tulip
31  */
32 class TLP_SCOPE PreferenceManager {
33 
34 
35 public:
36 
37  /**
38  * Create the preference manager singleton
39  */
40  static void createInst();
41  /**
42  * Return the pereference manager singleton, il singleton doesn't exist this function create it
43  */
44  static PreferenceManager &getInst() {
45  if(!inst)
46  inst=new PreferenceManager();
47 
48  return *inst;
49  }
50 
51  /**
52  * Set if tulip auto connect at startup
53  */
54  void setNetworkConnection(bool connection) {
55  networkConnection=connection;
56  }
57 
58  /**
59  * Get if tulip auto connect at startup
60  */
61  bool getNetworkConnection() {
62  return networkConnection;
63  }
64 
65  /**
66  * Set color for selection
67  */
68  void setSelectionColor(const Color &color) {
69  selectionColor=color;
70  }
71 
72  /**
73  * Get color for selection
74  */
75  const Color& getSelectionColor();
76 
77  /**
78  * Set if tulip auto load controller
79  */
80  void setAutoLoadController(bool autoLoad) {
81  autoLoadController=autoLoad;
82  }
83 
84  /**
85  * Get if tulip auto load controller
86  */
87  bool getAutoLoadController() {
88  return autoLoadController;
89  }
90 
91 private:
92 
93  /**
94  * empty private constructor for singleton
95  */
96  PreferenceManager() {}
97 
98  static PreferenceManager* inst;
99 
100  bool networkConnection;
101  Color selectionColor;
102  bool autoLoadController;
103 
104 };
105 
106 }
107 
108 #endif // Tulip_GLTEXTUREMANAGER_H
109 ///@endcond