00001 /* 00002 * GPLv2 zecke@handhelds.org 00003 * No WArranty... 00004 */ 00005 00006 #ifndef PHUNK_DIR_VIEW_H 00007 #define PHUNK_DIR_VIEW_H 00008 00009 #include <qmap.h> 00010 00011 #include <qpe/config.h> 00012 00013 class PInterfaceInfo; 00014 class PDirLister; 00015 class QWidget; 00016 00017 struct PDirView { 00018 PDirView( const Config& ); 00019 virtual ~PDirView(); 00020 virtual PInterfaceInfo* interfaceInfo()const = 0; 00021 virtual PDirLister* dirLister()const = 0; 00022 virtual QWidget* widget(QWidget*)=0; 00023 }; 00024 00025 typedef PDirView* (*phunkViewCreateFunc )(const Config& ); 00026 typedef QMap<QString,phunkViewCreateFunc> ViewMap; 00027 00028 ViewMap* viewMap(); 00029 PDirView* currentView(); 00030 void setCurrentView( PDirView* ); 00031 00032 00033 00034 #define PHUNK_VIEW_INTERFACE( NAME, IMPL ) \ 00035 static PDirView *create_ ## IMPL( const Config& cfg ) { \ 00036 return new IMPL( cfg ); \ 00037 } \ 00038 static ViewMap::Iterator dummy_ ## IMPL = viewMap()->insert( NAME, create_ ## IMPL ); 00039 00040 00041 00042 #endif
1.4.2