Diffstat (limited to 'noncore/graphics/opie-eye/iface') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/iface/dirlister.cpp | 9 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/iface/dirlister.h | 47 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/iface/dirview.cpp | 9 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/iface/dirview.h | 40 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/iface/ifaceinfo.h | 19 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/iface/slaveiface.h | 47 |
6 files changed, 171 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/iface/dirlister.cpp b/noncore/graphics/opie-eye/iface/dirlister.cpp new file mode 100644 index 0000000..7cf4361 --- a/dev/null +++ b/noncore/graphics/opie-eye/iface/dirlister.cpp | |||
@@ -0,0 +1,9 @@ | |||
1 | #include "dirlister.h" | ||
2 | |||
3 | |||
4 | PDirLister::PDirLister( const char* name ) | ||
5 | : QObject( 0, name ) | ||
6 | {} | ||
7 | |||
8 | PDirLister::~PDirLister() | ||
9 | {} | ||
diff --git a/noncore/graphics/opie-eye/iface/dirlister.h b/noncore/graphics/opie-eye/iface/dirlister.h new file mode 100644 index 0000000..fcc55ec --- a/dev/null +++ b/noncore/graphics/opie-eye/iface/dirlister.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * GPLv2 zecke@handhelds.org | ||
3 | * No WArranty... | ||
4 | */ | ||
5 | |||
6 | #ifndef PHUNK_DIR_LISTER_H | ||
7 | #define PHUNK_DIR_LISTER_H | ||
8 | |||
9 | #include <qobject.h> | ||
10 | #include <qstring.h> | ||
11 | #include <qstringlist.h> | ||
12 | |||
13 | |||
14 | class PDirLister : public QObject { | ||
15 | Q_OBJECT | ||
16 | public: | ||
17 | enum Factor { Width, Height, None }; | ||
18 | |||
19 | PDirLister( const char* name ); | ||
20 | |||
21 | virtual QString defaultPath()const = 0; | ||
22 | virtual QString setStartPath( const QString& ) = 0; | ||
23 | virtual QString currentPath()const = 0; | ||
24 | virtual QStringList folders()const = 0; | ||
25 | virtual QStringList files()const = 0; | ||
26 | public slots: | ||
27 | virtual void deleteImage( const QString& ) = 0; | ||
28 | virtual void imageInfo( const QString&) = 0; | ||
29 | virtual void fullImageInfo( const QString& ) = 0; | ||
30 | virtual void thumbNail( const QString&, int max_wid, int max_h ) = 0; | ||
31 | virtual QImage image( const QString&, Factor, int max = 0) = 0; | ||
32 | |||
33 | signals: | ||
34 | void sig_dirchanged(); | ||
35 | void sig_filechanged(); | ||
36 | void sig_start(); | ||
37 | void sig_end(); | ||
38 | // If this app ever happens to get multithreaded... | ||
39 | void sig_thumbInfo( const QString&, const QString& ); | ||
40 | void sig_fullInfo( const QString&, const QString& ); | ||
41 | void sig_thumbNail( const QString&, const QPixmap& ); | ||
42 | |||
43 | protected: | ||
44 | ~PDirLister(); | ||
45 | }; | ||
46 | |||
47 | #endif | ||
diff --git a/noncore/graphics/opie-eye/iface/dirview.cpp b/noncore/graphics/opie-eye/iface/dirview.cpp new file mode 100644 index 0000000..c3d1e86 --- a/dev/null +++ b/noncore/graphics/opie-eye/iface/dirview.cpp | |||
@@ -0,0 +1,9 @@ | |||
1 | #include "dirview.h" | ||
2 | |||
3 | PDirView::PDirView( const Config& ) { | ||
4 | |||
5 | } | ||
6 | |||
7 | PDirView::~PDirView() { | ||
8 | |||
9 | } | ||
diff --git a/noncore/graphics/opie-eye/iface/dirview.h b/noncore/graphics/opie-eye/iface/dirview.h new file mode 100644 index 0000000..20d9062 --- a/dev/null +++ b/noncore/graphics/opie-eye/iface/dirview.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * GPLv2 zecke@handhelds.org | ||
3 | * No WArranty... | ||
4 | */ | ||
5 | |||
6 | #ifndef PHUNK_DIR_VIEW_H | ||
7 | #define PHUNK_DIR_VIEW_H | ||
8 | |||
9 | #include <qmap.h> | ||
10 | |||
11 | #include <qpe/config.h> | ||
12 | |||
13 | class PInterfaceInfo; | ||
14 | class PDirLister; | ||
15 | |||
16 | struct PDirView { | ||
17 | PDirView( const Config& ); | ||
18 | virtual ~PDirView(); | ||
19 | virtual PInterfaceInfo* interfaceInfo()const = 0; | ||
20 | virtual PDirLister* dirLister()const = 0; | ||
21 | }; | ||
22 | |||
23 | typedef PDirView* (*phunkViewCreateFunc )(const Config& ); | ||
24 | typedef QMap<QString,phunkViewCreateFunc> ViewMap; | ||
25 | |||
26 | ViewMap* viewMap(); | ||
27 | PDirView* currentView(); | ||
28 | void setCurrentView( PDirView* ); | ||
29 | |||
30 | |||
31 | |||
32 | #define PHUNK_VIEW_INTERFACE( NAME, IMPL ) \ | ||
33 | static PDirView *create_ ## IMPL( const Config& cfg ) { \ | ||
34 | return new IMPL( cfg ); \ | ||
35 | } \ | ||
36 | static ViewMap::Iterator dummy_ ## IMPL = viewMap()->insert( NAME, create_ ## IMPL ); | ||
37 | |||
38 | |||
39 | |||
40 | #endif | ||
diff --git a/noncore/graphics/opie-eye/iface/ifaceinfo.h b/noncore/graphics/opie-eye/iface/ifaceinfo.h new file mode 100644 index 0000000..74e0db6 --- a/dev/null +++ b/noncore/graphics/opie-eye/iface/ifaceinfo.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * GPLv2 zecke@handhelds.org | ||
3 | * No WArranty... | ||
4 | */ | ||
5 | |||
6 | #ifndef PHUNK_INTERFACE_INFO_H | ||
7 | #define PHUNK_INTERFACE_INFO_H | ||
8 | |||
9 | #include <qstring.h> | ||
10 | |||
11 | class QWidget; | ||
12 | class Config; | ||
13 | struct PInterfaceInfo { | ||
14 | virtual QString name()const = 0; | ||
15 | virtual QWidget* configWidget( const Config& ) = 0; | ||
16 | virtual void writeConfig( QWidget* wid, Config& ) = 0; | ||
17 | }; | ||
18 | |||
19 | #endif | ||
diff --git a/noncore/graphics/opie-eye/iface/slaveiface.h b/noncore/graphics/opie-eye/iface/slaveiface.h new file mode 100644 index 0000000..e1ecf1f --- a/dev/null +++ b/noncore/graphics/opie-eye/iface/slaveiface.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | *GPLv2 | ||
3 | */ | ||
4 | |||
5 | #ifndef SLAVE_INTERFACE_H | ||
6 | #define SLAVE_INTERFACE_H | ||
7 | |||
8 | #include <qpixmap.h> | ||
9 | #include <qstring.h> | ||
10 | |||
11 | /** | ||
12 | * The Data Packets we use | ||
13 | */ | ||
14 | |||
15 | struct ImageInfo { | ||
16 | ImageInfo() : kind(false){} | ||
17 | bool operator==( const ImageInfo other ) { | ||
18 | if ( kind != other.kind ) return false; | ||
19 | if ( file != other.file ) return false; | ||
20 | return true; | ||
21 | } | ||
22 | bool kind; | ||
23 | QString file; | ||
24 | QString info; | ||
25 | }; | ||
26 | |||
27 | struct PixmapInfo { | ||
28 | PixmapInfo() : width( -1 ), height( -1 ) {} | ||
29 | bool operator==( const PixmapInfo& r ) { | ||
30 | if ( width != r.width ) return false; | ||
31 | if ( height != r.height ) return false; | ||
32 | if ( file != r.file ) return false; | ||
33 | return true; | ||
34 | } | ||
35 | int width, height; | ||
36 | QString file; | ||
37 | QPixmap pixmap; | ||
38 | }; | ||
39 | |||
40 | |||
41 | /* | ||
42 | * Image Infos | ||
43 | */ | ||
44 | |||
45 | |||
46 | |||
47 | #endif | ||