summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Client/Code/Core/Utility/StudioPreferences.h
blob: 25dbcbd0156ac2c9109c94d15d27e667fa930587 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
/****************************************************************************
**
** Copyright (C) 2016 NVIDIA Corporation.
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt 3D Studio.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

#ifndef INCLUDED_STUDIO_PREFERENCES_H
#define INCLUDED_STUDIO_PREFERENCES_H 1

#pragma once

#include <qglobal.h>
#include <QtGui/qbrush.h>

#include "CoreConst.h"
#include "Rct.h"
#include "CColor.h"

QT_FORWARD_DECLARE_CLASS(QQmlContext)

class CStudioPreferences
{
    CStudioPreferences();
    virtual ~CStudioPreferences();

public:
    static void loadPreferences();
    static void savePreferences();

    //
    // Settings to save in QSettings
    //

    // MainWindow settings
    //
    static QByteArray windowGeometry(int version);
    static void setWindowGeometry(const QByteArray &geometry, int version);
    static void resetWindowGeometry(int version);

    static bool containsWindowState(int version);
    static QByteArray windowState(int version);
    static void setWindowState(const QByteArray &state, int version);
    static void resetWindowState(int version);

    // Viewing settings
    //
    static bool isLegacyViewerActive();
    static void setLegacyViewerActive(bool inActive);

    static bool isEditViewFillMode();
    static void setEditViewFillMode(bool inRenderAsSolid);

    static int preferredStartupView();
    static void setPreferredStartupView(int inStartupView);

    static bool isDontShowGLVersionDialog();
    static void setDontShowGLVersionDialog(bool inValue);

    static QSize defaultClientSize();
    static void setDefaultClientSize(int width, int height);

    static bool isEditModeLightingEnabled();
    static void setEditModeLightingEnabled(bool enabled);

    static bool containsShowWelcomeScreen();
    static bool isShowWelcomeScreen();
    static void setShowWelcomeScreen(bool show);

    // Timeline settings
    //
    static bool isTimelineSnappingGridActive();
    static void setTimelineSnappingGridActive(bool inActive);

    static ESnapGridResolution timelineSnappingGridResolution();
    static void setTimelineSnappingGridResolution(ESnapGridResolution inResolution);

    static bool isAutosetKeyframesOn();
    static void setAutosetKeyframesOn(bool inEnable);

    static double timelineSplitterLocation();
    static void setTimelineSplitterLocation(double inLocation);

    static bool isInterpolation();
    static void setInterpolation(bool inSmooth);

    static double snapRange();
    static void setSnapRange(double inSnapRange);

    static bool isTimebarDisplayTime();
    static void setTimebarDisplayTime(bool inDisplayTime);

    static double timeAdvanceAmount();
    static void setTimeAdvanceAmount(double inTime);

    static double bigTimeAdvanceAmount();
    static void setBigTimeAdvanceAmount(double inTime);

    // VisualAids settings
    //
    static bool isBoundingBoxesOn();
    static void setBoundingBoxesOn(bool inEnable);

    static bool isPivotPointOn();
    static void setPivotPointOn(bool inEnable);

    static bool isWireframeModeOn();
    static void setWireframeModeOn(bool inEnable);

    static bool isTooltipsOn();
    static void setTooltipsOn(bool inShowTooltips);

    static bool isHelperGridOn();
    static void setHelperGridOn(bool showGrid);

    static int helperGridLines();
    static void setHelperGridLines(int lines);

    static int helperGridSpacing();
    static void setHelperGridSpacing(int spacing);

    static float selectorLineWidth();
    static void setSelectorLineWidth(float width);

    static float selectorLineLength();
    static void setSelectorLineLength(float length);

    // Autosave settings
    //
    static int autoSaveDelay();
    static void setAutoSaveDelay(int inAutoSaveDelay);

    static bool isAutoSavePreference();
    static void setAutoSavePreference(bool inActive);

    // Preview settings
    //
    static QString previewConfig();
    static void setPreviewConfig(const QString &inValue);

    static QString previewProperty(const QString &inName);
    static void setPreviewProperty(const QString &inName, const QString &inValue);

    static QString remoteDeploymentIP();
    static void setRemoteDeploymentIP(const QString &ip);

    static QString remoteDeploymentPort();
    static void setRemoteDeploymentPort(const QString &port);

    // Recent settings
    //
    static int numRecentItems();
    static void setNumRecentItems(int numberOfItems);

    static QString recentItem(int index);
    static void setRecentItem(int index, const QString &path);

    //
    // Other settings
    //
    static void setQmlContextProperties(QQmlContext *qml);

    static QString fontFaceName();

    static ::CColor mouseOverHighlightColor();
    static ::CColor normalColor();
    static ::CColor inactiveColor();
    static ::CColor objectTimebarColor();
    static ::CColor layerTimebarColor();
    static ::CColor disabledTextColor();
    static ::CColor singleBoundingBoxColor();
    static ::CColor groupBoundingBoxColor();

    static QColor xAxisColor();
    static QColor yAxisColor();
    static QColor zAxisColor();
    static QColor wAxisColor();
    static QColor helperGridColor();
    static QColor bezierControlColor();

    static ::CColor rulerBackgroundColor();
    static ::CColor rulerTickColor();
    static ::CColor guideNormalColor();
    static ::CColor guideSelectedColor();
    static ::CColor guideFillColor();
    static ::CColor guideFillSelectedColor();

    static QColor studioColor1();
    static QColor studioColor2();
    static QColor studioColor3();
    static QColor studioColor4();
    static QColor backgroundColor();
    static QColor guideColor();
    static QColor selectionColor();
    static QColor textColor();
    static QColor masterColor();
    static QColor disabledColor();
    static QColor dataInputColor();
    static QColor matteColor();
    static QColor projectReferencedColor();

    static QLinearGradient welcomeBackgroundGradient();

    static QColor timelineRowColorNormal();
    static QColor timelineRowColorNormalProp();
    static QColor timelineRowColorOver();
    static QColor timelineRowColorSelected();
    static QColor timelineRowColorDurationOff1();
    static QColor timelineRowColorDurationOff2();
    static QColor timelineRowColorDurationEdge();
    static QColor timelineRowColorDurationSelected();
    static QColor timelineRowColorDndSource();
    static QColor timelineRowColorDndTarget();
    static QColor timelineRowColorDndTargetSP();
    static QColor timelineRowMoverColor();
    static QColor timelineRulerColor();
    static QColor timelineRulerColorDisabled();
    static QColor timelineWidgetBgColor();
    static QColor timelinePlayheadLineColor();
    static QColor timelineFilterButtonSelectedColor();
    static QColor timelineFilterButtonHoveredColor();
    static QColor timelineRowSubpColor();
    static QColor timelineRowSubpDescendantColor();
    static QColor timelineRowCommentBgColor();
    static QColor timelinePressedKeyframeColor();

    static QColor invalidDataInputIndicatorColor();

    static int fontSize();
    static int controlBaseHeight();
    static int idWidth();
    static int valueWidth();
    static QSize browserPopupSize();
    static QString versionString();

    // Default values that Studio will start out with or to restore
    static const int PREFERREDSTARTUP_DEFAULTINDEX = -1;
    static constexpr double DEFAULT_SNAPRANGE = 10.;
    static const int DEFAULT_CLIENT_WIDTH = 1920;
    static const int DEFAULT_CLIENT_HEIGHT = 1080;
    static constexpr double DEFAULT_TIME_ADVANCE = 100.;
    static constexpr double DEFAULT_BIG_TIME_ADVANCE = 500.;
    static constexpr float DEFAULT_SELECTOR_WIDTH = 30.f;
    static constexpr float DEFAULT_SELECTOR_LENGTH = 50.f;
    static const int DEFAULT_AUTOSAVE_DELAY = 600;
};
#endif // INCLUDED_STUDIO_PREFERENCES_H