~ubuntu-branches/ubuntu/wily/kid3/wily-proposed

« back to all changes in this revision

Viewing changes to kid3/miscconfig.h

  • Committer: Package Import Robot
  • Author(s): Ana Beatriz Guerrero Lopez, Patrick Matthäi, Ana Beatriz Guerrero Lopez
  • Date: 2011-11-13 16:34:13 UTC
  • mfrom: (1.1.13) (2.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20111113163413-5y0anlc4dqf511uh
Tags: 2.0.1-1
* New upstream release.

[ Patrick Matthäi ]
* Adjust build system.
* Add build dependency xsltproc.

[ Ana Beatriz Guerrero Lopez ]
* Some more adjustments to the build system taken from upstream's deb/
* directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * \file miscconfig.h
3
 
 * Miscellaneous Configuration.
4
 
 *
5
 
 * \b Project: Kid3
6
 
 * \author Urs Fleisch
7
 
 * \date 17 Jan 2004
8
 
 *
9
 
 * Copyright (C) 2004-2007  Urs Fleisch
10
 
 *
11
 
 * This file is part of Kid3.
12
 
 *
13
 
 * Kid3 is free software; you can redistribute it and/or modify
14
 
 * it under the terms of the GNU General Public License as published by
15
 
 * the Free Software Foundation; either version 2 of the License, or
16
 
 * (at your option) any later version.
17
 
 *
18
 
 * Kid3 is distributed in the hope that it will be useful,
19
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 
 * GNU General Public License for more details.
22
 
 *
23
 
 * You should have received a copy of the GNU General Public License
24
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
25
 
 */
26
 
 
27
 
#ifndef MISCCONFIG_H
28
 
#define MISCCONFIG_H
29
 
 
30
 
#include <qstringlist.h>
31
 
#include "qtcompatmac.h"
32
 
#if QT_VERSION >= 0x040000
33
 
#include <QList>
34
 
#else
35
 
#include <qvaluelist.h>
36
 
#endif
37
 
#include "config.h"
38
 
#include "generalconfig.h"
39
 
 
40
 
class QString;
41
 
 
42
 
/**
43
 
 * Miscellaneous Configuration.
44
 
 */
45
 
class MiscConfig : public GeneralConfig
46
 
{
47
 
public:
48
 
        /** The ID3v2 version used for new tags. */
49
 
        enum Id3v2Version {
50
 
                ID3v2_3_0 = 0,
51
 
                ID3v2_4_0 = 1
52
 
        };
53
 
 
54
 
        /** Encoding used for ID3v2 frames. */
55
 
        enum TextEncoding {
56
 
                TE_ISO8859_1,
57
 
                TE_UTF16,
58
 
                TE_UTF8
59
 
        };
60
 
 
61
 
        /** Name for Vorbis picture. */
62
 
        enum VorbisPictureName {
63
 
                VP_METADATA_BLOCK_PICTURE,
64
 
                VP_COVERART
65
 
        };
66
 
 
67
 
        /**
68
 
         * External command in context menu.
69
 
         */
70
 
        class MenuCommand {
71
 
        public:
72
 
                /**
73
 
                 * Constructor.
74
 
                 *
75
 
                 * @param name display name
76
 
                 * @param cmd  command string with argument codes
77
 
                 * @param confirm true if confirmation required
78
 
                 * @param showOutput true if output of command shall be shown
79
 
                 */
80
 
                explicit MenuCommand(const QString& name = QString::null,
81
 
                                                                                                 const QString& cmd = QString::null,
82
 
                                                                                                 bool confirm = false, bool showOutput = false);
83
 
 
84
 
                /**
85
 
                 * Constructor.
86
 
                 *
87
 
                 * @param strList string list with encoded command
88
 
                 */
89
 
                explicit MenuCommand(const QStringList& strList);
90
 
 
91
 
                /**
92
 
                 * Encode into string list.
93
 
                 *
94
 
                 * @return string list with encoded command.
95
 
                 */
96
 
                QStringList toStringList() const;
97
 
 
98
 
                /**
99
 
                 * Get the display name.
100
 
                 * @return name.
101
 
                 */
102
 
                const QString& getName() const { return m_name; }
103
 
 
104
 
                /**
105
 
                 * Get the command string.
106
 
                 * @return command string.
107
 
                 */
108
 
                const QString& getCommand() const { return m_cmd; }
109
 
 
110
 
                /**
111
 
                 * Check if command must be confirmed.
112
 
                 * @return true if command has to be confirmed.
113
 
                 */
114
 
                bool mustBeConfirmed() const { return m_confirm; }
115
 
 
116
 
                /**
117
 
                 * Check if command output has to be shown.
118
 
                 * @return true if command output has to be shown.
119
 
                 */
120
 
                bool outputShown() const { return m_showOutput; }
121
 
 
122
 
        private:
123
 
                QString m_name;
124
 
                QString m_cmd;
125
 
                bool m_confirm;
126
 
                bool m_showOutput;
127
 
        };
128
 
 
129
 
        /**
130
 
         * Constructor.
131
 
         */
132
 
        MiscConfig(const QString& group);
133
 
 
134
 
        /**
135
 
         * Destructor.
136
 
         */
137
 
        virtual ~MiscConfig();
138
 
 
139
 
        /**
140
 
         * Persist configuration.
141
 
         *
142
 
         * @param config KDE configuration
143
 
         */
144
 
        void writeToConfig(
145
 
#ifdef CONFIG_USE_KDE
146
 
                KConfig* config
147
 
#else
148
 
                Kid3Settings* config
149
 
#endif
150
 
                ) const;
151
 
 
152
 
        /**
153
 
         * Read persisted configuration.
154
 
         *
155
 
         * @param config KDE configuration
156
 
         */
157
 
        void readFromConfig(
158
 
#ifdef CONFIG_USE_KDE
159
 
                KConfig* config
160
 
#else
161
 
                Kid3Settings* config
162
 
#endif
163
 
                );
164
 
 
165
 
        /** true to mark truncated ID3v1.1 fields */
166
 
        bool m_markTruncations;
167
 
        /** true to write total number of tracks into track fields */
168
 
        bool m_enableTotalNumberOfTracks;
169
 
        /** true to write genres as text instead of numeric string */
170
 
        bool m_genreNotNumeric;
171
 
        /** true to preserve file time stamps */
172
 
        bool m_preserveTime;
173
 
        /** true to mark changed fields */
174
 
        bool m_markChanges;
175
 
        /** field name used for Vorbis comment entries */
176
 
        QString m_commentName;
177
 
        /** index of field name used for Vorbis picture entries */
178
 
        int m_pictureNameItem;
179
 
        /** filter of file names to be opened */
180
 
        QString m_nameFilter;
181
 
        /** filename format */
182
 
        QString m_formatText;
183
 
        /** index of filename format selected */
184
 
        int m_formatItem;
185
 
        /** filename formats */
186
 
        QStringList m_formatItems;
187
 
        /** from filename format */
188
 
        QString m_formatFromFilenameText;
189
 
        /** index of from filename format selected */
190
 
        int m_formatFromFilenameItem;
191
 
        /** from filename formats */
192
 
        QStringList m_formatFromFilenameItems;
193
 
        /** directory name format */
194
 
        QString m_dirFormatText;
195
 
        /** index of directory name format selected */
196
 
        int m_dirFormatItem;
197
 
        /** rename directory from tags 1, tags 2, or both */
198
 
        int m_renDirSrc;
199
 
        /** number tracks in tags 1, tags 2, or both */
200
 
        int m_numberTracksDst;
201
 
        /** number tracks start number */
202
 
        int m_numberTracksStart;
203
 
#if QT_VERSION >= 0x040000
204
 
        /** List of splitter sizes. */
205
 
        typedef QList<int> SizesList;
206
 
        /** List of menu commands */
207
 
        typedef QList<MenuCommand> MenuCommandList;
208
 
#else
209
 
        /** List of splitter sizes. */
210
 
        typedef QValueList<int> SizesList;
211
 
        /** List of menu commands */
212
 
        typedef QValueList<MenuCommand> MenuCommandList;
213
 
#endif
214
 
        /** size of splitter in main window */
215
 
        SizesList m_splitterSizes;
216
 
        /** size of file/dirlist splitter */
217
 
        SizesList m_vSplitterSizes;
218
 
        /** commands available in context menu */
219
 
        MenuCommandList m_contextMenuCommands;
220
 
        /** custom genres for ID3v2.3 */
221
 
        QStringList m_customGenres;
222
 
#ifndef CONFIG_USE_KDE
223
 
#if QT_VERSION >= 0x040000
224
 
        /** true to hide toolbar */
225
 
        bool m_hideToolBar;
226
 
#endif
227
 
        /** true to hide statusbar */
228
 
        bool m_hideStatusBar;
229
 
#endif
230
 
        /** true to automatically hide unused tags */
231
 
        bool m_autoHideTags;
232
 
        /** true to hide file controls */
233
 
        bool m_hideFile;
234
 
        /** true to hide ID3v1.1 controls */
235
 
        bool m_hideV1;
236
 
        /** true to hide ID3v2.3 controls */
237
 
        bool m_hideV2;
238
 
        /** true to hide picture preview */
239
 
        bool m_hidePicture;
240
 
        /** version used for new ID3v2 tags */
241
 
        int m_id3v2Version;
242
 
        /** text encoding used for new ID3v1 tags */
243
 
        QString m_textEncodingV1;
244
 
        /** text encoding used for new ID3v2 tags */
245
 
        int m_textEncoding;
246
 
        /** number of digits in track number */
247
 
        int m_trackNumberDigits;
248
 
        /** true if proxy is used */
249
 
        bool m_useProxy;
250
 
        /** proxy used for access */
251
 
        QString m_proxy;
252
 
#if QT_VERSION >= 0x040000
253
 
        /** true to use proxy authentication */
254
 
        bool m_useProxyAuthentication;
255
 
        /** proxy user name */
256
 
        QString m_proxyUserName;
257
 
        /** proxy password */
258
 
        QString m_proxyPassword;
259
 
#endif
260
 
        /** web browser substituted for %b */
261
 
        QString m_browser;
262
 
        /** true to show only custom genres in combo boxes */
263
 
        bool m_onlyCustomGenres;
264
 
#ifndef CONFIG_USE_KDE
265
 
#if QT_VERSION >= 0x040200
266
 
        /** mainwindow geometry */
267
 
        QByteArray m_geometry;
268
 
        /** mainwindow state */
269
 
        QByteArray m_windowState;
270
 
#else
271
 
        /** mainwindow x-position */
272
 
        int m_windowX;
273
 
        /** mainwindow y-position */
274
 
        int m_windowY;
275
 
        /** mainwindow width */
276
 
        int m_windowWidth;
277
 
        /** mainwindow height */
278
 
        int m_windowHeight;
279
 
#endif
280
 
        /** true if custom application font is used */
281
 
        bool m_useFont;
282
 
        /** custom application font family */
283
 
        QString m_fontFamily;
284
 
        /** custom application font size */
285
 
        int m_fontSize;
286
 
        /** custom application style, empty if not used */
287
 
        QString m_style;
288
 
#endif
289
 
 
290
 
        /** Default value for comment name */
291
 
        static const char* const s_defaultCommentName;
292
 
        /** Default value for web browser */
293
 
        static const char* const s_defaultBrowser;
294
 
        /** Default filename format list */
295
 
        static const char** s_defaultFnFmtList;
296
 
        /** Default directory format list */
297
 
        static const char** s_defaultDirFmtList;
298
 
};
299
 
 
300
 
#endif