author | zecke <zecke> | 2002-10-05 20:49:38 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-05 20:49:38 (UTC) |
commit | 19c0a4610292a95281a64655cef9c2d695a214dc (patch) (side-by-side diff) | |
tree | dde4afda2629a6e10d545d9492ada7b43e431ee7 /libopie/ofileselector/opixmapprovider.h | |
parent | d7f9d00fcc9261db9c4af4f1b4afde9d50e8a2a2 (diff) | |
download | opie-19c0a4610292a95281a64655cef9c2d695a214dc.zip opie-19c0a4610292a95281a64655cef9c2d695a214dc.tar.gz opie-19c0a4610292a95281a64655cef9c2d695a214dc.tar.bz2 |
more steps to make ofileselector modular
We now got the API for a factory so switching should work in future
and we now got a OPixmapProvider which provides us with pixmaps....
So an ImageViewer could install a differen OPixmapProvider
and a different OFileView to make Previewing
work
Diffstat (limited to 'libopie/ofileselector/opixmapprovider.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/ofileselector/opixmapprovider.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/libopie/ofileselector/opixmapprovider.h b/libopie/ofileselector/opixmapprovider.h new file mode 100644 index 0000000..2165fdb --- a/dev/null +++ b/libopie/ofileselector/opixmapprovider.h @@ -0,0 +1,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 |