summaryrefslogtreecommitdiff
path: root/libopie2/opieui/fileselector/ofileselector.h
authorzecke <zecke>2004-07-24 13:16:26 (UTC)
committer zecke <zecke>2004-07-24 13:16:26 (UTC)
commit144d91fee9e0ec0cb672508637c639cfbbf4e750 (patch) (unidiff)
tree802d12ac283361e3d5d710a6b8387dc22b88c462 /libopie2/opieui/fileselector/ofileselector.h
parent1efb57a4cffc8a19a0dadbd008ff205d3d61d216 (diff)
downloadopie-144d91fee9e0ec0cb672508637c639cfbbf4e750.zip
opie-144d91fee9e0ec0cb672508637c639cfbbf4e750.tar.gz
opie-144d91fee9e0ec0cb672508637c639cfbbf4e750.tar.bz2
Delete the Views which are created in the OFileSelector
Add a new member and one method to register the view. The views themselves (baseclass) call this function. Simply going over the viewMap wouldn't work as we can have the same instance contained twice under a different name
Diffstat (limited to 'libopie2/opieui/fileselector/ofileselector.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opieui/fileselector/ofileselector.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.h b/libopie2/opieui/fileselector/ofileselector.h
index 8bcd9ee..de2b98a 100644
--- a/libopie2/opieui/fileselector/ofileselector.h
+++ b/libopie2/opieui/fileselector/ofileselector.h
@@ -35,24 +35,25 @@
35#ifndef OFILESELECTOR_H 35#ifndef OFILESELECTOR_H
36#define OFILESELECTOR_H 36#define OFILESELECTOR_H
37 37
38/* OPIE */ 38/* OPIE */
39#include <qpe/applnk.h> 39#include <qpe/applnk.h>
40 40
41/* QT */ 41/* QT */
42#include <qlist.h> 42#include <qlist.h>
43#include <qwidget.h> 43#include <qwidget.h>
44#include <qmap.h> 44#include <qmap.h>
45#include <qvaluelist.h> 45#include <qvaluelist.h>
46#include <qstringlist.h> 46#include <qstringlist.h>
47#include <qlist.h>
47 48
48class QLineEdit; 49class QLineEdit;
49class QComboBox; 50class QComboBox;
50class QWidgetStack; 51class QWidgetStack;
51class QHBox; 52class QHBox;
52 53
53typedef QMap<QString, QStringList> MimeTypes; 54typedef QMap<QString, QStringList> MimeTypes;
54 55
55namespace Opie { 56namespace Opie {
56namespace Ui { 57namespace Ui {
57 58
58namespace Internal { 59namespace Internal {
@@ -174,35 +175,44 @@ private:
174 bool showClose()const; 175 bool showClose()const;
175 MimeTypes mimeTypes()const; 176 MimeTypes mimeTypes()const;
176 QStringList currentMimeType()const; 177 QStringList currentMimeType()const;
177 178
178private: 179private:
179 /* inits the Widgets */ 180 /* inits the Widgets */
180 void initUI(); 181 void initUI();
181 /* inits the MimeType ComboBox content + connects signals and slots */ 182 /* inits the MimeType ComboBox content + connects signals and slots */
182 void initMime(); 183 void initMime();
183 /* init the Views :) */ 184 /* init the Views :) */
184 void initViews(); 185 void initViews();
185 186
187
188 /*
189 * register a view for deletion.
190 * This happens on creation of a OFileViewInterface
191 */
192 void registerView( const Internal::OFileViewInterface* );
193
186private: 194private:
187 QLineEdit* m_lneEdit; // the LineEdit for the Name 195 QLineEdit* m_lneEdit; // the LineEdit for the Name
188 QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType 196 QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType
189 QWidgetStack* m_stack; // our widget stack which will contain the views 197 QWidgetStack* m_stack; // our widget stack which will contain the views
190 Internal::OFileViewInterface* currentView() const; // returns the currentView 198 Internal::OFileViewInterface* currentView() const; // returns the currentView
191 Internal::OFileViewInterface* m_current; // here is the view saved 199 Internal::OFileViewInterface* m_current; // here is the view saved
192 bool m_shNew : 1; // should we show New? 200 bool m_shNew : 1; // should we show New?
193 bool m_shClose : 1; // should we show Close? 201 bool m_shClose : 1; // should we show Close?
194 MimeTypes m_mimeType; // list of mimetypes 202 MimeTypes m_mimeType; // list of mimetypes
195 203
196 QMap<QString, Internal::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr 204 QMap<QString, Internal::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr
205 /* views register themselves automatically */
206 QList<Internal::OFileViewInterface> m_viewsPtr;
197 QHBox* m_nameBox; // the LineEdit + Label is hold here 207 QHBox* m_nameBox; // the LineEdit + Label is hold here
198 QHBox* m_cmbBox; // this holds the two combo boxes 208 QHBox* m_cmbBox; // this holds the two combo boxes
199 209
200 QString m_startDir; 210 QString m_startDir;
201 int m_mode; 211 int m_mode;
202 int m_selector; 212 int m_selector;
203 213
204 struct Data; // used for future versions 214 struct Data; // used for future versions
205 Data *d; 215 Data *d;
206 216
207private slots: 217private slots:
208 void slotMimeTypeChanged(); 218 void slotMimeTypeChanged();