summaryrefslogtreecommitdiff
path: root/libopie/ofileselector/opixmapprovider.h
blob: 2165fdb85dd4a2610149a5631e85f7e0c73df0ca (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
#ifndef OPIE_PIXMPAP_PROVIDER
#define OPIE_PIXMPAP_PROVIDER

#include <qpixmap.h>

#include "ofileselector.h"

/**
 * This is a basic interface for a Pixmap provider
 * it provides pixmaps for a URL
 * So the OLocalLister provides mimetype icons
 */
class QFileInfo;
class OPixmapProvider {
public:
    /* you can or these
     * but File | Dir would be insane ;)
     */
    enum Type { File = 0,  Dir = 1,  Symlink = 2 };
    OPixmapProvider( OFileSelector* sel );
    virtual ~OPixmapProvider();

    virtual QPixmap pixmap( int t, const QString& mime, QFileInfo*,
                            bool isLocked = FALSE );
    virtual QPixmap pixmap( int t, const QString& mime,
                            const QString& dir, const QString& file,
                            bool isLocked = FALSE );

protected:
    OFileSelector* selector();
private:
    QPixmap file( QFileInfo*,
                  bool sym, bool is );
    QPixmap dir ( QFileInfo*,
                  bool sym, bool is );
    QPixmap sym ( QFileInfo*,
                  bool is );
    OFileSelector* m_sel;
};

#endif