~ubuntu-branches/ubuntu/feisty/kid3/feisty

« back to all changes in this revision

Viewing changes to kid3/formatconfig.h

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno
  • Date: 2004-04-29 02:11:57 UTC
  • Revision ID: james.westby@ubuntu.com-20040429021157-omrdcw8270prqiun
Tags: upstream-0.4
ImportĀ upstreamĀ versionĀ 0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * \file formatconfig.h
 
3
 * Format configuration.
 
4
 *
 
5
 * \b Project: Kid3
 
6
 * \author Urs Fleisch
 
7
 * \date 17 Sep 2003
 
8
 */
 
9
 
 
10
#ifndef FORMATCONFIG_H
 
11
#define FORMATCONFIG_H
 
12
 
 
13
#include "config.h"
 
14
#include "generalconfig.h"
 
15
#include <qmap.h>
 
16
 
 
17
#ifdef CONFIG_USE_KDE
 
18
class KConfig;
 
19
#else
 
20
class QSettings;
 
21
#endif
 
22
class QString;
 
23
class StandardTags;
 
24
 
 
25
class FormatConfig : public GeneralConfig
 
26
{
 
27
public:
 
28
        /** Case conversion options. */
 
29
        enum CaseConversion {
 
30
            NoChanges,
 
31
            AllLowercase,
 
32
            AllUppercase,
 
33
            FirstLetterUppercase,
 
34
            AllFirstLettersUppercase,
 
35
            NumCaseConversions
 
36
        };
 
37
        /**
 
38
         * Constructor.
 
39
         *
 
40
         * @param grp configuration group
 
41
         */
 
42
        FormatConfig(const QString &grp);
 
43
        /**
 
44
         * Destructor.
 
45
         */
 
46
        virtual ~FormatConfig();
 
47
        /**
 
48
         * Set specific properties for a filename format.
 
49
         * This will set default string conversions and not touch the file
 
50
         * extension when formatting.
 
51
         */
 
52
        void setAsFilenameFormatter();
 
53
        /**
 
54
         * Format a string using this configuration.
 
55
         *
 
56
         * @param str string to format
 
57
         */
 
58
        void formatString(QString& str) const;
 
59
        /**
 
60
         * Format title, artist and album using this configuration.
 
61
         *
 
62
         * @param st standard tags
 
63
         */
 
64
        void formatStandardTags(StandardTags& st) const;
 
65
        /**
 
66
         * Persist configuration.
 
67
         *
 
68
         * @param config KDE configuration
 
69
         */
 
70
        virtual void writeToConfig(
 
71
#ifdef CONFIG_USE_KDE
 
72
                KConfig *config
 
73
#else
 
74
                QSettings *config
 
75
#endif
 
76
                ) const;
 
77
        /**
 
78
         * Read persisted configuration.
 
79
         *
 
80
         * @param config KDE configuration
 
81
         */
 
82
        virtual void readFromConfig(
 
83
#ifdef CONFIG_USE_KDE
 
84
                KConfig *config
 
85
#else
 
86
                QSettings *config
 
87
#endif
 
88
                );
 
89
        /** Case conversion option */
 
90
        CaseConversion caseConversion;
 
91
        /** true if string replacement enabled */
 
92
        bool strRepEnabled;
 
93
        /** Mapping for string replacement */
 
94
        QMap<QString, QString> strRepMap;
 
95
private:
 
96
        /** true if it is a file formatter */
 
97
        bool filenameFormatter;
 
98
};
 
99
 
 
100
#endif