~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to noatun/noatun/modules/kjofol-skin/parser.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef PARSER_H
 
2
#define PARSER_H
 
3
 
 
4
#include <qstringlist.h>
 
5
#include <qfile.h>
 
6
#include <qpixmap.h>
 
7
#include <qimage.h>
 
8
#include <qdict.h>
 
9
 
 
10
class Parser : public QDict<QStringList>
 
11
{
 
12
        class ImagePixmap
 
13
        {
 
14
        public:
 
15
                ImagePixmap() : mImage(0), mPixmap(0) {}
 
16
                ~ImagePixmap() {}
 
17
                QImage mImage;
 
18
                QPixmap mPixmap;
 
19
        };
 
20
                
 
21
public:
 
22
        Parser();
 
23
        void conserveMemory();
 
24
        void open(const QString &file);
 
25
        
 
26
        QString dir() const;
 
27
        QPixmap pixmap(const QString &i) const
 
28
                { return getPair(i)->mPixmap; }
 
29
        QImage image(const QString &i) const
 
30
                { return getPair(i)->mImage; }
 
31
 
 
32
        QString fileItem(const QString &file) const;
 
33
 
 
34
        bool exist(const QString &i) const;
 
35
        
 
36
public:
 
37
        QStringList& operator[](const QString &l) { return *find(l);}
 
38
        
 
39
private:
 
40
        ImagePixmap *getPair(const QString &i) const;
 
41
 
 
42
private:
 
43
        mutable QDict<ImagePixmap> mImageCache;
 
44
        QString mDir;   
 
45
};
 
46
 
 
47
#endif
 
48