summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/iface/dirview.h
blob: 3c05b60a3bb7fddf3db5d5f515ad5fa939cd133c (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
/*
 * GPLv2 zecke@handhelds.org
 * No WArranty...
 */

#ifndef PHUNK_DIR_VIEW_H
#define PHUNK_DIR_VIEW_H

#include <qmap.h>

#include <qpe/config.h>

class PInterfaceInfo;
class PDirLister;
class QWidget;

struct PDirView {
    PDirView(  const Config& );
    virtual ~PDirView();
    virtual PInterfaceInfo* interfaceInfo()const = 0;
    virtual PDirLister* dirLister()const = 0;
    virtual QWidget* widget(QWidget*)=0;
};

typedef PDirView* (*phunkViewCreateFunc )(const Config& );
typedef QMap<QString,phunkViewCreateFunc> ViewMap;

ViewMap* viewMap();
PDirView* currentView();
void setCurrentView( PDirView* );



#define PHUNK_VIEW_INTERFACE( NAME, IMPL ) \
    static PDirView *create_ ## IMPL( const Config& cfg ) { \
        return new IMPL( cfg ); \
    }                                          \
    static ViewMap::Iterator dummy_ ## IMPL = viewMap()->insert( NAME, create_ ## IMPL );



#endif