From 3ba494eb02e72e1f9a732c46ec8085e843f01eca Mon Sep 17 00:00:00 2001 From: zecke Date: Mon, 28 Oct 2002 19:55:18 +0000 Subject: This will probably not compile.. i did not even try to compile it on my machine I changed the data flow to be more extandable the Olister class is now playing a bigger role it's dependant on doing some assembly of the filepath and changedirs. It now has also to take care of the location bar --- (limited to 'libopie/ofileselector/olister.h') diff --git a/libopie/ofileselector/olister.h b/libopie/ofileselector/olister.h index 0885525..79d5409 100644 --- a/libopie/ofileselector/olister.h +++ b/libopie/ofileselector/olister.h @@ -6,8 +6,11 @@ #include #include +class QComboBox; class OPixmapProvider; class OFileSelector; + +class OListerCmbAccess; /** * lister is something like KIO but very * very basic and currently only for @@ -15,6 +18,7 @@ class OFileSelector; * This is a base class which needs to be implemented. * @see OLocalLister for a filesystem based implementation */ + class OLister { public: OLister( OFileSelector* ); @@ -27,16 +31,32 @@ public: virtual QMap mimeTypes( const QString& dir ) = 0; void setPixmapProvider( OPixmapProvider* ); + + /* some way a slot */ + void fileSelected( const QString& dir, const QString& file, const QString& extra ) = 0; + void changeDir( const QString& dir, const QString& file, const QString& extra ) = 0; protected: + /** + * I hate too big classes + * this is a way to group + * access to a ComboBox + * which might exist or + * not in a secure way + */ + OListerCmbAccess* comboBox(); + bool showFiles()const; bool showDirs()const; bool compliesMime( const QString& mime ); void addFile( const QString& mine, QFileInfo*, + const QString& extra = QString::null, bool isSymlink = FALSE ); + void addFile( const QString& mine, const QString& path, const QString& file, + const QString& extra = QString::null, bool isSymlink = FALSE ); void addDir( const QString& mine, QFileInfo*, @@ -44,20 +64,61 @@ protected: void addDir( const QString& mine, const QString& path, const QString& dir, + const QString& extra = QString::null, bool isSymlink = FALSE ); void addSymlink( const QString& mine, QFileInfo* info, + const QString& extra = QString::null, bool isSymlink = FALSE); void addSymlink( const QString& mine, const QString& path, const QString& name, + const QString& extra = QString::null, bool isSymlink = FALSE ); OFileSelector* view(); OPixmapProvider* provider(); private: OFileSelector* m_view; OPixmapProvider* m_prov; + OListerCmbAccess* m_acc; + + class Private; + Private *d; +}; + +class OListerCmbAccess { + friend class OLister; +public: + OListerCmbAccess( QComboBox* = 0l); + ~OListerCmbAccess(); + + /** + * clears the combobox + */ + void clear(); + + /** + * set's @param add to be the current Item + * if the item is not present it'll be removed + */ + void setCurrentItem( const QString& add, bool FORECE_ADD = TRUE ); + + /** + * inserts the the String at + * a non predictable position... The position is determined + * by the QComboBox code + */ + void insert( const QString& ); + + /** + * + */ + QString currentText()const; +private: + class Private; + Private* d; + QComboBox* m_cmb; }; -- cgit v0.9.0.2