Canorus
0.7
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
settings.h
Go to the documentation of this file.
1
8
#ifndef SETTINGS_H_
9
#define SETTINGS_H_
10
11
#include <QSettings>
12
#ifndef SWIG
13
#include <QColor>
14
#endif
15
#include <QDir>
16
#include "
core/fileformats.h
"
17
#include "
core/typesetter.h
"
18
19
class
CASettings
:
public
QSettings
{
20
public
:
21
CASettings
(
QObject
* parent = 0 );
22
CASettings
(
const
QString & fileName,
QObject
* parent = 0 );
23
virtual
~CASettings
();
24
25
int
readSettings
();
26
void
writeSettings
();
27
28
static
const
QString
defaultSettingsPath
();
29
31
// Editor settings //
33
inline
bool
finaleLyricsBehaviour
() {
return
_finaleLyricsBehaviour
; }
34
inline
void
setFinaleLyricsBehaviour
(
bool
b ) {
_finaleLyricsBehaviour
= b; }
35
static
const
bool
DEFAULT_FINALE_LYRICS_BEHAVIOUR
;
36
inline
bool
shadowNotesInOtherStaffs
() {
return
_shadowNotesInOtherStaffs
; }
37
inline
void
setShadowNotesInOtherStaffs
(
bool
b ) {
_shadowNotesInOtherStaffs
= b; }
38
static
const
bool
DEFAULT_SHADOW_NOTES_IN_OTHER_STAFFS
;
39
inline
bool
playInsertedNotes
() {
return
_playInsertedNotes
; }
40
inline
void
setPlayInsertedNotes
(
bool
b ) {
_playInsertedNotes
= b; }
41
static
const
bool
DEFAULT_PLAY_INSERTED_NOTES
;
42
inline
bool
autoBar
() {
return
_autoBar
; }
43
inline
void
setAutoBar
(
bool
b ) {
_autoBar
= b; }
44
static
const
bool
DEFAULT_AUTO_BAR
;
45
47
// Loading/Saving settings //
49
inline
QDir
documentsDirectory
() {
return
_documentsDirectory
; }
50
inline
void
setDocumentsDirectory
( QDir d ) {
_documentsDirectory
= d; }
51
static
const
QDir
DEFAULT_DOCUMENTS_DIRECTORY
;
52
inline
CAFileFormats::CAFileFormatType
defaultSaveFormat
() {
return
_defaultSaveFormat
; }
53
inline
void
setDefaultSaveFormat
(
CAFileFormats::CAFileFormatType
t ) {
_defaultSaveFormat
= t; }
54
static
const
CAFileFormats::CAFileFormatType
DEFAULT_SAVE_FORMAT
;
55
inline
int
autoRecoveryInterval
() {
return
_autoRecoveryInterval
; }
56
inline
void
setAutoRecoveryInterval
(
int
interval ) {
_autoRecoveryInterval
= interval; };
57
static
const
int
DEFAULT_AUTO_RECOVERY_INTERVAL
;
58
inline
int
maxRecentDocuments
() {
return
_maxRecentDocuments
; }
59
inline
void
setMaxRecentDocuments
(
int
r ) {
_maxRecentDocuments
= r; }
60
static
const
int
DEFAULT_MAX_RECENT_DOCUMENTS
;
61
63
// Appearance settings //
65
#ifndef SWIG
66
static
const
bool
DEFAULT_ANTIALIASING
;
67
inline
bool
antiAliasing
() {
return
_antiAliasing
; }
68
inline
void
setAntiAliasing
(
bool
a ) {
_antiAliasing
= a; }
69
inline
QColor
backgroundColor
() {
return
_backgroundColor
; }
70
inline
void
setBackgroundColor
( QColor
backgroundColor
) {
_backgroundColor
=
backgroundColor
; }
71
static
const
QColor
DEFAULT_BACKGROUND_COLOR
;
72
inline
QColor
foregroundColor
() {
return
_foregroundColor
; }
73
inline
void
setForegroundColor
( QColor
foregroundColor
) {
_foregroundColor
=
foregroundColor
; }
74
static
const
QColor
DEFAULT_FOREGROUND_COLOR
;
75
inline
QColor
selectionColor
() {
return
_selectionColor
; }
76
inline
void
setSelectionColor
( QColor
selectionColor
) {
_selectionColor
=
selectionColor
; }
77
static
const
QColor
DEFAULT_SELECTION_COLOR
;
78
inline
QColor
selectionAreaColor
() {
return
_selectionAreaColor
; }
79
inline
void
setSelectionAreaColor
( QColor
selectionAreaColor
) {
_selectionAreaColor
=
selectionAreaColor
; }
80
static
const
QColor
DEFAULT_SELECTION_AREA_COLOR
;
81
inline
QColor
selectedContextColor
() {
return
_selectedContextColor
; }
82
inline
void
setSelectedContextColor
( QColor
selectedContextColor
) {
_selectedContextColor
=
selectedContextColor
; }
83
static
const
QColor
DEFAULT_SELECTED_CONTEXT_COLOR
;
84
inline
QColor
hiddenElementsColor
() {
return
_hiddenElementsColor
; }
85
inline
void
setDisabledElementsColor
( QColor
disabledElementsColor
) {
_disabledElementsColor
=
disabledElementsColor
; }
86
static
const
QColor
DEFAULT_HIDDEN_ELEMENTS_COLOR
;
87
inline
QColor
disabledElementsColor
() {
return
_disabledElementsColor
; }
88
inline
void
setHiddenElementsColor
( QColor
hiddenElementsColor
) {
_hiddenElementsColor
=
hiddenElementsColor
; }
89
static
const
QColor
DEFAULT_DISABLED_ELEMENTS_COLOR
;
90
#endif
91
93
// Playback settings //
95
inline
int
midiInPort
() {
return
_midiInPort
; }
96
void
setMidiInPort
(
int
in );
97
static
const
int
DEFAULT_MIDI_IN_PORT
;
98
inline
int
midiOutPort
() {
return
_midiOutPort
; }
99
inline
void
setMidiOutPort
(
int
out ) {
_midiOutPort
= out; }
100
static
const
int
DEFAULT_MIDI_OUT_PORT
;
101
103
// Printing settings //
105
inline
CATypesetter::CATypesetterType
typesetter
() {
return
_typesetter
; }
106
void
setTypesetter
(
CATypesetter::CATypesetterType
t ) {
_typesetter
= t; }
107
static
const
CATypesetter::CATypesetterType
DEFAULT_TYPESETTER
;
108
inline
QString
typesetterLocation
() {
return
_typesetterLocation
; }
109
void
setTypesetterLocation
( QString tl ) {
_typesetterLocation
= tl; }
110
static
const
QString
DEFAULT_TYPESETTER_LOCATION
;
111
inline
bool
useSystemDefaultTypesetter
() {
return
_useSystemDefaultTypesetter
; }
112
void
setUseSystemDefaultTypesetter
(
bool
s ) {
_useSystemDefaultTypesetter
= s; }
113
static
const
bool
DEFAULT_USE_SYSTEM_TYPESETTER
;
114
inline
QString
pdfViewerLocation
() {
return
_pdfViewerLocation
; }
115
void
setPdfViewerLocation
( QString pl ) {
_pdfViewerLocation
= pl; }
116
static
const
QString
DEFAULT_PDF_VIEWER_LOCATION
;
117
inline
bool
useSystemDefaultPdfViewer
() {
return
_useSystemDefaultPdfViewer
; }
118
void
setUseSystemDefaultPdfViewer
(
bool
s ) {
_useSystemDefaultPdfViewer
= s; }
119
static
const
bool
DEFAULT_USE_SYSTEM_PDF_VIEWER
;
120
121
private
:
122
#ifndef SWIG
123
void
writeRecentDocuments
();
124
void
readRecentDocuments
();
125
#endif
126
128
// Editor settings //
130
bool
_finaleLyricsBehaviour
;
131
bool
_shadowNotesInOtherStaffs
;
132
bool
_playInsertedNotes
;
133
bool
_autoBar
;
134
136
// Loading/Saving settings //
138
QDir
_documentsDirectory
;
// location of directory automatically opened when File->Open is selected
139
CAFileFormats::CAFileFormatType
_defaultSaveFormat
;
140
int
_autoRecoveryInterval
;
// auto recovery interval in minutes
141
int
_maxRecentDocuments
;
// number of stored recently opened files
142
144
// Appearance settings //
146
#ifndef SWIG
147
bool
_antiAliasing
;
148
QColor
_backgroundColor
;
149
QColor
_foregroundColor
;
150
QColor
_selectionColor
;
151
QColor
_selectionAreaColor
;
152
QColor
_selectedContextColor
;
153
QColor
_hiddenElementsColor
;
154
QColor
_disabledElementsColor
;
155
#endif
156
157
// Playback settings //
159
int
_midiOutPort
;
// -1 disabled, 0+ port number
160
int
_midiInPort
;
// -1 disabled, 0+ port number
161
163
// Printing settings //
165
CATypesetter::CATypesetterType
_typesetter
;
166
QString
_typesetterLocation
;
167
bool
_useSystemDefaultTypesetter
;
168
QString
_pdfViewerLocation
;
169
bool
_useSystemDefaultPdfViewer
;
170
};
171
172
#endif
/* SETTINGS_H_ */
Generated on Fri Jan 11 2013 14:40:12 for Canorus by
1.8.3