summaryrefslogtreecommitdiff
path: root/core/pim/datebook2/stringmanager.h
blob: 2eee43fbc0d87b39b69d691acf25a6ef5b712fda (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
#ifndef OPIE_STRING_DATEBOOK_MANAGER_H
#define OPIE_STRING_DATEBOOK_MANAGER_H

#include <qstring.h>

#include "managertemplate.h"

class QListView;
namespace Datebook {
    /**
     * StringManager is a generic manager
     * whick keeps track of strings
     * It'll be used with the Location
     * and the Description Manager
     */
    class StringManager : public ManagerTemplate<QString> {
    public:
        /**
         * baseName is used for storing
         */
        StringManager(const QString& baseName = QString::null);
        ~StringManager();

        /**
         * override the add implementation
         * cause we do not have a value :)
         */
        void add( const QString& );
        bool load();
        bool save();
        QString baseName()const;
    private:
        QString m_base;
    };

    /**
     * A Generic Editor for StringManager
     */
    class StringManagerDialog : public QDialog {
        Q_OBJECT
    public:
        StringManagerDialog( const StringManager&);
        ~StringManagerDialog();

        StringManager manager()const;
    private slots:
        void init( const StringManager&  );
        void slotAdd();
        void slotRemove();
        void slotRename();
    private:
        QListView* m_view;
        QString m_base;
    };
}

#endif