Pencil2D  ff90c0872e88be3bf81c548cd60f01983012ec49
Pencil2D is an animation software for both bitmap and vector graphics. It is free, multi-platform, and open source.
 All Classes Functions
preferencemanager.h
1 /*
2 
3 Pencil - Traditional Animation Software
4 Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5 Copyright (C) 2012-2017 Matthew Chiawen Chang
6 
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; version 2 of the License.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 */
17 
18 #ifndef PREFERENCEMANAGER_H
19 #define PREFERENCEMANAGER_H
20 
21 #include <bitset>
22 #include "basemanager.h"
23 #include "pencildef.h"
24 
25 
26 enum class SETTING
27 {
28  ANTIALIAS,
29  GRID,
30  SHADOW,
31  PREV_ONION,
32  NEXT_ONION,
33  AXIS,
34  INVISIBLE_LINES,
35  OUTLINES,
36  ONION_BLUE,
37  ONION_RED,
38  MIRROR_H,
39  MIRROR_V,
40  TOOL_CURSOR,
41  DOTTED_CURSOR,
42  HIGH_RESOLUTION,
43  WINDOW_OPACITY,
44  CURVE_SMOOTHING,
45  BACKGROUND_STYLE,
46  AUTO_SAVE,
47  AUTO_SAVE_NUMBER,
48  SHORT_SCRUB,
49  FRAME_SIZE,
50  TIMELINE_SIZE,
51  LABEL_FONT_SIZE,
52  DRAW_LABEL,
53  ONION_MAX_OPACITY,
54  ONION_MIN_OPACITY,
55  ONION_PREV_FRAMES_NUM,
56  ONION_NEXT_FRAMES_NUM,
57  ONION_TYPE,
58  GRID_SIZE,
59  QUICK_SIZING,
60  MULTILAYER_ONION,
61  LANGUAGE,
62  LAYOUT_LOCK,
63  COUNT, // COUNT must always be the last one.
64 };
65 
67 {
68  Q_OBJECT
69 
70 public:
71  PreferenceManager( QObject* parent );
73 
74  virtual bool init() override;
75  Status load( Object* ) override;
76  Status save( Object* ) override;
77 
78  void loadPrefs();
79  void set(SETTING option, QString value );
80  void set(SETTING option, int value );
81  void set(SETTING option, bool value );
82 
83  void turnOn(SETTING option );
84  void turnOff(SETTING option );
85  bool isOn(SETTING option );
86 
87  void setOnionPrevFramesCount( int n );
88  int getOnionPrevFramesCount();
89  void setOnionNextFramesCount( int n );
90  int getOnionNextFramesCount();
91 
92  QString getString(SETTING option);
93  int getInt(SETTING option);
94 
95 Q_SIGNALS:
96  void optionChanged( SETTING e );
97 
98 
99 private:
100  QHash< int, QString > mStringSet;
101  QHash< int, int > mIntegerSet;
102  QHash< int, bool > mBooleanSet;
103 };
104 
105 #endif // PREFERENCEMANAGER_H
Definition: object.h:71