Diffstat (limited to 'libopie2/opieui/fileselector/ofileselector.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.h | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.h b/libopie2/opieui/fileselector/ofileselector.h index 7abe8b7..7fa657b 100644 --- a/libopie2/opieui/fileselector/ofileselector.h +++ b/libopie2/opieui/fileselector/ofileselector.h | |||
@@ -55,21 +55,45 @@ typedef QMap<QString, QStringList> MimeTypes; | |||
55 | namespace Opie | 55 | namespace Opie |
56 | { | 56 | { |
57 | 57 | ||
58 | class OFileViewInterface; | 58 | class OFileViewInterface; |
59 | class OFileViewFileListView; | 59 | class OFileViewFileListView; |
60 | 60 | ||
61 | |||
62 | /** | ||
63 | * @short a dropin replacement for the FileSelector | ||
64 | * | ||
65 | * This class is first used insert the OFileDialog. | ||
66 | * It supports multiple view and mimetype filtering for now. | ||
67 | * | ||
68 | * @see OFileDialog | ||
69 | * @see FileSelector | ||
70 | * @author zecke | ||
71 | * @version 0.1 | ||
72 | */ | ||
61 | class OFileSelector : public QWidget | 73 | class OFileSelector : public QWidget |
62 | { | 74 | { |
63 | Q_OBJECT | 75 | Q_OBJECT |
64 | friend class Opie::OFileViewInterface; | 76 | friend class Opie::OFileViewInterface; |
65 | friend class Opie::OFileViewFileListView; | 77 | friend class Opie::OFileViewFileListView; |
66 | 78 | ||
67 | public: | 79 | public: |
80 | /** | ||
81 | * The Mode of the Fileselector | ||
82 | * Open = Open A File | ||
83 | * Save = Save a File | ||
84 | * FILESELECTOR = As A GUI in a screen to select a file | ||
85 | */ | ||
68 | enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 }; | 86 | enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 }; |
69 | // enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 }; | 87 | // enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 }; |
88 | /** | ||
89 | * Normal = The old FileSelector | ||
90 | * Extended = Dir View | ||
91 | * ExtendedAll = Dir View with all hidden files | ||
92 | * Default = What the vendor considers best | ||
93 | */ | ||
70 | enum Selector { Normal = 0, Extended=1, ExtendedAll =2, Default=3, NORMAL=0,EXTENDED=1, EXTENDED_ALL =2, DEFAULT=3 }; | 94 | enum Selector { Normal = 0, Extended=1, ExtendedAll =2, Default=3, NORMAL=0,EXTENDED=1, EXTENDED_ALL =2, DEFAULT=3 }; |
71 | // enum OldSelector { NORMAL = 0, EXTENDED =1, EXTENDED_ALL = 2}; | 95 | // enum OldSelector { NORMAL = 0, EXTENDED =1, EXTENDED_ALL = 2}; |
72 | 96 | ||
73 | OFileSelector(QWidget* parent, int mode, int selector, | 97 | OFileSelector(QWidget* parent, int mode, int selector, |
74 | const QString& dirName, | 98 | const QString& dirName, |
75 | const QString& fileName, | 99 | const QString& fileName, |
@@ -91,23 +115,57 @@ public: | |||
91 | int fileCount()const; | 115 | int fileCount()const; |
92 | void reread(); | 116 | void reread(); |
93 | 117 | ||
94 | int mode()const; | 118 | int mode()const; |
95 | int selector()const; | 119 | int selector()const; |
96 | 120 | ||
97 | 121 | /** | |
122 | * Set the Icon visible | ||
123 | * @param b Show or Hide the New Button | ||
124 | */ | ||
98 | void setNewVisible( bool b ); | 125 | void setNewVisible( bool b ); |
126 | |||
127 | /** | ||
128 | * Set the Icon visible | ||
129 | */ | ||
99 | void setCloseVisible( bool b ); | 130 | void setCloseVisible( bool b ); |
131 | |||
132 | /** | ||
133 | * Set the Name Line visible | ||
134 | */ | ||
100 | void setNameVisible( bool b ); | 135 | void setNameVisible( bool b ); |
101 | 136 | ||
102 | signals: | 137 | signals: |
138 | /** | ||
139 | * dirSelected is emitted whenever changed into a different dir | ||
140 | */ | ||
103 | void dirSelected( const QString& ); | 141 | void dirSelected( const QString& ); |
142 | |||
143 | /** | ||
144 | * fileSelected is emitted when a file is selected | ||
145 | * it uses a DocLnk as parameter | ||
146 | */ | ||
104 | void fileSelected( const DocLnk& ); | 147 | void fileSelected( const DocLnk& ); |
148 | |||
149 | /** | ||
150 | * fileSelected is emitted when a file is selected | ||
151 | * the complete path is a parameter | ||
152 | */ | ||
105 | void fileSelected( const QString& ); | 153 | void fileSelected( const QString& ); |
154 | |||
155 | /** | ||
156 | * Create a new File with a DocLnk | ||
157 | */ | ||
106 | void newSelected( const DocLnk& ); | 158 | void newSelected( const DocLnk& ); |
159 | |||
107 | void closeMe(); | 160 | void closeMe(); |
161 | |||
162 | /** | ||
163 | * Ok is emitted on a Qt::Key_Return or Q::Key_Enter | ||
164 | * in the line edit | ||
165 | */ | ||
108 | void ok(); | 166 | void ok(); |
109 | void cancel(); | 167 | void cancel(); |
110 | 168 | ||
111 | /* used by the ViewInterface */ | 169 | /* used by the ViewInterface */ |
112 | private: | 170 | private: |
113 | bool showNew()const; | 171 | bool showNew()const; |