File: pref.h

package info (click to toggle)
kaquarium 1.0-beta-6.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,944 kB
  • ctags: 313
  • sloc: sh: 17,170; perl: 2,724; cpp: 1,340; makefile: 116
file content (112 lines) | stat: -rw-r--r-- 2,685 bytes parent folder | download | duplicates (3)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#ifndef __PREF_H__
#define __PREF_H__

#include <qobject.h>
#include <qdict.h>
#include <qstring.h>
#include <qstringlist.h>

#include <kdebug.h>

class KConfig;
class desktopInfo;
class configDlg;

typedef struct {
    QString name;
    QString file;
    int w;
    int h;
    int numofanim;
    Qt::Orientation orientation;
} fishInfoStr;

class fishInfo
{
public:
    fishInfo(QString name, QString file, int w, int h, int numofanim, Qt::Orientation orie)
            : m_name(name), m_file(file), m_w(w)
            , m_h(h), m_numofanim(numofanim), m_orie(orie)
    { };
    ~fishInfo()
    { kdDebug(1210) << "Delete fishInfo!" << m_name << endl; };
    
private:
    QString m_name, m_file;
    int m_w, m_h, m_numofanim;
    Qt::Orientation m_orie;
};

class kfishPref : public QObject
{
    Q_OBJECT
public:
    enum fishAnimations { None = 0, Mouse, Timer };

    static kfishPref *prefs();
    
    void load();
    void write();
    
    int getFishNumber() const { return m_fishNumber; };
    int getBubblesNumber() const { return m_numBubble; };
    int getWidth() const { return m_widthSpace; };
    int getFishScale() const { return m_fishScale; };
    bool getFishSel() const { return m_fishSel; };
    bool getFishRan() const { return m_fishRan; };
    QDict<QString> getFishSelected() { return m_fishSelNum; };
    fishInfoStr* getFishInfo();
    
    int getPanelHeight() const { return m_height; };
    int getPanelWidth() const { return m_width; };
    Orientation getOrientation() const { return m_panelOrientation; };

    void setFishNumber(int num) { m_fishNumber = num; };
    void setBubbleNumber(int num) { m_numBubble = num; };
    void setWidth(int width ) { m_widthSpace = width; };
    void setFishScale(int scale) { m_fishScale = scale; };
    void setFishSel(bool sel) { m_fishSel = sel; };
    void setFishRan(bool ran) { m_fishRan = ran; };
    void setFishSelected(QDict<QString> fishSel) 
        {
            m_fishSelNum. clear();
            m_fishSelNum = fishSel;
        };
    
    void setPanelWidth( int w ) { m_width = w; };
    void setPanelHeight( int h ) { if (h > 1) m_height = h; };
    void setOrientation( Orientation type ) { m_panelOrientation = type; };

    void emitChangePref();

signals:
    void changePref();
    
private:

    kfishPref();
    ~kfishPref();

    static kfishPref *s_prefs;
    
    // MAIN
    int m_numBubble; 
    int m_widthSpace;
    int m_fishScale;
    
    //FISHES
    bool m_fishSel;
    bool m_fishRan;
    int m_fishNumber;    
    QDict<QString> m_fishSelNum;
    
    // PANEL STUFF
    int m_width;
    int m_height;
    Orientation m_panelOrientation;

    KConfig *config;
};


#endif