Diffstat (limited to 'noncore/graphics/opie-eye/iface') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/iface/dirlister.cpp | 13 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/iface/dirlister.h | 6 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/iface/iface.pro | 7 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/iface/ifaceinfo.h | 2 |
4 files changed, 26 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/iface/dirlister.cpp b/noncore/graphics/opie-eye/iface/dirlister.cpp index 7cf4361..e0ae63b 100644 --- a/noncore/graphics/opie-eye/iface/dirlister.cpp +++ b/noncore/graphics/opie-eye/iface/dirlister.cpp | |||
@@ -1,9 +1,22 @@ | |||
1 | #include "dirlister.h" | 1 | #include "dirlister.h" |
2 | 2 | ||
3 | #include <qdir.h> | ||
3 | 4 | ||
4 | PDirLister::PDirLister( const char* name ) | 5 | PDirLister::PDirLister( const char* name ) |
5 | : QObject( 0, name ) | 6 | : QObject( 0, name ) |
6 | {} | 7 | {} |
7 | 8 | ||
8 | PDirLister::~PDirLister() | 9 | PDirLister::~PDirLister() |
9 | {} | 10 | {} |
11 | |||
12 | /** | ||
13 | * Change dir one level up. The default implementation | ||
14 | * is to use QDir to change the dir. | ||
15 | * If you've a flat filesystem return \par path immediately. | ||
16 | */ | ||
17 | QString PDirLister::dirUp( const QString& path )const { | ||
18 | QDir dir( path ); | ||
19 | dir.cdUp(); | ||
20 | |||
21 | return dir.absPath(); | ||
22 | } | ||
diff --git a/noncore/graphics/opie-eye/iface/dirlister.h b/noncore/graphics/opie-eye/iface/dirlister.h index 9c7b2a9..68e8495 100644 --- a/noncore/graphics/opie-eye/iface/dirlister.h +++ b/noncore/graphics/opie-eye/iface/dirlister.h | |||
@@ -2,47 +2,51 @@ | |||
2 | * GPLv2 zecke@handhelds.org | 2 | * GPLv2 zecke@handhelds.org |
3 | * No WArranty... | 3 | * No WArranty... |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #ifndef PHUNK_DIR_LISTER_H | 6 | #ifndef PHUNK_DIR_LISTER_H |
7 | #define PHUNK_DIR_LISTER_H | 7 | #define PHUNK_DIR_LISTER_H |
8 | 8 | ||
9 | #include <qobject.h> | 9 | #include <qobject.h> |
10 | #include <qstring.h> | 10 | #include <qstring.h> |
11 | #include <qstringlist.h> | 11 | #include <qstringlist.h> |
12 | 12 | ||
13 | 13 | ||
14 | class PDirLister : public QObject { | 14 | class PDirLister : public QObject { |
15 | Q_OBJECT | 15 | Q_OBJECT |
16 | public: | 16 | public: |
17 | enum Factor { Width, Height, None }; | 17 | enum Factor { Width, Height, None }; |
18 | 18 | ||
19 | PDirLister( const char* name ); | 19 | PDirLister( const char* name ); |
20 | 20 | ||
21 | virtual QString defaultPath()const = 0; | 21 | virtual QString defaultPath()const = 0; |
22 | virtual QString setStartPath( const QString& ) = 0; | 22 | virtual QString setStartPath( const QString& ) = 0; |
23 | virtual QString currentPath()const = 0; | 23 | virtual QString currentPath()const = 0; |
24 | virtual QStringList folders()const = 0; | 24 | virtual QStringList folders()const = 0; |
25 | virtual QStringList files()const = 0; | 25 | virtual QStringList files()const = 0; |
26 | virtual QString nameToFname(const QString&name)const = 0; | ||
27 | virtual QString dirUp(const QString&)const ; | ||
28 | |||
29 | |||
26 | public slots: | 30 | public slots: |
27 | virtual void deleteImage( const QString& ) = 0; | 31 | virtual void deleteImage( const QString& ) = 0; |
28 | virtual void imageInfo( const QString&) = 0; | 32 | virtual void imageInfo( const QString&) = 0; |
29 | virtual void fullImageInfo( const QString& ) = 0; | 33 | virtual void fullImageInfo( const QString& ) = 0; |
30 | virtual void thumbNail( const QString&, int max_wid, int max_h ) = 0; | 34 | virtual void thumbNail( const QString&, int max_wid, int max_h ) = 0; |
31 | virtual QImage image( const QString&, Factor, int max = 0) = 0; | 35 | virtual QImage image( const QString&, Factor, int max = 0) = 0; |
32 | virtual QString nameToFname(const QString&name)const = 0; | 36 | |
33 | 37 | ||
34 | signals: | 38 | signals: |
35 | void sig_dirchanged(); | 39 | void sig_dirchanged(); |
36 | void sig_filechanged(); | 40 | void sig_filechanged(); |
37 | void sig_start(); | 41 | void sig_start(); |
38 | void sig_end(); | 42 | void sig_end(); |
39 | // If this app ever happens to get multithreaded... | 43 | // If this app ever happens to get multithreaded... |
40 | void sig_thumbInfo( const QString&, const QString& ); | 44 | void sig_thumbInfo( const QString&, const QString& ); |
41 | void sig_fullInfo( const QString&, const QString& ); | 45 | void sig_fullInfo( const QString&, const QString& ); |
42 | void sig_thumbNail( const QString&, const QPixmap& ); | 46 | void sig_thumbNail( const QString&, const QPixmap& ); |
43 | 47 | ||
44 | protected: | 48 | protected: |
45 | virtual ~PDirLister(); | 49 | virtual ~PDirLister(); |
46 | }; | 50 | }; |
47 | 51 | ||
48 | #endif | 52 | #endif |
diff --git a/noncore/graphics/opie-eye/iface/iface.pro b/noncore/graphics/opie-eye/iface/iface.pro new file mode 100644 index 0000000..2ec499a --- a/dev/null +++ b/noncore/graphics/opie-eye/iface/iface.pro | |||
@@ -0,0 +1,7 @@ | |||
1 | HEADERS += iface/dirlister.h \ | ||
2 | iface/dirview.h \ | ||
3 | iface/ifaceinfo.h \ | ||
4 | iface/slaveiface.h | ||
5 | |||
6 | SOURCES += iface/dirlister.cpp \ | ||
7 | iface/dirview.cpp | ||
diff --git a/noncore/graphics/opie-eye/iface/ifaceinfo.h b/noncore/graphics/opie-eye/iface/ifaceinfo.h index 74e0db6..3af2fce 100644 --- a/noncore/graphics/opie-eye/iface/ifaceinfo.h +++ b/noncore/graphics/opie-eye/iface/ifaceinfo.h | |||
@@ -1,19 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | * GPLv2 zecke@handhelds.org | 2 | * GPLv2 zecke@handhelds.org |
3 | * No WArranty... | 3 | * No WArranty... |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #ifndef PHUNK_INTERFACE_INFO_H | 6 | #ifndef PHUNK_INTERFACE_INFO_H |
7 | #define PHUNK_INTERFACE_INFO_H | 7 | #define PHUNK_INTERFACE_INFO_H |
8 | 8 | ||
9 | #include <qstring.h> | 9 | #include <qstring.h> |
10 | 10 | ||
11 | class QWidget; | 11 | class QWidget; |
12 | class Config; | 12 | class Config; |
13 | struct PInterfaceInfo { | 13 | struct PInterfaceInfo { |
14 | virtual QString name()const = 0; | 14 | virtual QString name()const = 0; |
15 | virtual QWidget* configWidget( const Config& ) = 0; | 15 | virtual QWidget* configWidget( const Config& ) = 0; |
16 | virtual void writeConfig( QWidget* wid, Config& ) = 0; | 16 | virtual void writeConfig( QWidget* wid, Config& ) = 0; |
17 | }; | 17 | }; |
18 | 18 | ||
19 | #endif | 19 | #endif |