1 /*
2  *  Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 #ifndef KIS_CONFIG_H_
19 #define KIS_CONFIG_H_
20 
21 #include <QString>
22 #include <QStringList>
23 #include <QList>
24 #include <QColor>
25 #include <QObject>
26 
27 #include <ksharedconfig.h>
28 #include <kconfiggroup.h>
29 
30 #include <kis_global.h>
31 #include <kis_properties_configuration.h>
32 #include "kritaui_export.h"
33 
34 class KoColorProfile;
35 class KoColorSpace;
36 class KisSnapConfig;
37 class QSettings;
38 class KisOcioConfiguration;
39 
40 class KRITAUI_EXPORT KisConfig
41 {
42 public:
43     /**
44      * @brief KisConfig create a kisconfig object
45      * @param readOnly if true, there will be no call to sync when the object is deleted.
46      *  Any KisConfig object created in a thread must be read-only.
47      */
48     KisConfig(bool readOnly);
49 
50     ~KisConfig();
51 
52 public Q_SLOTS:
53     /// Log the most interesting settings to the usage log
54     void logImportantSettings() const;
55 public:
56 
57     bool disableTouchOnCanvas(bool defaultValue = false) const;
58     void setDisableTouchOnCanvas(bool value) const;
59 
60     bool disableTouchRotation(bool defaultValue = false) const;
61     void setDisableTouchRotation(bool value) const;
62 
63     // XXX Unused?
64     bool useProjections(bool defaultValue = false) const;
65     void setUseProjections(bool useProj) const;
66 
67     bool undoEnabled(bool defaultValue = false) const;
68     void setUndoEnabled(bool undo) const;
69 
70     int undoStackLimit(bool defaultValue = false) const;
71     void setUndoStackLimit(int limit) const;
72 
73     bool useCumulativeUndoRedo(bool defaultValue = false) const;
74     void setCumulativeUndoRedo(bool value);
75 
76     double stackT1(bool defaultValue = false) const;
77     void setStackT1(int T1);
78 
79     double stackT2(bool defaultValue = false) const;
80     void setStackT2(int T2);
81 
82     int stackN(bool defaultValue = false) const;
83     void setStackN(int N);
84 
85     qint32 defImageWidth(bool defaultValue = false) const;
86     void defImageWidth(qint32 width) const;
87 
88     qint32 defImageHeight(bool defaultValue = false) const;
89     void defImageHeight(qint32 height) const;
90 
91     qreal defImageResolution(bool defaultValue = false) const;
92     void defImageResolution(qreal res) const;
93 
94     int preferredVectorImportResolutionPPI(bool defaultValue = false) const;
95     void setPreferredVectorImportResolutionPPI(int value) const;
96 
97     /**
98      * @return the id of the default color model used for creating new images.
99      */
100     QString defColorModel(bool defaultValue = false) const;
101     /**
102      * set the id of the default color model used for creating new images.
103      */
104     void defColorModel(const QString & model) const;
105 
106     /**
107      * @return the id of the default color depth used for creating new images.
108      */
109     QString defaultColorDepth(bool defaultValue = false) const;
110     /**
111      * set the id of the default color depth used for creating new images.
112      */
113     void setDefaultColorDepth(const QString & depth) const;
114 
115     /**
116      * @return the id of the default color profile used for creating new images.
117      */
118     QString defColorProfile(bool defaultValue = false) const;
119     /**
120      * set the id of the default color profile used for creating new images.
121      */
122     void defColorProfile(const QString & depth) const;
123 
124     CursorStyle newCursorStyle(bool defaultValue = false) const;
125     void setNewCursorStyle(CursorStyle style);
126 
127     QColor getCursorMainColor(bool defaultValue = false) const;
128     void setCursorMainColor(const QColor& v) const;
129 
130     OutlineStyle newOutlineStyle(bool defaultValue = false) const;
131     void setNewOutlineStyle(OutlineStyle style);
132 
133     QRect colorPreviewRect() const;
134     void setColorPreviewRect(const QRect &rect);
135 
136     /// get the profile the user has selected for the given screen
137     QString monitorProfile(int screen) const;
138     void setMonitorProfile(int screen, const QString & monitorProfile, bool override) const;
139 
140     QString monitorForScreen(int screen, const QString &defaultMonitor, bool defaultValue = true) const;
141     void setMonitorForScreen(int screen, const QString& monitor);
142 
143     /// Get the actual profile to be used for the given screen, which is
144     /// either the screen profile set by the color management system or
145     /// the custom monitor profile set by the user, depending on the configuration
146     const KoColorProfile *displayProfile(int screen) const;
147 
148     QString workingColorSpace(bool defaultValue = false) const;
149     void setWorkingColorSpace(const QString & workingColorSpace) const;
150 
151     QString importProfile(bool defaultValue = false) const;
152     void setImportProfile(const QString & importProfile) const;
153 
154     QString printerColorSpace(bool defaultValue = false) const;
155     void setPrinterColorSpace(const QString & printerColorSpace) const;
156 
157     QString printerProfile(bool defaultValue = false) const;
158     void setPrinterProfile(const QString & printerProfile) const;
159 
160     bool useBlackPointCompensation(bool defaultValue = false) const;
161     void setUseBlackPointCompensation(bool useBlackPointCompensation) const;
162 
163     bool allowLCMSOptimization(bool defaultValue = false) const;
164     void setAllowLCMSOptimization(bool allowLCMSOptimization);
165 
166     bool forcePaletteColors(bool defaultValue = false) const;
167     void setForcePaletteColors(bool forcePaletteColors);
168 
169     void writeKoColor(const QString& name, const KoColor& color) const;
170     KoColor readKoColor(const QString& name, const KoColor& color = KoColor()) const;
171 
172     bool showRulers(bool defaultValue = false) const;
173     void setShowRulers(bool rulers) const;
174 
175     bool forceShowSaveMessages(bool defaultValue = true) const;
176     void setForceShowSaveMessages(bool value) const;
177 
178     bool forceShowAutosaveMessages(bool defaultValue = true) const;
179     void setForceShowAutosaveMessages(bool ShowAutosaveMessages) const;
180 
181     bool rulersTrackMouse(bool defaultValue = false) const;
182     void setRulersTrackMouse(bool value) const;
183 
184     qint32 pasteBehaviour(bool defaultValue = false) const;
185     void setPasteBehaviour(qint32 behaviour) const;
186 
187     qint32 monitorRenderIntent(bool defaultValue = false) const;
188     void setRenderIntent(qint32 monitorRenderIntent) const;
189 
190     bool useOpenGL(bool defaultValue = false) const;
191     void disableOpenGL() const;
192 
193     int openGLFilteringMode(bool defaultValue = false) const;
194     void setOpenGLFilteringMode(int filteringMode);
195 
196     bool useOpenGLTextureBuffer(bool defaultValue = false) const;
197     void setUseOpenGLTextureBuffer(bool useBuffer);
198 
199     // XXX Unused?
200     bool disableVSync(bool defaultValue = false) const;
201     void setDisableVSync(bool disableVSync);
202 
203     bool showAdvancedOpenGLSettings(bool defaultValue = false) const;
204 
205     bool forceOpenGLFenceWorkaround(bool defaultValue = false) const;
206 
207     int numMipmapLevels(bool defaultValue = false) const;
208     int openGLTextureSize(bool defaultValue = false) const;
209     int textureOverlapBorder() const;
210 
211     quint32 getGridMainStyle(bool defaultValue = false) const;
212     void setGridMainStyle(quint32 v) const;
213 
214     quint32 getGridSubdivisionStyle(bool defaultValue = false) const;
215     void setGridSubdivisionStyle(quint32 v) const;
216 
217     QColor getGridMainColor(bool defaultValue = false) const;
218     void setGridMainColor(const QColor & v) const;
219 
220     QColor getGridSubdivisionColor(bool defaultValue = false) const;
221     void setGridSubdivisionColor(const QColor & v) const;
222 
223     QColor getPixelGridColor(bool defaultValue = false) const;
224     void setPixelGridColor(const QColor & v) const;
225 
226     qreal getPixelGridDrawingThreshold(bool defaultValue = false) const;
227     void setPixelGridDrawingThreshold(qreal v) const;
228 
229     bool pixelGridEnabled(bool defaultValue = false) const;
230     void enablePixelGrid(bool v) const;
231 
232     quint32 guidesLineStyle(bool defaultValue = false) const;
233     void setGuidesLineStyle(quint32 v) const;
234     QColor guidesColor(bool defaultValue = false) const;
235     void setGuidesColor(const QColor & v) const;
236 
237     void loadSnapConfig(KisSnapConfig *config, bool defaultValue = false) const;
238     void saveSnapConfig(const KisSnapConfig &config);
239 
240     qint32 checkSize(bool defaultValue = false) const;
241     void setCheckSize(qint32 checkSize) const;
242 
243     bool scrollCheckers(bool defaultValue = false) const;
244     void setScrollingCheckers(bool scollCheckers) const;
245 
246     QColor checkersColor1(bool defaultValue = false) const;
247     void setCheckersColor1(const QColor & v) const;
248 
249     QColor checkersColor2(bool defaultValue = false) const;
250     void setCheckersColor2(const QColor & v) const;
251 
252     QColor canvasBorderColor(bool defaultValue = false) const;
253     void setCanvasBorderColor(const QColor &color) const;
254 
255     bool hideScrollbars(bool defaultValue = false) const;
256     void setHideScrollbars(bool value) const;
257 
258     bool antialiasCurves(bool defaultValue = false) const;
259     void setAntialiasCurves(bool v) const;
260 
261     bool antialiasSelectionOutline(bool defaultValue = false) const;
262     void setAntialiasSelectionOutline(bool v) const;
263 
264     bool showRootLayer(bool defaultValue = false) const;
265     void setShowRootLayer(bool showRootLayer) const;
266 
267     bool showGlobalSelection(bool defaultValue = false) const;
268     void setShowGlobalSelection(bool showGlobalSelection) const;
269 
270     bool showOutlineWhilePainting(bool defaultValue = false) const;
271     void setShowOutlineWhilePainting(bool showOutlineWhilePainting) const;
272 
273     bool forceAlwaysFullSizedOutline(bool defaultValue = false) const;
274     void setForceAlwaysFullSizedOutline(bool value) const;
275 
276     enum SessionOnStartup {
277         SOS_BlankSession,
278         SOS_PreviousSession,
279         SOS_ShowSessionManager
280     };
281     SessionOnStartup sessionOnStartup(bool defaultValue = false) const;
282     void setSessionOnStartup(SessionOnStartup value);
283 
284     bool saveSessionOnQuit(bool defaultValue) const;
285     void setSaveSessionOnQuit(bool value);
286 
287     qreal outlineSizeMinimum(bool defaultValue = false) const;
288     void setOutlineSizeMinimum(qreal outlineSizeMinimum) const;
289 
290     qreal selectionViewSizeMinimum(bool defaultValue = false) const;
291     void setSelectionViewSizeMinimum(qreal outlineSizeMinimum) const;
292 
293     int autoSaveInterval(bool defaultValue = false) const;
294     void setAutoSaveInterval(int seconds) const;
295 
296     bool backupFile(bool defaultValue = false) const;
297     void setBackupFile(bool backupFile) const;
298 
299     bool showFilterGallery(bool defaultValue = false) const;
300     void setShowFilterGallery(bool showFilterGallery) const;
301 
302     bool showFilterGalleryLayerMaskDialog(bool defaultValue = false) const;
303     void setShowFilterGalleryLayerMaskDialog(bool showFilterGallery) const;
304 
305     // OPENGL_SUCCESS, TRY_OPENGL, OPENGL_NOT_TRIED, OPENGL_FAILED
306     QString canvasState(bool defaultValue = false) const;
307     void setCanvasState(const QString& state) const;
308 
309     bool toolOptionsPopupDetached(bool defaultValue = false) const;
310     void setToolOptionsPopupDetached(bool detached) const;
311 
312     bool paintopPopupDetached(bool defaultValue = false) const;
313     void setPaintopPopupDetached(bool detached) const;
314 
315     QString pressureTabletCurve(bool defaultValue = false) const;
316     void setPressureTabletCurve(const QString& curveString) const;
317 
318     bool useWin8PointerInput(bool defaultValue = false) const;
319     void setUseWin8PointerInput(bool value);
320 
321     static bool useWin8PointerInputNoApp(QSettings *settings, bool defaultValue = false);
322     static void setUseWin8PointerInputNoApp(QSettings *settings, bool value);
323 
324     bool useRightMiddleTabletButtonWorkaround(bool defaultValue = false) const;
325     void setUseRightMiddleTabletButtonWorkaround(bool value);
326 
327     qreal vastScrolling(bool defaultValue = false) const;
328     void setVastScrolling(const qreal factor) const;
329 
330     int presetChooserViewMode(bool defaultValue = false) const;
331     void setPresetChooserViewMode(const int mode) const;
332 
333     int presetIconSize(bool defaultValue = false) const;
334     void setPresetIconSize(const int value) const;
335 
336 
337     bool firstRun(bool defaultValue = false) const;
338     void setFirstRun(const bool firstRun) const;
339 
340     bool clicklessSpacePan(bool defaultValue = false) const;
341     void setClicklessSpacePan(const bool toggle) const;
342 
343     int horizontalSplitLines(bool defaultValue = false) const;
344     void setHorizontalSplitLines(const int numberLines) const;
345 
346     int verticalSplitLines(bool defaultValue = false) const;
347     void setVerticalSplitLines(const int numberLines) const;
348 
349     bool hideDockersFullscreen(bool defaultValue = false) const;
350     void setHideDockersFullscreen(const bool value) const;
351 
352     bool showDockers(bool defaultValue = false) const;
353     void setShowDockers(const bool value) const;
354 
355     bool showStatusBar(bool defaultValue = false) const;
356     void setShowStatusBar(const bool value) const;
357 
358     bool hideMenuFullscreen(bool defaultValue = false) const;
359     void setHideMenuFullscreen(const bool value) const;
360 
361     bool hideScrollbarsFullscreen(bool defaultValue = false) const;
362     void setHideScrollbarsFullscreen(const bool value) const;
363 
364     bool hideStatusbarFullscreen(bool defaultValue = false) const;
365     void setHideStatusbarFullscreen(const bool value) const;
366 
367     bool hideTitlebarFullscreen(bool defaultValue = false) const;
368     void setHideTitlebarFullscreen(const bool value) const;
369 
370     bool hideToolbarFullscreen(bool defaultValue = false) const;
371     void setHideToolbarFullscreen(const bool value) const;
372 
373     bool fullscreenMode(bool defaultValue = false) const;
374     void setFullscreenMode(const bool value) const;
375 
376     QStringList favoriteCompositeOps(bool defaultValue = false) const;
377     void setFavoriteCompositeOps(const QStringList& compositeOps) const;
378 
379     QString exportConfigurationXML(const QString &filterId, bool defaultValue = false) const;
380     KisPropertiesConfigurationSP exportConfiguration(const QString &filterId, bool defaultValue = false) const;
381     void setExportConfiguration(const QString &filterId, KisPropertiesConfigurationSP properties) const;
382 
383     QString importConfiguration(const QString &filterId, bool defaultValue = false) const;
384     void setImportConfiguration(const QString &filterId, KisPropertiesConfigurationSP properties) const;
385 
386     bool useOcio(bool defaultValue = false) const;
387     void setUseOcio(bool useOCIO) const;
388 
389     int favoritePresets(bool defaultValue = false) const;
390     void setFavoritePresets(const int value);
391 
392     bool levelOfDetailEnabled(bool defaultValue = false) const;
393     void setLevelOfDetailEnabled(bool value);
394 
395     KisOcioConfiguration ocioConfiguration(bool defaultValue = false) const;
396     void setOcioConfiguration(const KisOcioConfiguration &cfg);
397 
398     enum OcioColorManagementMode {
399         INTERNAL = 0,
400         OCIO_CONFIG,
401         OCIO_ENVIRONMENT
402     };
403 
404     OcioColorManagementMode ocioColorManagementMode(bool defaultValue = false) const;
405     void setOcioColorManagementMode(OcioColorManagementMode mode) const;
406 
407     int ocioLutEdgeSize(bool defaultValue = false) const;
408     void setOcioLutEdgeSize(int value);
409 
410     bool ocioLockColorVisualRepresentation(bool defaultValue = false) const;
411     void setOcioLockColorVisualRepresentation(bool value);
412 
413     bool useSystemMonitorProfile(bool defaultValue = false) const;
414     void setUseSystemMonitorProfile(bool _useSystemMonitorProfile) const;
415 
416     QString defaultPalette(bool defaultValue = false) const;
417     void setDefaultPalette(const QString& name) const;
418 
419     QString toolbarSlider(int sliderNumber, bool defaultValue = false) const;
420     void setToolbarSlider(int sliderNumber, const QString &slider);
421 
422 
423     int layerThumbnailSize(bool defaultValue = false) const;
424     void setLayerThumbnailSize(int size);
425 
426 
427     bool sliderLabels(bool defaultValue = false) const;
428     void setSliderLabels(bool enabled);
429 
430     QString currentInputProfile(bool defaultValue = false) const;
431     void setCurrentInputProfile(const QString& name);
432 
433     bool presetStripVisible(bool defaultValue = false) const;
434     void setPresetStripVisible(bool visible);
435 
436     bool scratchpadVisible(bool defaultValue = false) const;
437     void setScratchpadVisible(bool visible);
438 
439     bool showSingleChannelAsColor(bool defaultValue = false) const;
440     void setShowSingleChannelAsColor(bool asColor);
441 
442     bool hidePopups(bool defaultValue = false) const;
443     void setHidePopups(bool hidepopups);
444 
445     int numDefaultLayers(bool defaultValue = false) const;
446     void setNumDefaultLayers(int num);
447 
448     quint8 defaultBackgroundOpacity(bool defaultValue = false) const;
449     void setDefaultBackgroundOpacity(quint8 value);
450 
451     QColor defaultBackgroundColor(bool defaultValue = false) const;
452     void setDefaultBackgroundColor(const QColor &value);
453 
454     enum BackgroundStyle {
455         RASTER_LAYER = 0,
456         CANVAS_COLOR = 1,
457         FILL_LAYER = 2
458     };
459 
460     BackgroundStyle defaultBackgroundStyle(bool defaultValue = false) const;
461     void setDefaultBackgroundStyle(BackgroundStyle value);
462 
463     int lineSmoothingType(bool defaultValue = false) const;
464     void setLineSmoothingType(int value);
465 
466     qreal lineSmoothingDistance(bool defaultValue = false) const;
467     void setLineSmoothingDistance(qreal value);
468 
469     qreal lineSmoothingTailAggressiveness(bool defaultValue = false) const;
470     void setLineSmoothingTailAggressiveness(qreal value);
471 
472     bool lineSmoothingSmoothPressure(bool defaultValue = false) const;
473     void setLineSmoothingSmoothPressure(bool value);
474 
475     bool lineSmoothingScalableDistance(bool defaultValue = false) const;
476     void setLineSmoothingScalableDistance(bool value);
477 
478     qreal lineSmoothingDelayDistance(bool defaultValue = false) const;
479     void setLineSmoothingDelayDistance(qreal value);
480 
481     bool lineSmoothingUseDelayDistance(bool defaultValue = false) const;
482     void setLineSmoothingUseDelayDistance(bool value);
483 
484     bool lineSmoothingFinishStabilizedCurve(bool defaultValue = false) const;
485     void setLineSmoothingFinishStabilizedCurve(bool value);
486 
487     bool lineSmoothingStabilizeSensors(bool defaultValue = false) const;
488     void setLineSmoothingStabilizeSensors(bool value);
489 
490     int tabletEventsDelay(bool defaultValue = false) const;
491     void setTabletEventsDelay(int value);
492 
493     bool trackTabletEventLatency(bool defaultValue = false) const;
494     void setTrackTabletEventLatency(bool value);
495 
496     bool testingAcceptCompressedTabletEvents(bool defaultValue = false) const;
497     void setTestingAcceptCompressedTabletEvents(bool value);
498 
499     bool shouldEatDriverShortcuts(bool defaultValue = false) const;
500 
501     bool testingCompressBrushEvents(bool defaultValue = false) const;
502     void setTestingCompressBrushEvents(bool value);
503 
504     const KoColorSpace* customColorSelectorColorSpace(bool defaultValue = false) const;
505     void setCustomColorSelectorColorSpace(const KoColorSpace *cs);
506 
507     bool useDirtyPresets(bool defaultValue = false) const;
508     void setUseDirtyPresets(bool value);
509 
510     bool useEraserBrushSize(bool defaultValue = false) const;
511     void setUseEraserBrushSize(bool value);
512 
513     bool useEraserBrushOpacity(bool defaultValue = false) const;
514     void setUseEraserBrushOpacity(bool value);
515 
516     QString getMDIBackgroundColor(bool defaultValue = false) const;
517     void setMDIBackgroundColor(const QString & v) const;
518 
519     QString getMDIBackgroundImage(bool defaultValue = false) const;
520     void setMDIBackgroundImage(const QString & fileName) const;
521 
522     int workaroundX11SmoothPressureSteps(bool defaultValue = false) const;
523 
524     bool showCanvasMessages(bool defaultValue = false) const;
525     void setShowCanvasMessages(bool show);
526 
527     bool compressKra(bool defaultValue = false) const;
528     void setCompressKra(bool compress);
529 
530     bool trimKra(bool defaultValue = false) const;
531     void setTrimKra(bool trim);
532 
533     bool toolOptionsInDocker(bool defaultValue = false) const;
534     void setToolOptionsInDocker(bool inDocker);
535 
536     bool kineticScrollingEnabled(bool defaultValue = false) const;
537     void setKineticScrollingEnabled(bool enabled);
538 
539     int kineticScrollingGesture(bool defaultValue = false) const;
540     void setKineticScrollingGesture(int kineticScroll);
541 
542     int kineticScrollingSensitivity(bool defaultValue = false) const;
543     void setKineticScrollingSensitivity(int sensitivity);
544 
545     bool kineticScrollingHiddenScrollbars(bool defaultValue = false) const;
546     void setKineticScrollingHideScrollbars(bool scrollbar);
547 
548     void setEnableOpenGLFramerateLogging(bool value) const;
549     bool enableOpenGLFramerateLogging(bool defaultValue = false) const;
550 
551     void setEnableBrushSpeedLogging(bool value) const;
552     bool enableBrushSpeedLogging(bool defaultValue = false) const;
553 
554     void setEnableAmdVectorizationWorkaround(bool value);
555     bool enableAmdVectorizationWorkaround(bool defaultValue = false) const;
556 
557     void setDisableAVXOptimizations(bool value);
558     bool disableAVXOptimizations(bool defaultValue = false) const;
559 
560     bool animationDropFrames(bool defaultValue = false) const;
561     void setAnimationDropFrames(bool value);
562 
563     int scrubbingUpdatesDelay(bool defaultValue = false) const;
564     void setScrubbingUpdatesDelay(int value);
565 
566     int scrubbingAudioUpdatesDelay(bool defaultValue = false) const;
567     void setScrubbingAudioUpdatesDelay(int value);
568 
569     int audioOffsetTolerance(bool defaultValue = false) const;
570     void setAudioOffsetTolerance(int value);
571 
572     bool switchSelectionCtrlAlt(bool defaultValue = false) const;
573     void setSwitchSelectionCtrlAlt(bool value);
574 
575     bool convertToImageColorspaceOnImport(bool defaultValue = false) const;
576     void setConvertToImageColorspaceOnImport(bool value);
577 
578     int stabilizerSampleSize(bool defaultValue = false) const;
579     void setStabilizerSampleSize(int value);
580 
581     bool stabilizerDelayedPaint(bool defaultValue = false) const;
582     void setStabilizerDelayedPaint(bool value);
583 
584     bool showBrushHud(bool defaultValue = false) const;
585     void setShowBrushHud(bool value);
586 
587     QString brushHudSetting(bool defaultValue = false) const;
588     void setBrushHudSetting(const QString &value) const;
589 
590     bool calculateAnimationCacheInBackground(bool defaultValue = false) const;
591     void setCalculateAnimationCacheInBackground(bool value);
592 
593     QColor defaultAssistantsColor(bool defaultValue = false) const;
594     void setDefaultAssistantsColor(const QColor &color) const;
595 
596     bool autoSmoothBezierCurves(bool defaultValue = false) const;
597     void setAutoSmoothBezierCurves(bool value);
598 
599     bool activateTransformToolAfterPaste(bool defaultValue = false) const;
600     void setActivateTransformToolAfterPaste(bool value);
601 
602     enum RootSurfaceFormat {
603         BT709_G22 = 0,
604         BT709_G10,
605         BT2020_PQ
606     };
607     RootSurfaceFormat rootSurfaceFormat(bool defaultValue = false) const;
608     void setRootSurfaceFormat(RootSurfaceFormat value);
609 
610     static RootSurfaceFormat rootSurfaceFormat(QSettings *displayrc, bool defaultValue = false);
611     static void setRootSurfaceFormat(QSettings *displayrc, RootSurfaceFormat value);
612 
613     bool useZip64(bool defaultValue = false) const;
614     void setUseZip64(bool value);
615 
616     bool convertLayerColorSpaceInProperties(bool defaultValue = false) const;
617     void setConvertLayerColorSpaceInProperties(bool value);
618 
619     template<class T>
writeEntry(const QString & name,const T & value)620     void writeEntry(const QString& name, const T& value) {
621         m_cfg.writeEntry(name, value);
622     }
623 
624     template<class T>
writeList(const QString & name,const QList<T> & value)625     void writeList(const QString& name, const QList<T>& value) {
626         m_cfg.writeEntry(name, value);
627     }
628 
629     template<class T>
630     T readEntry(const QString& name, const T& defaultValue=T()) {
631         return m_cfg.readEntry(name, defaultValue);
632     }
633 
634     template<class T>
635     QList<T> readList(const QString& name, const QList<T>& defaultValue=QList<T>()) {
636         return m_cfg.readEntry(name, defaultValue);
637     }
638 
639 
640     /// get the profile the color management system has stored for the given screen
641     static const KoColorProfile* getScreenProfile(int screen);
642 
643 private:
644     KisConfig(const KisConfig&);
645     KisConfig& operator=(const KisConfig&) const;
646 
647 
648 private:
649     mutable KConfigGroup m_cfg;
650     bool m_readOnly;
651 };
652 
653 #endif // KIS_CONFIG_H_
654