48 files changed, 378 insertions, 221 deletions
diff --git a/libopie2/opieui/big-screen/obigscreen_p.h b/libopie2/opieui/big-screen/obigscreen_p.h index db8fc83..a85a56c 100644 --- a/libopie2/opieui/big-screen/obigscreen_p.h +++ b/libopie2/opieui/big-screen/obigscreen_p.h | |||
@@ -5,10 +5,11 @@ | |||
5 | #include <qstring.h> | 5 | #include <qstring.h> |
6 | 6 | ||
7 | class QWidget; | 7 | class QWidget; |
8 | 8 | ||
9 | namespace Opie | 9 | namespace Opie { |
10 | { | 10 | namespace Ui { |
11 | namespace Private{ | ||
11 | 12 | ||
12 | struct OSplitterContainer | 13 | struct OSplitterContainer |
13 | { | 14 | { |
14 | bool operator==( const OSplitterContainer& o) const | 15 | bool operator==( const OSplitterContainer& o) const |
@@ -22,7 +23,9 @@ struct OSplitterContainer | |||
22 | QString icon; | 23 | QString icon; |
23 | QString name; | 24 | QString name; |
24 | }; | 25 | }; |
25 | 26 | ||
26 | }; | 27 | } |
28 | } | ||
29 | } | ||
27 | 30 | ||
28 | #endif | 31 | #endif |
diff --git a/libopie2/opieui/big-screen/osplitter.cpp b/libopie2/opieui/big-screen/osplitter.cpp index 89f3793..bcfd3a6 100644 --- a/libopie2/opieui/big-screen/osplitter.cpp +++ b/libopie2/opieui/big-screen/osplitter.cpp | |||
@@ -34,9 +34,10 @@ | |||
34 | /* QT */ | 34 | /* QT */ |
35 | #include <qvaluelist.h> | 35 | #include <qvaluelist.h> |
36 | #include <qvbox.h> | 36 | #include <qvbox.h> |
37 | 37 | ||
38 | using namespace Opie; | 38 | using namespace Opie::Ui; |
39 | using namespace Opie::Ui::Private; | ||
39 | 40 | ||
40 | /** | 41 | /** |
41 | * | 42 | * |
42 | * This is the constructor of OSplitter | 43 | * This is the constructor of OSplitter |
@@ -167,9 +168,9 @@ void OSplitter::addWidget( OSplitter* split ) | |||
167 | if (m_tabWidget ) | 168 | if (m_tabWidget ) |
168 | setTabWidget( m_parentTab ); | 169 | setTabWidget( m_parentTab ); |
169 | else | 170 | else |
170 | { | 171 | { |
171 | Opie::OSplitterContainer con; | 172 | OSplitterContainer con; |
172 | con.widget =split; | 173 | con.widget =split; |
173 | addToBox( con ); | 174 | addToBox( con ); |
174 | } | 175 | } |
175 | } | 176 | } |
@@ -212,9 +213,9 @@ void OSplitter::addWidget( QWidget* wid, const QString& icon, const QString& lab | |||
212 | qWarning("Widget is not valid!"); | 213 | qWarning("Widget is not valid!"); |
213 | return; | 214 | return; |
214 | } | 215 | } |
215 | #endif | 216 | #endif |
216 | Opie::OSplitterContainer cont; | 217 | OSplitterContainer cont; |
217 | cont.widget = wid; | 218 | cont.widget = wid; |
218 | cont.icon =icon; | 219 | cont.icon =icon; |
219 | cont.name = label; | 220 | cont.name = label; |
220 | 221 | ||
@@ -395,9 +396,9 @@ void OSplitter::resizeEvent( QResizeEvent* res ) | |||
395 | /* | 396 | /* |
396 | * Adds a container to a tab either the parent tab | 397 | * Adds a container to a tab either the parent tab |
397 | * or our own | 398 | * or our own |
398 | */ | 399 | */ |
399 | void OSplitter::addToTab( const Opie::OSplitterContainer& con ) | 400 | void OSplitter::addToTab( const Opie::Ui::Private::OSplitterContainer& con ) |
400 | { | 401 | { |
401 | QWidget *wid = con.widget; | 402 | QWidget *wid = con.widget; |
402 | // not needed widgetstack will reparent as well wid.reparent(m_tabWidget, wid->getWFlags(), QPoint(0, 0) ); | 403 | // not needed widgetstack will reparent as well wid.reparent(m_tabWidget, wid->getWFlags(), QPoint(0, 0) ); |
403 | if (m_parentTab ) | 404 | if (m_parentTab ) |
@@ -409,9 +410,9 @@ void OSplitter::addToTab( const Opie::OSplitterContainer& con ) | |||
409 | 410 | ||
410 | /* | 411 | /* |
411 | * adds a container to the box | 412 | * adds a container to the box |
412 | */ | 413 | */ |
413 | void OSplitter::addToBox( const Opie::OSplitterContainer& con ) | 414 | void OSplitter::addToBox( const Opie::Ui::Private::OSplitterContainer& con ) |
414 | { | 415 | { |
415 | QWidget* wid = con.widget; | 416 | QWidget* wid = con.widget; |
416 | wid->reparent(m_hbox, 0, QPoint(0, 0) ); | 417 | wid->reparent(m_hbox, 0, QPoint(0, 0) ); |
417 | } | 418 | } |
@@ -544,9 +545,9 @@ void OSplitter::commonChangeBox() | |||
544 | for ( OSplitter* split = m_splitter.first(); split; split = m_splitter.next() ) | 545 | for ( OSplitter* split = m_splitter.first(); split; split = m_splitter.next() ) |
545 | { | 546 | { |
546 | /* tell them the world had changed */ | 547 | /* tell them the world had changed */ |
547 | split->setTabWidget( 0 ); | 548 | split->setTabWidget( 0 ); |
548 | Opie::OSplitterContainer con; | 549 | OSplitterContainer con; |
549 | con.widget = split; | 550 | con.widget = split; |
550 | // con.widget = split->m_tabWidget ? static_cast<QWidget*>(split->m_tabWidget) | 551 | // con.widget = split->m_tabWidget ? static_cast<QWidget*>(split->m_tabWidget) |
551 | // : static_cast<QWidget*>(split->m_hbox); | 552 | // : static_cast<QWidget*>(split->m_hbox); |
552 | addToBox( con ); | 553 | addToBox( con ); |
diff --git a/libopie2/opieui/big-screen/osplitter.h b/libopie2/opieui/big-screen/osplitter.h index 2daae7f..7b5ea53 100644 --- a/libopie2/opieui/big-screen/osplitter.h +++ b/libopie2/opieui/big-screen/osplitter.h | |||
@@ -22,9 +22,9 @@ | |||
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifndef OSPLITTER_H | 29 | #ifndef OSPLITTER_H |
30 | #define OSPLITTER_H | 30 | #define OSPLITTER_H |
@@ -47,10 +47,10 @@ class QHBox; | |||
47 | * -one more example | 47 | * -one more example |
48 | * -allow inserting at a position | 48 | * -allow inserting at a position |
49 | */ | 49 | */ |
50 | 50 | ||
51 | namespace Opie | 51 | namespace Opie{ |
52 | { | 52 | namespace Ui { |
53 | class OTabWidget; | 53 | class OTabWidget; |
54 | 54 | ||
55 | /** | 55 | /** |
56 | * | 56 | * |
@@ -72,9 +72,9 @@ class OTabWidget; | |||
72 | class OSplitter : public QFrame | 72 | class OSplitter : public QFrame |
73 | { | 73 | { |
74 | Q_OBJECT | 74 | Q_OBJECT |
75 | public: | 75 | public: |
76 | typedef QValueList<Opie::OSplitterContainer> ContainerList; | 76 | typedef QValueList<Opie::Ui::Private::OSplitterContainer> ContainerList; |
77 | OSplitter( Qt::Orientation = Horizontal, QWidget *parent = 0, | 77 | OSplitter( Qt::Orientation = Horizontal, QWidget *parent = 0, |
78 | const char* name = 0, WFlags fl = 0 ); | 78 | const char* name = 0, WFlags fl = 0 ); |
79 | ~OSplitter(); | 79 | ~OSplitter(); |
80 | 80 | ||
@@ -123,10 +123,10 @@ private: | |||
123 | /* true if OTabMode */ | 123 | /* true if OTabMode */ |
124 | bool layoutMode()const; | 124 | bool layoutMode()const; |
125 | // void reparentAll(); | 125 | // void reparentAll(); |
126 | void setTabWidget( OTabWidget*); | 126 | void setTabWidget( OTabWidget*); |
127 | void addToTab( const Opie::OSplitterContainer& ); | 127 | void addToTab( const Opie::Ui::Private::OSplitterContainer& ); |
128 | void addToBox( const Opie::OSplitterContainer& ); | 128 | void addToBox( const Opie::Ui::Private::OSplitterContainer& ); |
129 | void removeFromTab( QWidget* ); | 129 | void removeFromTab( QWidget* ); |
130 | void changeTab(); | 130 | void changeTab(); |
131 | void changeHBox(); | 131 | void changeHBox(); |
132 | void changeVBox(); | 132 | void changeVBox(); |
@@ -144,7 +144,8 @@ private: | |||
144 | 144 | ||
145 | struct Private; | 145 | struct Private; |
146 | Private *d; | 146 | Private *d; |
147 | }; | 147 | }; |
148 | }; | 148 | } |
149 | } | ||
149 | 150 | ||
150 | #endif | 151 | #endif |
diff --git a/libopie2/opieui/big-screen/owidgetstack.cpp b/libopie2/opieui/big-screen/owidgetstack.cpp index 57e97e3..a0a6355 100644 --- a/libopie2/opieui/big-screen/owidgetstack.cpp +++ b/libopie2/opieui/big-screen/owidgetstack.cpp | |||
@@ -31,13 +31,13 @@ | |||
31 | /* QT */ | 31 | /* QT */ |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | #include <qwidgetstack.h> | 33 | #include <qwidgetstack.h> |
34 | 34 | ||
35 | namespace { | 35 | namespace Opie { |
36 | namespace Ui { | ||
36 | const int mode_size = 330; | 37 | const int mode_size = 330; |
37 | } | ||
38 | 38 | ||
39 | using namespace Opie; | 39 | |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * This is the standard widget. For simple usage see the example. Normally this widget | 42 | * This is the standard widget. For simple usage see the example. Normally this widget |
43 | * is the central widget of a QMainWindow. | 43 | * is the central widget of a QMainWindow. |
@@ -432,4 +432,7 @@ void OWidgetStack::switchTop() { | |||
432 | 432 | ||
433 | delete m_stack; | 433 | delete m_stack; |
434 | m_stack = 0; | 434 | m_stack = 0; |
435 | } | 435 | } |
436 | |||
437 | } | ||
438 | } \ No newline at end of file | ||
diff --git a/libopie2/opieui/big-screen/owidgetstack.h b/libopie2/opieui/big-screen/owidgetstack.h index 53818c8..d2f9a9f 100644 --- a/libopie2/opieui/big-screen/owidgetstack.h +++ b/libopie2/opieui/big-screen/owidgetstack.h | |||
@@ -34,10 +34,10 @@ | |||
34 | #include <qmap.h> | 34 | #include <qmap.h> |
35 | 35 | ||
36 | class QWidgetStack; | 36 | class QWidgetStack; |
37 | 37 | ||
38 | namespace Opie | 38 | namespace Opie { |
39 | { | 39 | namespace Ui { |
40 | /** | 40 | /** |
41 | * | 41 | * |
42 | * OWidgetStack is the answer to the problem of using Opie at different screen | 42 | * OWidgetStack is the answer to the problem of using Opie at different screen |
43 | * sizes and to have a different behaviour. Most applications use a QWidgetStack | 43 | * sizes and to have a different behaviour. Most applications use a QWidgetStack |
@@ -126,7 +126,8 @@ private: | |||
126 | struct Private; | 126 | struct Private; |
127 | Private *d; | 127 | Private *d; |
128 | }; | 128 | }; |
129 | 129 | ||
130 | }; | 130 | } |
131 | } | ||
131 | 132 | ||
132 | #endif | 133 | #endif |
diff --git a/libopie2/opieui/fileselector/ofiledialog.cpp b/libopie2/opieui/fileselector/ofiledialog.cpp index e7daead..beb4d6c 100644 --- a/libopie2/opieui/fileselector/ofiledialog.cpp +++ b/libopie2/opieui/fileselector/ofiledialog.cpp | |||
@@ -38,9 +38,9 @@ | |||
38 | #include <qstring.h> | 38 | #include <qstring.h> |
39 | #include <qapplication.h> | 39 | #include <qapplication.h> |
40 | #include <qlayout.h> | 40 | #include <qlayout.h> |
41 | 41 | ||
42 | using namespace Opie; | 42 | using namespace Opie::Ui; |
43 | 43 | ||
44 | namespace | 44 | namespace |
45 | { | 45 | { |
46 | /* | 46 | /* |
diff --git a/libopie2/opieui/fileselector/ofiledialog.h b/libopie2/opieui/fileselector/ofiledialog.h index 01a599b..dfecf3d 100644 --- a/libopie2/opieui/fileselector/ofiledialog.h +++ b/libopie2/opieui/fileselector/ofiledialog.h | |||
@@ -34,10 +34,10 @@ | |||
34 | 34 | ||
35 | /* QT */ | 35 | /* QT */ |
36 | #include <qdialog.h> | 36 | #include <qdialog.h> |
37 | 37 | ||
38 | namespace Opie | 38 | namespace Opie { |
39 | { | 39 | namespace Ui { |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * This class places a OFileSelector inside a QDialog. | 42 | * This class places a OFileSelector inside a QDialog. |
43 | * It provides static method for letting a user chose | 43 | * It provides static method for letting a user chose |
@@ -103,7 +103,8 @@ private slots: | |||
103 | void slotDirSelected(const QString & ); | 103 | void slotDirSelected(const QString & ); |
104 | void slotSelectorOk(); | 104 | void slotSelectorOk(); |
105 | }; | 105 | }; |
106 | 106 | ||
107 | }; | 107 | } |
108 | } | ||
108 | 109 | ||
109 | #endif | 110 | #endif |
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp index 15cadd4..c4d5033 100644 --- a/libopie2/opieui/fileselector/ofileselector.cpp +++ b/libopie2/opieui/fileselector/ofileselector.cpp | |||
@@ -54,10 +54,13 @@ | |||
54 | #include <qwidgetstack.h> | 54 | #include <qwidgetstack.h> |
55 | #include <qregexp.h> | 55 | #include <qregexp.h> |
56 | #include <qobjectlist.h> | 56 | #include <qobjectlist.h> |
57 | 57 | ||
58 | using namespace Opie; | 58 | using namespace Opie::Ui::Private; |
59 | 59 | ||
60 | namespace Opie { | ||
61 | namespace Ui { | ||
62 | namespace Private { | ||
60 | OFileViewInterface::OFileViewInterface( OFileSelector* selector ) | 63 | OFileViewInterface::OFileViewInterface( OFileSelector* selector ) |
61 | : m_selector( selector ) | 64 | : m_selector( selector ) |
62 | {} | 65 | {} |
63 | 66 | ||
@@ -809,8 +812,10 @@ void OFileViewFileSystem::activate( const QString& str) | |||
809 | { | 812 | { |
810 | m_all = (str != QObject::tr("Files") ); | 813 | m_all = (str != QObject::tr("Files") ); |
811 | } | 814 | } |
812 | 815 | ||
816 | |||
817 | } | ||
813 | /* Selector */ | 818 | /* Selector */ |
814 | /** | 819 | /** |
815 | * @short new and complete c'tor | 820 | * @short new and complete c'tor |
816 | * | 821 | * |
@@ -1163,4 +1168,6 @@ void OFileSelector::setNameVisible( bool b ) | |||
1163 | else | 1168 | else |
1164 | m_nameBox->hide(); | 1169 | m_nameBox->hide(); |
1165 | } | 1170 | } |
1166 | 1171 | ||
1172 | } | ||
1173 | } | ||
diff --git a/libopie2/opieui/fileselector/ofileselector.h b/libopie2/opieui/fileselector/ofileselector.h index 7fa657b..2205963 100644 --- a/libopie2/opieui/fileselector/ofileselector.h +++ b/libopie2/opieui/fileselector/ofileselector.h | |||
@@ -51,13 +51,15 @@ class QWidgetStack; | |||
51 | class QHBox; | 51 | class QHBox; |
52 | 52 | ||
53 | typedef QMap<QString, QStringList> MimeTypes; | 53 | typedef QMap<QString, QStringList> MimeTypes; |
54 | 54 | ||
55 | namespace Opie | 55 | namespace Opie { |
56 | { | 56 | namespace Ui { |
57 | 57 | ||
58 | namespace Private { | ||
58 | class OFileViewInterface; | 59 | class OFileViewInterface; |
59 | class OFileViewFileListView; | 60 | class OFileViewFileListView; |
61 | } | ||
60 | 62 | ||
61 | 63 | ||
62 | /** | 64 | /** |
63 | * @short a dropin replacement for the FileSelector | 65 | * @short a dropin replacement for the FileSelector |
@@ -72,10 +74,10 @@ class OFileViewFileListView; | |||
72 | */ | 74 | */ |
73 | class OFileSelector : public QWidget | 75 | class OFileSelector : public QWidget |
74 | { | 76 | { |
75 | Q_OBJECT | 77 | Q_OBJECT |
76 | friend class Opie::OFileViewInterface; | 78 | friend class Private::OFileViewInterface; |
77 | friend class Opie::OFileViewFileListView; | 79 | friend class Private::OFileViewFileListView; |
78 | 80 | ||
79 | public: | 81 | public: |
80 | /** | 82 | /** |
81 | * The Mode of the Fileselector | 83 | * The Mode of the Fileselector |
@@ -184,15 +186,15 @@ private: | |||
184 | private: | 186 | private: |
185 | QLineEdit* m_lneEdit; // the LineEdit for the Name | 187 | QLineEdit* m_lneEdit; // the LineEdit for the Name |
186 | QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType | 188 | QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType |
187 | QWidgetStack* m_stack; // our widget stack which will contain the views | 189 | QWidgetStack* m_stack; // our widget stack which will contain the views |
188 | OFileViewInterface* currentView() const; // returns the currentView | 190 | Private::OFileViewInterface* currentView() const; // returns the currentView |
189 | OFileViewInterface* m_current; // here is the view saved | 191 | Private::OFileViewInterface* m_current; // here is the view saved |
190 | bool m_shNew : 1; // should we show New? | 192 | bool m_shNew : 1; // should we show New? |
191 | bool m_shClose : 1; // should we show Close? | 193 | bool m_shClose : 1; // should we show Close? |
192 | MimeTypes m_mimeType; // list of mimetypes | 194 | MimeTypes m_mimeType; // list of mimetypes |
193 | 195 | ||
194 | QMap<QString, OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr | 196 | QMap<QString, Private::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr |
195 | QHBox* m_nameBox; // the LineEdit + Label is hold here | 197 | QHBox* m_nameBox; // the LineEdit + Label is hold here |
196 | QHBox* m_cmbBox; // this holds the two combo boxes | 198 | QHBox* m_cmbBox; // this holds the two combo boxes |
197 | 199 | ||
198 | QString m_startDir; | 200 | QString m_startDir; |
@@ -213,7 +215,8 @@ private slots: | |||
213 | bool eventFilter (QObject *o, QEvent *e); | 215 | bool eventFilter (QObject *o, QEvent *e); |
214 | 216 | ||
215 | }; | 217 | }; |
216 | 218 | ||
217 | }; | 219 | } |
220 | } | ||
218 | 221 | ||
219 | #endif | 222 | #endif |
diff --git a/libopie2/opieui/fileselector/ofileselector_p.h b/libopie2/opieui/fileselector/ofileselector_p.h index 818ced9..376dc98 100644 --- a/libopie2/opieui/fileselector/ofileselector_p.h +++ b/libopie2/opieui/fileselector/ofileselector_p.h | |||
@@ -55,12 +55,12 @@ typedef QMap<QString, QStringList> MimeTypes; | |||
55 | /* the View Interface */ | 55 | /* the View Interface */ |
56 | class QFileInfo; | 56 | class QFileInfo; |
57 | class QToolButton; | 57 | class QToolButton; |
58 | 58 | ||
59 | namespace Opie | 59 | namespace Opie{ |
60 | { | 60 | namespace Ui{ |
61 | |||
62 | class OFileSelector; | 61 | class OFileSelector; |
62 | namespace Private { | ||
63 | 63 | ||
64 | class OFileViewInterface | 64 | class OFileViewInterface |
65 | { | 65 | { |
66 | public: | 66 | public: |
@@ -185,7 +185,9 @@ private: | |||
185 | private: | 185 | private: |
186 | QListView* m_view; | 186 | QListView* m_view; |
187 | }; | 187 | }; |
188 | 188 | ||
189 | }; | 189 | } |
190 | } | ||
191 | } | ||
190 | 192 | ||
191 | #endif | 193 | #endif |
diff --git a/libopie2/opieui/fileselector/ofileview.h b/libopie2/opieui/fileselector/ofileview.h index 495401b..aaf56b1 100644 --- a/libopie2/opieui/fileselector/ofileview.h +++ b/libopie2/opieui/fileselector/ofileview.h | |||
@@ -36,10 +36,11 @@ | |||
36 | class QFileInfo; | 36 | class QFileInfo; |
37 | class QDir; | 37 | class QDir; |
38 | class DocLnk; | 38 | class DocLnk; |
39 | 39 | ||
40 | namespace Opie | 40 | namespace Opie { |
41 | { | 41 | namespace Ui { |
42 | namespace Private { | ||
42 | 43 | ||
43 | /** | 44 | /** |
44 | * A OFileView is a specialised View for the | 45 | * A OFileView is a specialised View for the |
45 | * OFileSelector | 46 | * OFileSelector |
@@ -89,7 +90,9 @@ public: | |||
89 | OFileView* newView(QWidget *parent, const char *name ); | 90 | OFileView* newView(QWidget *parent, const char *name ); |
90 | QString name()const; | 91 | QString name()const; |
91 | }; | 92 | }; |
92 | 93 | ||
93 | }; | 94 | } |
95 | } | ||
96 | } | ||
94 | 97 | ||
95 | #endif | 98 | #endif |
diff --git a/libopie2/opieui/oclickablelabel.cpp b/libopie2/opieui/oclickablelabel.cpp index 4c4e581..53cb77a 100644 --- a/libopie2/opieui/oclickablelabel.cpp +++ b/libopie2/opieui/oclickablelabel.cpp | |||
@@ -28,9 +28,9 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <opie2/oclickablelabel.h> | 30 | #include <opie2/oclickablelabel.h> |
31 | 31 | ||
32 | using namespace Opie; | 32 | using namespace Opie::Ui; |
33 | 33 | ||
34 | /** | 34 | /** |
35 | * This constructs the clickable ButtonLabel | 35 | * This constructs the clickable ButtonLabel |
36 | * | 36 | * |
diff --git a/libopie2/opieui/oclickablelabel.h b/libopie2/opieui/oclickablelabel.h index b224d61..90859a0 100644 --- a/libopie2/opieui/oclickablelabel.h +++ b/libopie2/opieui/oclickablelabel.h | |||
@@ -32,10 +32,10 @@ | |||
32 | 32 | ||
33 | /* QT */ | 33 | /* QT */ |
34 | #include <qlabel.h> | 34 | #include <qlabel.h> |
35 | 35 | ||
36 | namespace Opie | 36 | namespace Opie{ |
37 | { | 37 | namespace Ui { |
38 | 38 | ||
39 | /** | 39 | /** |
40 | * This class is a special QLabel which can behave | 40 | * This class is a special QLabel which can behave |
41 | * as a QPushButton or QToggleButton. | 41 | * as a QPushButton or QToggleButton. |
@@ -97,7 +97,8 @@ private: | |||
97 | class Private; | 97 | class Private; |
98 | Private *d; // private d pointer | 98 | Private *d; // private d pointer |
99 | }; | 99 | }; |
100 | 100 | ||
101 | }; | 101 | } |
102 | } | ||
102 | 103 | ||
103 | #endif | 104 | #endif |
diff --git a/libopie2/opieui/odialog.cpp b/libopie2/opieui/odialog.cpp index 4d269d4..27f8d20 100644 --- a/libopie2/opieui/odialog.cpp +++ b/libopie2/opieui/odialog.cpp | |||
@@ -31,8 +31,10 @@ | |||
31 | #include <opie2/odialog.h> | 31 | #include <opie2/odialog.h> |
32 | 32 | ||
33 | #warning Make Margin and Spacing device dependend and configurable! | 33 | #warning Make Margin and Spacing device dependend and configurable! |
34 | 34 | ||
35 | using namespace Opie::Ui; | ||
36 | |||
35 | int ODialog::mMarginSize = 5; | 37 | int ODialog::mMarginSize = 5; |
36 | int ODialog::mSpacingSize = 2; | 38 | int ODialog::mSpacingSize = 2; |
37 | 39 | ||
38 | ODialog::ODialog(QWidget *parent, const char *name, bool modal, WFlags f) | 40 | ODialog::ODialog(QWidget *parent, const char *name, bool modal, WFlags f) |
diff --git a/libopie2/opieui/odialog.h b/libopie2/opieui/odialog.h index ceff612..57f534c 100644 --- a/libopie2/opieui/odialog.h +++ b/libopie2/opieui/odialog.h | |||
@@ -54,8 +54,11 @@ class QLayoutItem; | |||
54 | // lets fix up Qt instead! Size does matter. -zecke | 54 | // lets fix up Qt instead! Size does matter. -zecke |
55 | // while that may be true, reducing maintainance effort for the future does also matter - | 55 | // while that may be true, reducing maintainance effort for the future does also matter - |
56 | // and I believe that maintaining a patch against QtE is more work than our classes -mml | 56 | // and I believe that maintaining a patch against QtE is more work than our classes -mml |
57 | 57 | ||
58 | namespace Opie { | ||
59 | namespace Ui { | ||
60 | |||
58 | class ODialog : public QDialog | 61 | class ODialog : public QDialog |
59 | { | 62 | { |
60 | Q_OBJECT | 63 | Q_OBJECT |
61 | 64 | ||
@@ -87,5 +90,7 @@ class ODialog : public QDialog | |||
87 | class ODialogPrivate; | 90 | class ODialogPrivate; |
88 | ODialogPrivate *d; | 91 | ODialogPrivate *d; |
89 | 92 | ||
90 | }; | 93 | }; |
94 | } | ||
95 | } | ||
91 | #endif // ODIALOG_H | 96 | #endif // ODIALOG_H |
diff --git a/libopie2/opieui/ofontselector.cpp b/libopie2/opieui/ofontselector.cpp index f93781f..b19c26e 100644 --- a/libopie2/opieui/ofontselector.cpp +++ b/libopie2/opieui/ofontselector.cpp | |||
@@ -37,12 +37,12 @@ | |||
37 | #include <qcombobox.h> | 37 | #include <qcombobox.h> |
38 | #include <qlabel.h> | 38 | #include <qlabel.h> |
39 | #include <qmultilineedit.h> | 39 | #include <qmultilineedit.h> |
40 | 40 | ||
41 | using namespace Opie; | ||
42 | 41 | ||
43 | namespace Opie | 42 | namespace Opie { |
44 | { | 43 | namespace Ui { |
44 | namespace Private { | ||
45 | 45 | ||
46 | class OFontSelectorPrivate | 46 | class OFontSelectorPrivate |
47 | { | 47 | { |
48 | public: | 48 | public: |
@@ -55,13 +55,8 @@ public: | |||
55 | 55 | ||
56 | FontDatabase m_fdb; | 56 | FontDatabase m_fdb; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | }; | ||
60 | |||
61 | namespace | ||
62 | { | ||
63 | |||
64 | class FontListItem : public QListBoxText | 59 | class FontListItem : public QListBoxText |
65 | { | 60 | { |
66 | public: | 61 | public: |
67 | FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText() | 62 | FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText() |
@@ -94,9 +89,15 @@ private: | |||
94 | QStringList m_styles; | 89 | QStringList m_styles; |
95 | QValueList<int> m_sizes; | 90 | QValueList<int> m_sizes; |
96 | QString m_name; | 91 | QString m_name; |
97 | }; | 92 | }; |
93 | } | ||
94 | } | ||
95 | } | ||
96 | |||
98 | 97 | ||
98 | using namespace Opie::Ui; | ||
99 | using namespace Opie::Ui::Private; | ||
99 | 100 | ||
100 | static int findItemCB( QComboBox *box, const QString &str ) | 101 | static int findItemCB( QComboBox *box, const QString &str ) |
101 | { | 102 | { |
102 | for ( int i = 0; i < box->count(); i++ ) | 103 | for ( int i = 0; i < box->count(); i++ ) |
@@ -106,9 +107,8 @@ static int findItemCB( QComboBox *box, const QString &str ) | |||
106 | } | 107 | } |
107 | return -1; | 108 | return -1; |
108 | } | 109 | } |
109 | 110 | ||
110 | } | ||
111 | /* static same as anon. namespace */ | 111 | /* static same as anon. namespace */ |
112 | static int qt_version() | 112 | static int qt_version() |
113 | { | 113 | { |
114 | const char *qver = qVersion(); | 114 | const char *qver = qVersion(); |
@@ -425,4 +425,5 @@ void OFontSelector::resizeEvent ( QResizeEvent *re ) | |||
425 | if ( d->m_preview ) | 425 | if ( d->m_preview ) |
426 | d->m_preview->setFixedHeight ( d->m_preview->height()); | 426 | d->m_preview->setFixedHeight ( d->m_preview->height()); |
427 | 427 | ||
428 | } | 428 | } |
429 | |||
diff --git a/libopie2/opieui/ofontselector.h b/libopie2/opieui/ofontselector.h index ad51819..1d97233 100644 --- a/libopie2/opieui/ofontselector.h +++ b/libopie2/opieui/ofontselector.h | |||
@@ -34,12 +34,13 @@ | |||
34 | #include <qwidget.h> | 34 | #include <qwidget.h> |
35 | 35 | ||
36 | class QListBox; | 36 | class QListBox; |
37 | 37 | ||
38 | namespace Opie | 38 | namespace Opie { |
39 | { | 39 | namespace Ui { |
40 | 40 | namespace Private { | |
41 | class OFontSelectorPrivate; | 41 | class OFontSelectorPrivate; |
42 | } | ||
42 | 43 | ||
43 | /** | 44 | /** |
44 | * This class lets you chose a Font out of a list of Fonts. | 45 | * This class lets you chose a Font out of a list of Fonts. |
45 | * It can show a preview too. This selector will use all available | 46 | * It can show a preview too. This selector will use all available |
@@ -94,11 +95,12 @@ private: | |||
94 | 95 | ||
95 | void changeFont ( ); | 96 | void changeFont ( ); |
96 | 97 | ||
97 | private: | 98 | private: |
98 | OFontSelectorPrivate *d; | 99 | Private::OFontSelectorPrivate *d; |
99 | }; | 100 | }; |
100 | 101 | ||
101 | }; | 102 | } |
103 | } | ||
102 | 104 | ||
103 | #endif | 105 | #endif |
104 | 106 | ||
diff --git a/libopie2/opieui/oimageeffect.cpp b/libopie2/opieui/oimageeffect.cpp index 9a58bb9..be47eb2 100644 --- a/libopie2/opieui/oimageeffect.cpp +++ b/libopie2/opieui/oimageeffect.cpp | |||
@@ -40,8 +40,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
40 | #define MaxRGB 255L | 40 | #define MaxRGB 255L |
41 | #define DegreesToRadians(x) ((x)*M_PI/180.0) | 41 | #define DegreesToRadians(x) ((x)*M_PI/180.0) |
42 | 42 | ||
43 | using namespace std; | 43 | using namespace std; |
44 | using namespace Opie::Core; | ||
45 | |||
46 | namespace Opie { | ||
47 | namespace Ui { | ||
44 | 48 | ||
45 | inline unsigned int intensityValue(unsigned int color) | 49 | inline unsigned int intensityValue(unsigned int color) |
46 | { | 50 | { |
47 | return((unsigned int)((0.299*qRed(color) + | 51 | return((unsigned int)((0.299*qRed(color) + |
@@ -3764,5 +3768,6 @@ void OImageEffect::contrastHSV(QImage &img, bool sharpen) | |||
3764 | } | 3768 | } |
3765 | 3769 | ||
3766 | 3770 | ||
3767 | 3771 | ||
3768 | 3772 | } | |
3773 | } | ||
diff --git a/libopie2/opieui/oimageeffect.h b/libopie2/opieui/oimageeffect.h index fb4d22d..4f86d5b 100644 --- a/libopie2/opieui/oimageeffect.h +++ b/libopie2/opieui/oimageeffect.h | |||
@@ -38,8 +38,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
38 | class QImage; | 38 | class QImage; |
39 | class QSize; | 39 | class QSize; |
40 | class QColor; | 40 | class QColor; |
41 | 41 | ||
42 | namespace Opie { | ||
43 | namespace Ui { | ||
42 | /** | 44 | /** |
43 | * This class includes various @ref QImage based graphical effects. | 45 | * This class includes various @ref QImage based graphical effects. |
44 | * | 46 | * |
45 | * Everything is | 47 | * Everything is |
@@ -555,5 +557,8 @@ private: | |||
555 | static unsigned int interpolateColor(QImage *image, double x, double y, | 557 | static unsigned int interpolateColor(QImage *image, double x, double y, |
556 | unsigned int background); | 558 | unsigned int background); |
557 | }; | 559 | }; |
558 | 560 | ||
561 | } | ||
562 | } | ||
563 | |||
559 | #endif | 564 | #endif |
diff --git a/libopie2/opieui/olistview.cpp b/libopie2/opieui/olistview.cpp index 0ee2fde..38670b4 100644 --- a/libopie2/opieui/olistview.cpp +++ b/libopie2/opieui/olistview.cpp | |||
@@ -35,8 +35,13 @@ | |||
35 | 35 | ||
36 | #include <opie2/odebug.h> | 36 | #include <opie2/odebug.h> |
37 | #include <opie2/olistview.h> | 37 | #include <opie2/olistview.h> |
38 | 38 | ||
39 | using namespace Opie::Core; | ||
40 | |||
41 | |||
42 | namespace Opie { | ||
43 | namespace Ui { | ||
39 | /*====================================================================================== | 44 | /*====================================================================================== |
40 | * OListView | 45 | * OListView |
41 | *======================================================================================*/ | 46 | *======================================================================================*/ |
42 | 47 | ||
@@ -754,4 +759,6 @@ ONamedListViewItem* ONamedListViewItem::find( const QString& column, const QStri | |||
754 | else | 759 | else |
755 | return 0; | 760 | return 0; |
756 | } | 761 | } |
757 | 762 | ||
763 | } | ||
764 | } | ||
diff --git a/libopie2/opieui/olistview.h b/libopie2/opieui/olistview.h index 59b0973..8195a62 100644 --- a/libopie2/opieui/olistview.h +++ b/libopie2/opieui/olistview.h | |||
@@ -35,8 +35,11 @@ | |||
35 | #include <qpen.h> | 35 | #include <qpen.h> |
36 | #include <qdatastream.h> | 36 | #include <qdatastream.h> |
37 | #include <qstringlist.h> | 37 | #include <qstringlist.h> |
38 | 38 | ||
39 | |||
40 | namespace Opie { | ||
41 | namespace Ui { | ||
39 | class OListViewItem; | 42 | class OListViewItem; |
40 | 43 | ||
41 | 44 | ||
42 | /*====================================================================================== | 45 | /*====================================================================================== |
@@ -53,8 +56,9 @@ class OListViewItem; | |||
53 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> | 56 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> |
54 | */ | 57 | */ |
55 | class OListView: public QListView | 58 | class OListView: public QListView |
56 | { | 59 | { |
60 | Q_OBJECT | ||
57 | public: | 61 | public: |
58 | /** | 62 | /** |
59 | * Constructor. | 63 | * Constructor. |
60 | * | 64 | * |
@@ -138,10 +142,12 @@ class OListView: public QListView | |||
138 | void expand(QListViewItem*); | 142 | void expand(QListViewItem*); |
139 | 143 | ||
140 | private: | 144 | private: |
141 | QColor m_alternateBackground; | 145 | QColor m_alternateBackground; |
142 | bool m_fullWidth; | 146 | bool m_fullWidth : 1; |
143 | QPen m_columnSeparator; | 147 | QPen m_columnSeparator; |
148 | class Private; | ||
149 | Private *d; | ||
144 | }; | 150 | }; |
145 | 151 | ||
146 | #ifndef QT_NO_DATASTREAM | 152 | #ifndef QT_NO_DATASTREAM |
147 | /** | 153 | /** |
@@ -241,10 +247,12 @@ class OListViewItem: public QListViewItem | |||
241 | */ | 247 | */ |
242 | virtual void expand(){}; | 248 | virtual void expand(){}; |
243 | 249 | ||
244 | private: | 250 | private: |
245 | bool m_known; | 251 | bool m_known : 1; |
246 | bool m_odd; | 252 | bool m_odd : 1; |
253 | class Private; | ||
254 | Private *d; | ||
247 | }; | 255 | }; |
248 | 256 | ||
249 | #ifndef QT_NO_DATASTREAM | 257 | #ifndef QT_NO_DATASTREAM |
250 | /** | 258 | /** |
@@ -353,8 +361,11 @@ class ONamedListView: public OListView | |||
353 | virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; | 361 | virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; |
354 | 362 | ||
355 | virtual ONamedListViewItem* find( ONamedListViewItem* start, const QString& column, const QString& text, int recurse = -1 ) const; | 363 | virtual ONamedListViewItem* find( ONamedListViewItem* start, const QString& column, const QString& text, int recurse = -1 ) const; |
356 | virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; | 364 | virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; |
365 | private: | ||
366 | class Private; | ||
367 | Private *d; | ||
357 | }; | 368 | }; |
358 | 369 | ||
359 | /*====================================================================================== | 370 | /*====================================================================================== |
360 | * ONamedListViewItem | 371 | * ONamedListViewItem |
@@ -402,8 +413,14 @@ class ONamedListViewItem: public OListViewItem | |||
402 | * @sa ONamedListView::find() | 413 | * @sa ONamedListView::find() |
403 | */ | 414 | */ |
404 | virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; | 415 | virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; |
405 | virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; | 416 | virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; |
406 | }; | ||
407 | 417 | ||
418 | private: | ||
419 | class Private; | ||
420 | Private *d; | ||
421 | |||
422 | }; | ||
423 | } | ||
424 | } | ||
408 | 425 | ||
409 | #endif // OLISTVIEW_H | 426 | #endif // OLISTVIEW_H |
diff --git a/libopie2/opieui/opieui.pro b/libopie2/opieui/opieui.pro index 1be8db5..e895edc 100644 --- a/libopie2/opieui/opieui.pro +++ b/libopie2/opieui/opieui.pro | |||
@@ -5,13 +5,11 @@ HEADERS = oclickablelabel.h \ | |||
5 | odialog.h \ | 5 | odialog.h \ |
6 | ofontselector.h \ | 6 | ofontselector.h \ |
7 | oimageeffect.h \ | 7 | oimageeffect.h \ |
8 | olistview.h \ | 8 | olistview.h \ |
9 | omessagebox.h \ | ||
10 | opixmapeffect.h \ | 9 | opixmapeffect.h \ |
11 | opopupmenu.h \ | 10 | opopupmenu.h \ |
12 | opixmapprovider.h \ | 11 | opixmapprovider.h \ |
13 | oresource.h \ | ||
14 | oselector.h \ | 12 | oselector.h \ |
15 | oseparator.h \ | 13 | oseparator.h \ |
16 | otabinfo.h \ | 14 | otabinfo.h \ |
17 | otabbar.h \ | 15 | otabbar.h \ |
@@ -30,9 +28,8 @@ SOURCES = oclickablelabel.cpp \ | |||
30 | olistview.cpp \ | 28 | olistview.cpp \ |
31 | opixmapeffect.cpp \ | 29 | opixmapeffect.cpp \ |
32 | opopupmenu.cpp \ | 30 | opopupmenu.cpp \ |
33 | opixmapprovider.cpp \ | 31 | opixmapprovider.cpp \ |
34 | oresource.cpp \ | ||
35 | oselector.cpp \ | 32 | oselector.cpp \ |
36 | oseparator.cpp \ | 33 | oseparator.cpp \ |
37 | otabbar.cpp \ | 34 | otabbar.cpp \ |
38 | otabwidget.cpp \ | 35 | otabwidget.cpp \ |
diff --git a/libopie2/opieui/opixmapeffect.cpp b/libopie2/opieui/opixmapeffect.cpp index 05f851d..794c7b2 100644 --- a/libopie2/opieui/opixmapeffect.cpp +++ b/libopie2/opieui/opixmapeffect.cpp | |||
@@ -16,8 +16,10 @@ | |||
16 | 16 | ||
17 | #include <opie2/opixmapeffect.h> | 17 | #include <opie2/opixmapeffect.h> |
18 | #include <opie2/oimageeffect.h> | 18 | #include <opie2/oimageeffect.h> |
19 | 19 | ||
20 | |||
21 | using namespace Opie::Ui; | ||
20 | //====================================================================== | 22 | //====================================================================== |
21 | // | 23 | // |
22 | // Gradient effects | 24 | // Gradient effects |
23 | // | 25 | // |
diff --git a/libopie2/opieui/opixmapeffect.h b/libopie2/opieui/opixmapeffect.h index 283fe2d..b780f9f 100644 --- a/libopie2/opieui/opixmapeffect.h +++ b/libopie2/opieui/opixmapeffect.h | |||
@@ -14,8 +14,11 @@ | |||
14 | #include <qsize.h> | 14 | #include <qsize.h> |
15 | typedef QPixmap OPixmap; | 15 | typedef QPixmap OPixmap; |
16 | class QColor; | 16 | class QColor; |
17 | 17 | ||
18 | |||
19 | namespace Opie { | ||
20 | namespace Ui { | ||
18 | /** | 21 | /** |
19 | * This class includes various pixmap-based graphical effects. | 22 | * This class includes various pixmap-based graphical effects. |
20 | * | 23 | * |
21 | * Everything is | 24 | * Everything is |
@@ -209,7 +212,8 @@ public: | |||
209 | * @param col the selected color, usually from QColorGroup::highlight(). | 212 | * @param col the selected color, usually from QColorGroup::highlight(). |
210 | */ | 213 | */ |
211 | static OPixmap selectedPixmap( const OPixmap &pixmap, const QColor &col ); | 214 | static OPixmap selectedPixmap( const OPixmap &pixmap, const QColor &col ); |
212 | }; | 215 | }; |
213 | 216 | } | |
217 | } | ||
214 | 218 | ||
215 | #endif | 219 | #endif |
diff --git a/libopie2/opieui/opixmapprovider.cpp b/libopie2/opieui/opixmapprovider.cpp index 7be9e3b..7eb67a2 100644 --- a/libopie2/opieui/opixmapprovider.cpp +++ b/libopie2/opieui/opixmapprovider.cpp | |||
@@ -19,8 +19,10 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <opie2/opixmapprovider.h> | 21 | #include <opie2/opixmapprovider.h> |
22 | 22 | ||
23 | using namespace Opie::Ui; | ||
24 | |||
23 | OPixmapProvider::~OPixmapProvider() {} | 25 | OPixmapProvider::~OPixmapProvider() {} |
24 | 26 | ||
25 | void OPixmapProvider::virtual_hook( int , void* ) | 27 | void OPixmapProvider::virtual_hook( int , void* ) |
26 | { /*BASE::virtual_hook( id, data );*/ } | 28 | { /*BASE::virtual_hook( id, data );*/ } |
diff --git a/libopie2/opieui/opixmapprovider.h b/libopie2/opieui/opixmapprovider.h index 5b76647..9d9bd69 100644 --- a/libopie2/opieui/opixmapprovider.h +++ b/libopie2/opieui/opixmapprovider.h | |||
@@ -22,9 +22,12 @@ | |||
22 | #define OPIXMAPPROVIDER_H | 22 | #define OPIXMAPPROVIDER_H |
23 | 23 | ||
24 | #include <qpixmap.h> | 24 | #include <qpixmap.h> |
25 | 25 | ||
26 | namespace Opie { | ||
27 | namespace Ui { | ||
26 | /** | 28 | /** |
29 | * \todo make usefull | ||
27 | * A tiny abstract class with just one method: | 30 | * A tiny abstract class with just one method: |
28 | * @ref pixmapFor() | 31 | * @ref pixmapFor() |
29 | * | 32 | * |
30 | * It will be called whenever an icon is searched for @p text. | 33 | * It will be called whenever an icon is searched for @p text. |
@@ -47,8 +50,13 @@ public: | |||
47 | */ | 50 | */ |
48 | virtual QPixmap pixmapFor( const QString& text, int size = 0 ) = 0; | 51 | virtual QPixmap pixmapFor( const QString& text, int size = 0 ) = 0; |
49 | protected: | 52 | protected: |
50 | virtual void virtual_hook( int id, void* data ); | 53 | virtual void virtual_hook( int id, void* data ); |
54 | private: | ||
55 | class Private; | ||
56 | Private *d; | ||
51 | }; | 57 | }; |
52 | 58 | ||
59 | } | ||
60 | } | ||
53 | 61 | ||
54 | #endif // OPIXMAPPROVIDER_H | 62 | #endif // OPIXMAPPROVIDER_H |
diff --git a/libopie2/opieui/opopupmenu.cpp b/libopie2/opieui/opopupmenu.cpp index d5cc575..3ab8490 100644 --- a/libopie2/opieui/opopupmenu.cpp +++ b/libopie2/opieui/opopupmenu.cpp | |||
@@ -26,8 +26,11 @@ | |||
26 | 26 | ||
27 | #include <opie2/opopupmenu.h> | 27 | #include <opie2/opopupmenu.h> |
28 | #include <opie2/oconfig.h> | 28 | #include <opie2/oconfig.h> |
29 | 29 | ||
30 | using namespace Opie::Core; | ||
31 | using namespace Opie::Ui; | ||
32 | |||
30 | OPopupTitle::OPopupTitle(QWidget *parent, const char *name) | 33 | OPopupTitle::OPopupTitle(QWidget *parent, const char *name) |
31 | : QWidget(parent, name) | 34 | : QWidget(parent, name) |
32 | { | 35 | { |
33 | setMinimumSize(16, fontMetrics().height()+8); | 36 | setMinimumSize(16, fontMetrics().height()+8); |
diff --git a/libopie2/opieui/opopupmenu.h b/libopie2/opieui/opopupmenu.h index 54e4301..419a954 100644 --- a/libopie2/opieui/opopupmenu.h +++ b/libopie2/opieui/opopupmenu.h | |||
@@ -30,8 +30,10 @@ | |||
30 | /* OPIE */ | 30 | /* OPIE */ |
31 | 31 | ||
32 | #include <opie2/opixmapeffect.h> | 32 | #include <opie2/opixmapeffect.h> |
33 | 33 | ||
34 | namespace Opie { | ||
35 | namespace Ui { | ||
34 | /** | 36 | /** |
35 | * Title widget for use in @ref OPopupMenu. | 37 | * Title widget for use in @ref OPopupMenu. |
36 | * | 38 | * |
37 | * You usually don't have to create this manually since | 39 | * You usually don't have to create this manually since |
@@ -255,5 +257,8 @@ private: | |||
255 | class OPopupMenuPrivate; | 257 | class OPopupMenuPrivate; |
256 | OPopupMenuPrivate *d; | 258 | OPopupMenuPrivate *d; |
257 | }; | 259 | }; |
258 | 260 | ||
261 | } | ||
262 | } | ||
263 | |||
259 | #endif | 264 | #endif |
diff --git a/libopie2/opieui/oselector.cpp b/libopie2/opieui/oselector.cpp index 23b3ce3..5f6f10f 100644 --- a/libopie2/opieui/oselector.cpp +++ b/libopie2/opieui/oselector.cpp | |||
@@ -35,8 +35,10 @@ | |||
35 | * 2D value selector. | 35 | * 2D value selector. |
36 | * The contents of the selector are drawn by derived class. | 36 | * The contents of the selector are drawn by derived class. |
37 | */ | 37 | */ |
38 | 38 | ||
39 | using namespace Opie::Ui; | ||
40 | |||
39 | OXYSelector::OXYSelector( QWidget *parent, const char *name ) | 41 | OXYSelector::OXYSelector( QWidget *parent, const char *name ) |
40 | : QWidget( parent, name ) | 42 | : QWidget( parent, name ) |
41 | { | 43 | { |
42 | xPos = 0; | 44 | xPos = 0; |
@@ -72,9 +74,9 @@ void OXYSelector::setValues( int _xPos, int _yPos ) | |||
72 | if ( xPos > maxX ) | 74 | if ( xPos > maxX ) |
73 | xPos = maxX; | 75 | xPos = maxX; |
74 | else if ( xPos < minX ) | 76 | else if ( xPos < minX ) |
75 | xPos = minX; | 77 | xPos = minX; |
76 | 78 | ||
77 | if ( yPos > maxY ) | 79 | if ( yPos > maxY ) |
78 | yPos = maxY; | 80 | yPos = maxY; |
79 | else if ( yPos < minY ) | 81 | else if ( yPos < minY ) |
80 | yPos = minY; | 82 | yPos = minY; |
@@ -257,9 +259,9 @@ void OSelector::paintEvent( QPaintEvent * ) | |||
257 | colorGroup(), TRUE, 2, &brush ); | 259 | colorGroup(), TRUE, 2, &brush ); |
258 | } | 260 | } |
259 | 261 | ||
260 | QPoint pos = calcArrowPos( value() ); | 262 | QPoint pos = calcArrowPos( value() ); |
261 | drawArrow( &painter, TRUE, pos ); | 263 | drawArrow( &painter, TRUE, pos ); |
262 | 264 | ||
263 | painter.end(); | 265 | painter.end(); |
264 | } | 266 | } |
265 | 267 | ||
@@ -287,12 +289,12 @@ void OSelector::valueChange() | |||
287 | 289 | ||
288 | painter.begin( this ); | 290 | painter.begin( this ); |
289 | 291 | ||
290 | pos = calcArrowPos( prevValue() ); | 292 | pos = calcArrowPos( prevValue() ); |
291 | drawArrow( &painter, FALSE, pos ); | 293 | drawArrow( &painter, FALSE, pos ); |
292 | 294 | ||
293 | pos = calcArrowPos( value() ); | 295 | pos = calcArrowPos( value() ); |
294 | drawArrow( &painter, TRUE, pos ); | 296 | drawArrow( &painter, TRUE, pos ); |
295 | 297 | ||
296 | painter.end(); | 298 | painter.end(); |
297 | } | 299 | } |
298 | 300 | ||
@@ -360,10 +362,10 @@ void OSelector::drawArrow( QPainter *painter, bool show, const QPoint &pos ) | |||
360 | array.setPoint( 2, pos.x()-5, pos.y()+5 ); | 362 | array.setPoint( 2, pos.x()-5, pos.y()+5 ); |
361 | } | 363 | } |
362 | 364 | ||
363 | painter->drawPolygon( array ); | 365 | painter->drawPolygon( array ); |
364 | } | 366 | } |
365 | else | 367 | else |
366 | { | 368 | { |
367 | if ( orientation() == Vertical ) | 369 | if ( orientation() == Vertical ) |
368 | { | 370 | { |
369 | repaint(pos.x(), pos.y()-5, 6, 11, true); | 371 | repaint(pos.x(), pos.y()-5, 6, 11, true); |
@@ -399,9 +401,9 @@ OGradientSelector::~OGradientSelector() | |||
399 | void OGradientSelector::init() | 401 | void OGradientSelector::init() |
400 | { | 402 | { |
401 | color1.setRgb( 0, 0, 0 ); | 403 | color1.setRgb( 0, 0, 0 ); |
402 | color2.setRgb( 255, 255, 255 ); | 404 | color2.setRgb( 255, 255, 255 ); |
403 | 405 | ||
404 | text1 = text2 = ""; | 406 | text1 = text2 = ""; |
405 | } | 407 | } |
406 | 408 | ||
407 | 409 | ||
@@ -471,9 +473,9 @@ void OGradientSelector::drawContents( QPainter *painter ) | |||
471 | painter->setPen( pen ); | 473 | painter->setPen( pen ); |
472 | painter->drawText( xPos, yPos, text2 ); | 474 | painter->drawText( xPos, yPos, text2 ); |
473 | 475 | ||
474 | yPos = contentsRect().bottom() - painter->fontMetrics().descent() - 2; | 476 | yPos = contentsRect().bottom() - painter->fontMetrics().descent() - 2; |
475 | xPos = contentsRect().left() + (contentsRect().width() - | 477 | xPos = contentsRect().left() + (contentsRect().width() - |
476 | painter->fontMetrics().width( text1 )) / 2; | 478 | painter->fontMetrics().width( text1 )) / 2; |
477 | pen.setColor( color1 ); | 479 | pen.setColor( color1 ); |
478 | painter->setPen( pen ); | 480 | painter->setPen( pen ); |
479 | painter->drawText( xPos, yPos, text1 ); | 481 | painter->drawText( xPos, yPos, text1 ); |
diff --git a/libopie2/opieui/oselector.h b/libopie2/opieui/oselector.h index f832239..fe75a46 100644 --- a/libopie2/opieui/oselector.h +++ b/libopie2/opieui/oselector.h | |||
@@ -26,8 +26,11 @@ | |||
26 | #include <qwidget.h> | 26 | #include <qwidget.h> |
27 | #include <qrangecontrol.h> | 27 | #include <qrangecontrol.h> |
28 | #include <qpixmap.h> | 28 | #include <qpixmap.h> |
29 | 29 | ||
30 | |||
31 | namespace Opie { | ||
32 | namespace Ui { | ||
30 | /** | 33 | /** |
31 | * OXYSelector is the base class for other widgets which | 34 | * OXYSelector is the base class for other widgets which |
32 | * provides the ability to choose from a two-dimensional | 35 | * provides the ability to choose from a two-dimensional |
33 | * range of values. The currently chosen value is indicated | 36 | * range of values. The currently chosen value is indicated |
@@ -511,8 +514,10 @@ private: | |||
511 | class OColorPrivate; | 514 | class OColorPrivate; |
512 | OColorPrivate *d; | 515 | OColorPrivate *d; |
513 | }; | 516 | }; |
514 | 517 | ||
518 | } | ||
519 | } | ||
515 | 520 | ||
516 | 521 | ||
517 | #endif // __OSELECT_H__ | 522 | #endif // __OSELECT_H__ |
518 | 523 | ||
diff --git a/libopie2/opieui/oseparator.cpp b/libopie2/opieui/oseparator.cpp index b93c225..bbc4381 100644 --- a/libopie2/opieui/oseparator.cpp +++ b/libopie2/opieui/oseparator.cpp | |||
@@ -35,8 +35,10 @@ | |||
35 | #include <opie2/oseparator.h> | 35 | #include <opie2/oseparator.h> |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | 38 | ||
39 | using namespace Opie::Core; | ||
40 | using namespace Opie::Ui; | ||
39 | 41 | ||
40 | OSeparator::OSeparator(QWidget* parent, const char* name, WFlags f) | 42 | OSeparator::OSeparator(QWidget* parent, const char* name, WFlags f) |
41 | : QFrame(parent, name, f) | 43 | : QFrame(parent, name, f) |
42 | { | 44 | { |
diff --git a/libopie2/opieui/oseparator.h b/libopie2/opieui/oseparator.h index e59b3f4..6fc4344 100644 --- a/libopie2/opieui/oseparator.h +++ b/libopie2/opieui/oseparator.h | |||
@@ -34,8 +34,11 @@ | |||
34 | #define OSEPARATOR_H | 34 | #define OSEPARATOR_H |
35 | 35 | ||
36 | #include <qframe.h> | 36 | #include <qframe.h> |
37 | 37 | ||
38 | namespace Opie { | ||
39 | namespace Ui { | ||
40 | |||
38 | /** | 41 | /** |
39 | * Standard horizontal or vertical separator. | 42 | * Standard horizontal or vertical separator. |
40 | * | 43 | * |
41 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | 44 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> |
@@ -85,6 +88,8 @@ protected: | |||
85 | private: | 88 | private: |
86 | class OSeparatorPrivate* d; | 89 | class OSeparatorPrivate* d; |
87 | }; | 90 | }; |
88 | 91 | ||
92 | } | ||
93 | } | ||
89 | 94 | ||
90 | #endif // OSEPARATOR_H | 95 | #endif // OSEPARATOR_H |
diff --git a/libopie2/opieui/otabbar.cpp b/libopie2/opieui/otabbar.cpp index cd3a34b..a62e18b 100644 --- a/libopie2/opieui/otabbar.cpp +++ b/libopie2/opieui/otabbar.cpp | |||
@@ -30,9 +30,9 @@ | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include <opie2/otabbar.h> | 32 | #include <opie2/otabbar.h> |
33 | 33 | ||
34 | using namespace Opie; | 34 | using namespace Opie::Ui; |
35 | 35 | ||
36 | OTabBar::OTabBar( QWidget *parent , const char *name ) | 36 | OTabBar::OTabBar( QWidget *parent , const char *name ) |
37 | :QTabBar( parent, name ) | 37 | :QTabBar( parent, name ) |
38 | {} | 38 | {} |
diff --git a/libopie2/opieui/otabbar.h b/libopie2/opieui/otabbar.h index 2f35c85..925ae96 100644 --- a/libopie2/opieui/otabbar.h +++ b/libopie2/opieui/otabbar.h | |||
@@ -34,10 +34,10 @@ | |||
34 | 34 | ||
35 | /* QT */ | 35 | /* QT */ |
36 | #include <qtabbar.h> | 36 | #include <qtabbar.h> |
37 | 37 | ||
38 | namespace Opie | 38 | namespace Opie { |
39 | { | 39 | namespace Ui { |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * @class OTabBar | 42 | * @class OTabBar |
43 | * @brief The OTabBar class is a derivative of QTabBar. | 43 | * @brief The OTabBar class is a derivative of QTabBar. |
@@ -79,7 +79,8 @@ private: | |||
79 | class Private; | 79 | class Private; |
80 | Private *d; | 80 | Private *d; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | }; | 83 | } |
84 | } | ||
84 | 85 | ||
85 | #endif | 86 | #endif |
diff --git a/libopie2/opieui/otabinfo.h b/libopie2/opieui/otabinfo.h index 4a6ce14..426c45a 100644 --- a/libopie2/opieui/otabinfo.h +++ b/libopie2/opieui/otabinfo.h | |||
@@ -37,10 +37,10 @@ | |||
37 | #include <qstring.h> | 37 | #include <qstring.h> |
38 | 38 | ||
39 | class QWidget; | 39 | class QWidget; |
40 | 40 | ||
41 | namespace Opie | 41 | namespace Opie{ |
42 | { | 42 | namespace Ui { |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * @class OTabInfo | 45 | * @class OTabInfo |
46 | * @brief The OTabInfo class is used internally by OTabWidget to keep track | 46 | * @brief The OTabInfo class is used internally by OTabWidget to keep track |
@@ -134,7 +134,8 @@ private: | |||
134 | * @brief A list of OTabInfo objects used by OTabWidget. | 134 | * @brief A list of OTabInfo objects used by OTabWidget. |
135 | */ | 135 | */ |
136 | typedef QList<OTabInfo> OTabInfoList; | 136 | typedef QList<OTabInfo> OTabInfoList; |
137 | 137 | ||
138 | }; | 138 | } |
139 | } | ||
139 | 140 | ||
140 | #endif | 141 | #endif |
diff --git a/libopie2/opieui/otabwidget.cpp b/libopie2/opieui/otabwidget.cpp index f47c90b..a9f7da9 100644 --- a/libopie2/opieui/otabwidget.cpp +++ b/libopie2/opieui/otabwidget.cpp | |||
@@ -40,9 +40,9 @@ | |||
40 | /* QT */ | 40 | /* QT */ |
41 | #include <qcombobox.h> | 41 | #include <qcombobox.h> |
42 | #include <qwidgetstack.h> | 42 | #include <qwidgetstack.h> |
43 | 43 | ||
44 | using namespace Opie; | 44 | using namespace Opie::Ui; |
45 | 45 | ||
46 | OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPosition p ) | 46 | OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPosition p ) |
47 | : QWidget( parent, name ) | 47 | : QWidget( parent, name ) |
48 | { | 48 | { |
diff --git a/libopie2/opieui/otabwidget.h b/libopie2/opieui/otabwidget.h index 092f22c..6a64b7d 100644 --- a/libopie2/opieui/otabwidget.h +++ b/libopie2/opieui/otabwidget.h | |||
@@ -37,17 +37,16 @@ | |||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qwidget.h> | 38 | #include <qwidget.h> |
39 | #include <qlist.h> | 39 | #include <qlist.h> |
40 | 40 | ||
41 | using namespace Opie; | ||
42 | 41 | ||
43 | class QComboBox; | 42 | class QComboBox; |
44 | class QPixmap; | 43 | class QPixmap; |
45 | class QTabBar; | 44 | class QTabBar; |
46 | class QWidgetStack; | 45 | class QWidgetStack; |
47 | 46 | ||
48 | namespace Opie | 47 | namespace Opie { |
49 | { | 48 | namespace Ui { |
50 | 49 | ||
51 | class OTabBar; | 50 | class OTabBar; |
52 | 51 | ||
53 | /** | 52 | /** |
@@ -286,7 +285,8 @@ private: | |||
286 | */ | 285 | */ |
287 | void slotTabListSelected( int ); | 286 | void slotTabListSelected( int ); |
288 | }; | 287 | }; |
289 | 288 | ||
290 | }; | 289 | } |
290 | } | ||
291 | 291 | ||
292 | #endif | 292 | #endif |
diff --git a/libopie2/opieui/otaskbarapplet.cpp b/libopie2/opieui/otaskbarapplet.cpp index a67356d..b5268f0 100644 --- a/libopie2/opieui/otaskbarapplet.cpp +++ b/libopie2/opieui/otaskbarapplet.cpp | |||
@@ -27,6 +27,56 @@ | |||
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
30 | */ | 30 | */ |
31 | #include <opie2/otaskbarapplet.h> | ||
32 | |||
33 | #include <qpe/qpeapplication.h> | ||
34 | #include <qframe.h> | ||
35 | |||
36 | using namespace Opie::Ui; | ||
37 | |||
38 | |||
39 | /** | ||
40 | * \todo no example yet!!! | ||
41 | * If you want to implement an Applet for the Opie Taskbar | ||
42 | * use this interface. | ||
43 | * The only specail thing about applets is that you need to build | ||
44 | * it as plugin/library and do EXPORT_OPIE_APPLET_v1( YourApplet ) | ||
45 | * at the bottom of your application. This takes care of | ||
46 | * the activation and implementing the TaskbarAppletInterface. | ||
47 | * You also need to add a static int position() functions to your | ||
48 | * application. | ||
49 | * \code | ||
50 | * class MyApplet : public OTaskBarApplet { | ||
51 | * public: | ||
52 | * static int position() { return 3: } | ||
53 | * void doStuff() { | ||
54 | * popup( myWidget ); | ||
55 | * } | ||
56 | * }; | ||
57 | * EXPORT_OPIE_APPLET_v1( MyApplet ) | ||
58 | * \endcode | ||
59 | * | ||
60 | * @author Michael Lauer | ||
61 | * @version 0.5 | ||
62 | * @see TaskbarAppletInterface | ||
63 | */ | ||
64 | OTaskbarApplet::OTaskbarApplet( QWidget* parent, const char* name ) | ||
65 | :QWidget( parent, name ){ | ||
66 | setFixedHeight( 18 ); | ||
67 | setFixedWidth( 14 ); | ||
68 | } | ||
69 | |||
70 | OTaskbarApplet::~OTaskbarApplet(){ | ||
71 | } | ||
72 | |||
73 | void OTaskbarApplet::popup( QWidget* widget ){ | ||
74 | QPoint curPos = mapToGlobal( QPoint( 0, 0 ) ); | ||
75 | int w = widget->sizeHint().width(); | ||
76 | int x = curPos.x() - (w/2 ); | ||
77 | if ( (x+w) > QPEApplication::desktop()->width() ) | ||
78 | x = QPEApplication::desktop()->width()-w; | ||
79 | widget->move( x, curPos.y()-widget->sizeHint().height() ); | ||
80 | widget->show(); | ||
81 | } | ||
31 | 82 | ||
32 | // Empty on purpose until we shipped Opie 1.0 (see otaskbarapplet.h for explanation) | ||
diff --git a/libopie2/opieui/otaskbarapplet.h b/libopie2/opieui/otaskbarapplet.h index 074367f..0c85ee7 100644 --- a/libopie2/opieui/otaskbarapplet.h +++ b/libopie2/opieui/otaskbarapplet.h | |||
@@ -32,13 +32,22 @@ | |||
32 | #ifndef OTASKBARAPPLET_H | 32 | #ifndef OTASKBARAPPLET_H |
33 | #define OTASKBARAPPLET_H | 33 | #define OTASKBARAPPLET_H |
34 | 34 | ||
35 | #include <qpe/taskbarappletinterface.h> | 35 | #include <qpe/taskbarappletinterface.h> |
36 | #include <qpe/qcom.h> | ||
36 | 37 | ||
38 | #include <qwidget.h> | ||
39 | |||
40 | class QMouseEvent; | ||
41 | |||
42 | namespace Opie { | ||
43 | namespace Ui { | ||
44 | namespace Private { | ||
37 | /*====================================================================================== | 45 | /*====================================================================================== |
38 | * OTaskbarAppletWrapper | 46 | * OTaskbarAppletWrapper |
39 | *======================================================================================*/ | 47 | *======================================================================================*/ |
40 | 48 | ||
49 | class OTaskbarAppletWrapperPrivate; | ||
41 | template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface | 50 | template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface |
42 | { | 51 | { |
43 | public: | 52 | public: |
44 | OTaskbarAppletWrapper():_applet( 0 ) | 53 | OTaskbarAppletWrapper():_applet( 0 ) |
@@ -79,16 +88,12 @@ template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface | |||
79 | } | 88 | } |
80 | 89 | ||
81 | private: | 90 | private: |
82 | T* _applet; | 91 | T* _applet; |
92 | OTaskbarAppletWrapperPrivate *d; | ||
83 | }; | 93 | }; |
84 | 94 | ||
85 | #include <qframe.h> | 95 | } |
86 | #include <qwidget.h> | ||
87 | #include <qpe/qpeapplication.h> | ||
88 | |||
89 | class QMouseEvent; | ||
90 | |||
91 | /*====================================================================================== | 96 | /*====================================================================================== |
92 | * OTaskbarApplet | 97 | * OTaskbarApplet |
93 | *======================================================================================*/ | 98 | *======================================================================================*/ |
94 | 99 | ||
@@ -102,29 +107,23 @@ class QMouseEvent; | |||
102 | 107 | ||
103 | class OTaskbarApplet : public QWidget | 108 | class OTaskbarApplet : public QWidget |
104 | { | 109 | { |
105 | public: | 110 | public: |
106 | OTaskbarApplet( QWidget* parent, const char* name = 0 ):QWidget( parent, name ) | 111 | OTaskbarApplet( QWidget* parent, const char* name = 0 ); |
107 | { | 112 | virtual ~OTaskbarApplet(); |
108 | setFixedHeight( 18 ); | ||
109 | setFixedWidth( 14 ); | ||
110 | } | ||
111 | |||
112 | virtual ~OTaskbarApplet() | ||
113 | { | ||
114 | } | ||
115 | 113 | ||
116 | protected: | 114 | protected: |
117 | virtual void popup( QWidget* widget ) | 115 | virtual void popup( QWidget* widget ); |
118 | { | 116 | private: |
119 | QPoint curPos = mapToGlobal( QPoint( 0, 0 ) ); | 117 | class Private; |
120 | int w = widget->sizeHint().width(); | 118 | Private *d; |
121 | int x = curPos.x() - (w/2 ); | ||
122 | if ( (x+w) > QPEApplication::desktop()->width() ) | ||
123 | x = QPEApplication::desktop()->width()-w; | ||
124 | widget->move( x, curPos.y()-widget->sizeHint().height() ); | ||
125 | widget->show(); | ||
126 | } | ||
127 | }; | 119 | }; |
120 | } | ||
121 | } | ||
122 | |||
123 | #define EXPORT_OPIE_APPLET_v1( AppLet ) \ | ||
124 | Q_EXPORT_INTERFACE() { \ | ||
125 | Q_CREATE_INSTANCE( Opie::Ui::Private::OTaskbarAppletWrapper<AppLet> ) \ | ||
126 | } | ||
128 | 127 | ||
129 | #endif | 128 | #endif |
130 | 129 | ||
diff --git a/libopie2/opieui/otimepicker.cpp b/libopie2/opieui/otimepicker.cpp index 66f9ce0..7de0fd3 100644 --- a/libopie2/opieui/otimepicker.cpp +++ b/libopie2/opieui/otimepicker.cpp | |||
@@ -26,16 +26,20 @@ | |||
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | /* OPIE */ | ||
31 | #include <opie2/otimepicker.h> | ||
32 | |||
30 | /* QT */ | 33 | /* QT */ |
34 | #include <qgroupbox.h> | ||
31 | #include <qlayout.h> | 35 | #include <qlayout.h> |
32 | #include <qlineedit.h> | 36 | #include <qlineedit.h> |
33 | 37 | ||
34 | /* OPIE */ | ||
35 | #include <opie2/otimepicker.h> | ||
36 | 38 | ||
37 | using namespace Opie; | 39 | |
40 | namespace Opie { | ||
41 | namespace Ui { | ||
38 | 42 | ||
39 | /** | 43 | /** |
40 | * Constructs the widget | 44 | * Constructs the widget |
41 | * @param parent The parent of the OTimePicker | 45 | * @param parent The parent of the OTimePicker |
@@ -219,8 +223,10 @@ void OTimePicker::setHour(int h) | |||
219 | */ | 223 | */ |
220 | OTimePickerDialog::OTimePickerDialog ( QWidget* parent, const char* name, WFlags fl ) | 224 | OTimePickerDialog::OTimePickerDialog ( QWidget* parent, const char* name, WFlags fl ) |
221 | : OTimePickerDialogBase (parent , name, true , fl) | 225 | : OTimePickerDialogBase (parent , name, true , fl) |
222 | { | 226 | { |
227 | m_timePicker = new OTimePicker( GroupBox1, "m_timePicker" ); | ||
228 | GroupBox1Layout->addWidget( m_timePicker, 0, 0 ); | ||
223 | 229 | ||
224 | connect ( m_timePicker, SIGNAL( timeChanged(const QTime&) ), | 230 | connect ( m_timePicker, SIGNAL( timeChanged(const QTime&) ), |
225 | this, SLOT( setTime(const QTime&) ) ); | 231 | this, SLOT( setTime(const QTime&) ) ); |
226 | connect ( minuteField, SIGNAL( textChanged(const QString&) ), | 232 | connect ( minuteField, SIGNAL( textChanged(const QString&) ), |
@@ -289,4 +295,7 @@ void OTimePickerDialog::setMinute ( const QString& minute ) | |||
289 | m_time.setHMS ( m_time.hour(), minute.toInt(), 00 ); | 295 | m_time.setHMS ( m_time.hour(), minute.toInt(), 00 ); |
290 | setTime ( m_time ); | 296 | setTime ( m_time ); |
291 | } | 297 | } |
292 | } | 298 | } |
299 | |||
300 | } | ||
301 | } | ||
diff --git a/libopie2/opieui/otimepicker.h b/libopie2/opieui/otimepicker.h index 2da7773..01bb557 100644 --- a/libopie2/opieui/otimepicker.h +++ b/libopie2/opieui/otimepicker.h | |||
@@ -31,20 +31,19 @@ | |||
31 | #define OTIMEPICKER_H | 31 | #define OTIMEPICKER_H |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/oclickablelabel.h> | 34 | #include <opie2/oclickablelabel.h> |
35 | #include "otimepickerbase.h" | 35 | #include <opie2/otimepickerbase.h> |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qwidget.h> | 38 | #include <qwidget.h> |
39 | #include <qvaluelist.h> | 39 | #include <qvaluelist.h> |
40 | #include <qdatetime.h> | 40 | #include <qdatetime.h> |
41 | #include <qdialog.h> | 41 | #include <qdialog.h> |
42 | 42 | ||
43 | using namespace Opie; | ||
44 | 43 | ||
45 | // namespace Opie | 44 | namespace Opie { |
46 | // { | 45 | namespace Ui { |
47 | 46 | ||
48 | /** | 47 | /** |
49 | * A class to pick time. It uses clickable labels | 48 | * A class to pick time. It uses clickable labels |
50 | * internally to allow a quick selection of a time. | 49 | * internally to allow a quick selection of a time. |
@@ -55,9 +54,9 @@ using namespace Opie; | |||
55 | * @see QWidget | 54 | * @see QWidget |
56 | * @see QTime | 55 | * @see QTime |
57 | * @author Hakan Ardo, Stefan Eilers | 56 | * @author Hakan Ardo, Stefan Eilers |
58 | */ | 57 | */ |
59 | class OTimePicker: public QWidget | 58 | class OTimePicker : public QWidget |
60 | { | 59 | { |
61 | Q_OBJECT | 60 | Q_OBJECT |
62 | 61 | ||
63 | public: | 62 | public: |
@@ -113,13 +112,21 @@ public slots: | |||
113 | void setHour( const QString& hour ); | 112 | void setHour( const QString& hour ); |
114 | void setMinute( const QString& minute ); | 113 | void setMinute( const QString& minute ); |
115 | 114 | ||
116 | private: | 115 | private: |
116 | OTimePicker *m_timePicker; | ||
117 | QTime m_time; | 117 | QTime m_time; |
118 | class Private; | 118 | class Private; |
119 | Private* d; | 119 | Private* d; |
120 | }; | 120 | }; |
121 | 121 | ||
122 | // }; | 122 | } |
123 | } | ||
123 | 124 | ||
125 | /* for Qt2 */ | ||
126 | #if ( QT_VERSION-0 >= 0x030000 ) | ||
127 | #error "Fix the UI File to use namespaces" | ||
128 | #else | ||
129 | typedef Opie::Ui::OTimePicker OUIOTimePicker; | ||
130 | #endif | ||
124 | #endif | 131 | #endif |
125 | 132 | ||
diff --git a/libopie2/opieui/otimepickerbase.ui b/libopie2/opieui/otimepickerbase.ui index 3e7f2fb..c2eb7c5 100644 --- a/libopie2/opieui/otimepickerbase.ui +++ b/libopie2/opieui/otimepickerbase.ui | |||
@@ -10,9 +10,9 @@ | |||
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>210</width> | 14 | <width>182</width> |
15 | <height>137</height> | 15 | <height>137</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
@@ -248,45 +248,9 @@ | |||
248 | <property stdset="1"> | 248 | <property stdset="1"> |
249 | <name>spacing</name> | 249 | <name>spacing</name> |
250 | <number>6</number> | 250 | <number>6</number> |
251 | </property> | 251 | </property> |
252 | <widget row="0" column="0" > | ||
253 | <class>OTimePicker</class> | ||
254 | <property stdset="1"> | ||
255 | <name>name</name> | ||
256 | <cstring>m_timePicker</cstring> | ||
257 | </property> | ||
258 | <property stdset="1"> | ||
259 | <name>sizePolicy</name> | ||
260 | <sizepolicy> | ||
261 | <hsizetype>3</hsizetype> | ||
262 | <vsizetype>3</vsizetype> | ||
263 | </sizepolicy> | ||
264 | </property> | ||
265 | </widget> | ||
266 | </grid> | 252 | </grid> |
267 | </widget> | 253 | </widget> |
268 | </vbox> | 254 | </vbox> |
269 | </widget> | 255 | </widget> |
270 | <customwidgets> | ||
271 | <customwidget> | ||
272 | <class>OTimePicker</class> | ||
273 | <header location="local">otimepicker.h</header> | ||
274 | <sizehint> | ||
275 | <width>-1</width> | ||
276 | <height>-1</height> | ||
277 | </sizehint> | ||
278 | <container>0</container> | ||
279 | <sizepolicy> | ||
280 | <hordata>7</hordata> | ||
281 | <verdata>1</verdata> | ||
282 | </sizepolicy> | ||
283 | <pixmap>image0</pixmap> | ||
284 | </customwidget> | ||
285 | </customwidgets> | ||
286 | <images> | ||
287 | <image> | ||
288 | <name>image0</name> | ||
289 | <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data> | ||
290 | </image> | ||
291 | </images> | ||
292 | </UI> | 256 | </UI> |
diff --git a/libopie2/opieui/oversatileview.cpp b/libopie2/opieui/oversatileview.cpp index 78154b7..f6c6410 100644 --- a/libopie2/opieui/oversatileview.cpp +++ b/libopie2/opieui/oversatileview.cpp | |||
@@ -39,8 +39,11 @@ | |||
39 | 39 | ||
40 | #include <qaction.h> | 40 | #include <qaction.h> |
41 | #include <qpopupmenu.h> | 41 | #include <qpopupmenu.h> |
42 | 42 | ||
43 | using namespace Opie::Core; | ||
44 | using namespace Opie::Ui; | ||
45 | |||
43 | /* XPM */ | 46 | /* XPM */ |
44 | static const char * view_icon_xpm[] = { | 47 | static const char * view_icon_xpm[] = { |
45 | "16 16 16 1", | 48 | "16 16 16 1", |
46 | " c None", | 49 | " c None", |
@@ -131,17 +134,17 @@ OVersatileView::OVersatileView( QWidget* parent, const char* name, int mode ) | |||
131 | _listview->setShowSortIndicator( true ); | 134 | _listview->setShowSortIndicator( true ); |
132 | _iconview->setGridX( 90 ); | 135 | _iconview->setGridX( 90 ); |
133 | _iconview->setGridY( 42 ); | 136 | _iconview->setGridY( 42 ); |
134 | _iconview->setAutoArrange( true ); | 137 | _iconview->setAutoArrange( true ); |
135 | 138 | ||
136 | #ifdef QWS // TODO: Let this depend on current geometry (rotation) | 139 | #ifdef QWS // TODO: Let this depend on current geometry (rotation) |
137 | _iconview->setArrangement( QIconView::TopToBottom ); | 140 | _iconview->setArrangement( QIconView::TopToBottom ); |
138 | #else | 141 | #else |
139 | _iconview->setArrangement( QIconView::LeftToRight ); | 142 | _iconview->setArrangement( QIconView::LeftToRight ); |
140 | #endif | 143 | #endif |
141 | 144 | ||
142 | _iconview->setResizeMode( QIconView::Adjust ); | 145 | _iconview->setResizeMode( QIconView::Adjust ); |
143 | 146 | ||
144 | // qt-embedded: map stylus right on hold to right button press | 147 | // qt-embedded: map stylus right on hold to right button press |
145 | 148 | ||
146 | #ifdef QWS | 149 | #ifdef QWS |
147 | ( (QPEApplication*) qApp)->setStylusOperation( _iconview->viewport(), QPEApplication::RightOnHold ); | 150 | ( (QPEApplication*) qApp)->setStylusOperation( _iconview->viewport(), QPEApplication::RightOnHold ); |
@@ -167,59 +170,59 @@ OVersatileView::OVersatileView( QWidget* parent, const char* name, int mode ) | |||
167 | else if ( mode == Tree ) | 170 | else if ( mode == Tree ) |
168 | a2->setOn( true ); | 171 | a2->setOn( true ); |
169 | connect( a1, SIGNAL( activated() ), this, SLOT( setIconViewMode() ) ); | 172 | connect( a1, SIGNAL( activated() ), this, SLOT( setIconViewMode() ) ); |
170 | connect( a2, SIGNAL( activated() ), this, SLOT( setTreeViewMode() ) ); | 173 | connect( a2, SIGNAL( activated() ), this, SLOT( setTreeViewMode() ) ); |
171 | 174 | ||
172 | #if (QT_VERSION >= 0x030000) | 175 | #if (QT_VERSION >= 0x030000) |
173 | connect( _listview, SIGNAL( contextMenuRequested(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); | 176 | connect( _listview, SIGNAL( contextMenuRequested(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); |
174 | connect( _iconview, SIGNAL( contextMenuRequested(QIconViewItem*,const QPoint&) ), this, SLOT( contextMenuRequested(QIconViewItem*,const QPoint&) ) ); | 177 | connect( _iconview, SIGNAL( contextMenuRequested(QIconViewItem*,const QPoint&) ), this, SLOT( contextMenuRequested(QIconViewItem*,const QPoint&) ) ); |
175 | #else | 178 | #else |
176 | connect( _listview, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); | 179 | connect( _listview, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); |
177 | connect( _iconview, SIGNAL( rightButtonPressed(QIconViewItem*,const QPoint&) ), this, SLOT( contextMenuRequested(QIconViewItem*,const QPoint&) ) ); | 180 | connect( _iconview, SIGNAL( rightButtonPressed(QIconViewItem*,const QPoint&) ), this, SLOT( contextMenuRequested(QIconViewItem*,const QPoint&) ) ); |
178 | #endif | 181 | #endif |
179 | 182 | ||
180 | // | 183 | // |
181 | // signal forwarders | 184 | // signal forwarders |
182 | // | 185 | // |
183 | // unfortunately we can't short-circuit all the QListView and QIconView signals | 186 | // unfortunately we can't short-circuit all the QListView and QIconView signals |
184 | // to OVersatileView signals, because the signal/slot mechanism doesn't allow | 187 | // to OVersatileView signals, because the signal/slot mechanism doesn't allow |
185 | // type-conversion :-( | 188 | // type-conversion :-( |
186 | 189 | ||
187 | // common signals for listview | 190 | // common signals for listview |
188 | 191 | ||
189 | connect( _listview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); | 192 | connect( _listview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); |
190 | connect( _listview, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( selectionChanged(QListViewItem*) ) ); | 193 | connect( _listview, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( selectionChanged(QListViewItem*) ) ); |
191 | connect( _listview, SIGNAL( currentChanged(QListViewItem*) ), this, SLOT( currentChanged(QListViewItem*) ) ); | 194 | connect( _listview, SIGNAL( currentChanged(QListViewItem*) ), this, SLOT( currentChanged(QListViewItem*) ) ); |
192 | connect( _listview, SIGNAL( clicked(QListViewItem*) ), this, SLOT( clicked(QListViewItem*) ) ); | 195 | connect( _listview, SIGNAL( clicked(QListViewItem*) ), this, SLOT( clicked(QListViewItem*) ) ); |
193 | connect( _listview, SIGNAL( pressed(QListViewItem*) ), this, SLOT( pressed(QListViewItem*) ) ); | 196 | connect( _listview, SIGNAL( pressed(QListViewItem*) ), this, SLOT( pressed(QListViewItem*) ) ); |
194 | 197 | ||
195 | connect( _listview, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( doubleClicked(QListViewItem*) ) ); | 198 | connect( _listview, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( doubleClicked(QListViewItem*) ) ); |
196 | connect( _listview, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( returnPressed(QListViewItem*) ) ); | 199 | connect( _listview, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( returnPressed(QListViewItem*) ) ); |
197 | 200 | ||
198 | connect( _listview, SIGNAL( onItem(QListViewItem*) ), this, SLOT( onItem(QListViewItem*) ) ); | 201 | connect( _listview, SIGNAL( onItem(QListViewItem*) ), this, SLOT( onItem(QListViewItem*) ) ); |
199 | connect( _listview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) ); | 202 | connect( _listview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) ); |
200 | 203 | ||
201 | // common signals for iconview | 204 | // common signals for iconview |
202 | 205 | ||
203 | connect( _iconview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); | 206 | connect( _iconview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); |
204 | connect( _iconview, SIGNAL( selectionChanged(QIconViewItem*) ), this, SLOT( selectionChanged(QIconViewItem*) ) ); | 207 | connect( _iconview, SIGNAL( selectionChanged(QIconViewItem*) ), this, SLOT( selectionChanged(QIconViewItem*) ) ); |
205 | connect( _iconview, SIGNAL( currentChanged(QIconViewItem*) ), this, SLOT( currentChanged(QIconViewItem*) ) ); | 208 | connect( _iconview, SIGNAL( currentChanged(QIconViewItem*) ), this, SLOT( currentChanged(QIconViewItem*) ) ); |
206 | connect( _iconview, SIGNAL( clicked(QIconViewItem*) ), this, SLOT( clicked(QIconViewItem*) ) ); | 209 | connect( _iconview, SIGNAL( clicked(QIconViewItem*) ), this, SLOT( clicked(QIconViewItem*) ) ); |
207 | connect( _iconview, SIGNAL( pressed(QIconViewItem*) ), this, SLOT( pressed(QIconViewItem*) ) ); | 210 | connect( _iconview, SIGNAL( pressed(QIconViewItem*) ), this, SLOT( pressed(QIconViewItem*) ) ); |
208 | 211 | ||
209 | connect( _iconview, SIGNAL( doubleClicked(QIconViewItem*) ), this, SLOT( doubleClicked(QIconViewItem*) ) ); | 212 | connect( _iconview, SIGNAL( doubleClicked(QIconViewItem*) ), this, SLOT( doubleClicked(QIconViewItem*) ) ); |
210 | connect( _iconview, SIGNAL( returnPressed(QIconViewItem*) ), this, SLOT( returnPressed(QIconViewItem*) ) ); | 213 | connect( _iconview, SIGNAL( returnPressed(QIconViewItem*) ), this, SLOT( returnPressed(QIconViewItem*) ) ); |
211 | 214 | ||
212 | connect( _iconview, SIGNAL( onItem(QIconViewItem*) ), this, SLOT( onItem(QIconViewItem*) ) ); | 215 | connect( _iconview, SIGNAL( onItem(QIconViewItem*) ), this, SLOT( onItem(QIconViewItem*) ) ); |
213 | connect( _iconview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) ); | 216 | connect( _iconview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) ); |
214 | 217 | ||
215 | // listview only signals | 218 | // listview only signals |
216 | 219 | ||
217 | connect( _listview, SIGNAL( expanded(QListViewItem*) ), this, SLOT( expanded(QListViewItem*) ) ); | 220 | connect( _listview, SIGNAL( expanded(QListViewItem*) ), this, SLOT( expanded(QListViewItem*) ) ); |
218 | connect( _listview, SIGNAL( collapsed(QListViewItem*) ), this, SLOT( collapsed(QListViewItem*) ) ); | 221 | connect( _listview, SIGNAL( collapsed(QListViewItem*) ), this, SLOT( collapsed(QListViewItem*) ) ); |
219 | 222 | ||
220 | // iconview only signals | 223 | // iconview only signals |
221 | 224 | ||
222 | connect( _iconview, SIGNAL( moved() ), this, SIGNAL( moved() ) ); | 225 | connect( _iconview, SIGNAL( moved() ), this, SIGNAL( moved() ) ); |
223 | } | 226 | } |
224 | 227 | ||
225 | OVersatileView::~OVersatileView() | 228 | OVersatileView::~OVersatileView() |
@@ -419,9 +422,9 @@ void OVersatileView::doubleClicked( QIconViewItem * item ) | |||
419 | void OVersatileView::returnPressed( QListViewItem * item ) | 422 | void OVersatileView::returnPressed( QListViewItem * item ) |
420 | { | 423 | { |
421 | emit( returnPressed( static_cast<OVersatileViewItem*>( item ) ) ); | 424 | emit( returnPressed( static_cast<OVersatileViewItem*>( item ) ) ); |
422 | } | 425 | } |
423 | 426 | ||
424 | void OVersatileView::returnPressed( QIconViewItem * item ) | 427 | void OVersatileView::returnPressed( QIconViewItem * item ) |
425 | { | 428 | { |
426 | emit( returnPressed( static_cast<OVersatileViewItem*>( item ) ) ); | 429 | emit( returnPressed( static_cast<OVersatileViewItem*>( item ) ) ); |
427 | } | 430 | } |
@@ -452,9 +455,9 @@ void OVersatileView::collapsed( QListViewItem *item ) // QListView | |||
452 | 455 | ||
453 | //=============================================================================================// | 456 | //=============================================================================================// |
454 | // OVersatileView Case I - API only existing in QListView or QIconView but not in both! | 457 | // OVersatileView Case I - API only existing in QListView or QIconView but not in both! |
455 | //==============================================================================================// | 458 | //==============================================================================================// |
456 | 459 | ||
457 | int OVersatileView::treeStepSize() const // QListView | 460 | int OVersatileView::treeStepSize() const // QListView |
458 | { | 461 | { |
459 | if ( !isValidViewMode( Tree ) ) | 462 | if ( !isValidViewMode( Tree ) ) |
460 | { | 463 | { |
@@ -744,9 +747,9 @@ void OVersatileView::triggerUpdate() // QListView | |||
744 | 747 | ||
745 | // | 748 | // |
746 | // only in QIconView | 749 | // only in QIconView |
747 | // | 750 | // |
748 | 751 | ||
749 | uint OVersatileView::count() const // QIconView | 752 | uint OVersatileView::count() const // QIconView |
750 | { | 753 | { |
751 | if ( !isValidViewMode( Icons ) ) | 754 | if ( !isValidViewMode( Icons ) ) |
752 | { | 755 | { |
diff --git a/libopie2/opieui/oversatileview.h b/libopie2/opieui/oversatileview.h index 8af21dc..61b61db 100644 --- a/libopie2/opieui/oversatileview.h +++ b/libopie2/opieui/oversatileview.h | |||
@@ -44,21 +44,24 @@ | |||
44 | 44 | ||
45 | class QHeader; | 45 | class QHeader; |
46 | class QIconSet; | 46 | class QIconSet; |
47 | class QIconViewItem; | 47 | class QIconViewItem; |
48 | class OListView; | ||
49 | class QListViewItem; | 48 | class QListViewItem; |
50 | class QPopupMenu; | 49 | class QPopupMenu; |
51 | class QString; | 50 | class QString; |
52 | 51 | ||
53 | #ifndef QT_NO_DRAGANDDROP | 52 | #ifndef QT_NO_DRAGANDDROP |
54 | class QIconDragItem; | 53 | class QIconDragItem; |
55 | #endif | 54 | #endif |
56 | 55 | ||
56 | namespace Opie { | ||
57 | namespace Ui { | ||
58 | class OListView; | ||
59 | |||
57 | class OVersatileView : public QWidgetStack | 60 | class OVersatileView : public QWidgetStack |
58 | { | 61 | { |
59 | Q_OBJECT | 62 | Q_OBJECT |
60 | 63 | ||
61 | friend class OVersatileViewItem; | 64 | friend class OVersatileViewItem; |
62 | 65 | ||
63 | //==============================================================================================// | 66 | //==============================================================================================// |
64 | // OVersatileView High Level API | 67 | // OVersatileView High Level API |
@@ -68,85 +71,85 @@ class OVersatileView : public QWidgetStack | |||
68 | OVersatileView( QWidget* parent = 0, const char* name = 0, int mode = 0 ); | 71 | OVersatileView( QWidget* parent = 0, const char* name = 0, int mode = 0 ); |
69 | ~OVersatileView(); | 72 | ~OVersatileView(); |
70 | 73 | ||
71 | QPopupMenu* contextMenu() const; | 74 | QPopupMenu* contextMenu() const; |
72 | 75 | ||
73 | void setSynchronization( bool sync ); | 76 | void setSynchronization( bool sync ); |
74 | bool synchronization(); | 77 | bool synchronization(); |
75 | 78 | ||
76 | enum ViewMode { Tree = 0, Icons }; | 79 | enum ViewMode { Tree = 0, Icons }; |
77 | int viewMode(); | 80 | int viewMode(); |
78 | 81 | ||
79 | QIconView* iconView() const; | 82 | QIconView* iconView() const; |
80 | OListView* listView() const; | 83 | OListView* listView() const; |
81 | 84 | ||
82 | enum WarningPolicy { None = 0, Warn, WarnReturn }; | 85 | enum WarningPolicy { None = 0, Warn, WarnReturn }; |
83 | 86 | ||
84 | void setWarningPolicy( int ) const; // warn, if calling a method which doesn't apply to the current viewmode | 87 | void setWarningPolicy( int ) const; // warn, if calling a method which doesn't apply to the current viewmode |
85 | bool warningPolicy() const; | 88 | bool warningPolicy() const; |
86 | 89 | ||
87 | void setDefaultPixmaps( int mode, QPixmap& leaf, QPixmap& opened, QPixmap& closed ); | 90 | void setDefaultPixmaps( int mode, QPixmap& leaf, QPixmap& opened, QPixmap& closed ); |
88 | 91 | ||
89 | public slots: | 92 | public slots: |
90 | void setViewMode( int mode ); | 93 | void setViewMode( int mode ); |
91 | void setIconViewMode(); | 94 | void setIconViewMode(); |
92 | void setTreeViewMode(); | 95 | void setTreeViewMode(); |
93 | 96 | ||
94 | protected: | 97 | protected: |
95 | virtual bool isValidViewMode( int mode ) const; | 98 | virtual bool isValidViewMode( int mode ) const; |
96 | virtual void popupContextMenu( OVersatileViewItem* item, const QPoint& pos, int col = 0 ); | 99 | virtual void popupContextMenu( OVersatileViewItem* item, const QPoint& pos, int col = 0 ); |
97 | 100 | ||
98 | private: | 101 | private: |
99 | int _viewmode; | 102 | int _viewmode; |
100 | bool _synchronization; | 103 | bool _synchronization; |
101 | mutable int _warningpolicy; | 104 | mutable int _warningpolicy; |
102 | 105 | ||
103 | OListView* _listview; | 106 | OListView* _listview; |
104 | QIconView* _iconview; | 107 | QIconView* _iconview; |
105 | 108 | ||
106 | QPixmap _treeleaf; | 109 | QPixmap _treeleaf; |
107 | QPixmap _treeopened; | 110 | QPixmap _treeopened; |
108 | QPixmap _treeclosed; | 111 | QPixmap _treeclosed; |
109 | 112 | ||
110 | QPixmap _iconleaf; | 113 | QPixmap _iconleaf; |
111 | QPixmap _iconopened; | 114 | QPixmap _iconopened; |
112 | QPixmap _iconclosed; | 115 | QPixmap _iconclosed; |
113 | 116 | ||
114 | QPopupMenu* _contextmenu; | 117 | QPopupMenu* _contextmenu; |
115 | 118 | ||
116 | int _iconstyle; | 119 | int _iconstyle; |
117 | int _treestyle; | 120 | int _treestyle; |
118 | 121 | ||
119 | private slots: | 122 | private slots: |
120 | 123 | ||
121 | void contextMenuRequested( QListViewItem*, const QPoint&, int ); | 124 | void contextMenuRequested( QListViewItem*, const QPoint&, int ); |
122 | void contextMenuRequested( QIconViewItem*, const QPoint& ); | 125 | void contextMenuRequested( QIconViewItem*, const QPoint& ); |
123 | 126 | ||
124 | // type converting signal forwarders | 127 | // type converting signal forwarders |
125 | 128 | ||
126 | void selectionChanged( QListViewItem * ); | 129 | void selectionChanged( QListViewItem * ); |
127 | void currentChanged( QListViewItem * ); | 130 | void currentChanged( QListViewItem * ); |
128 | void clicked( QListViewItem * ); | 131 | void clicked( QListViewItem * ); |
129 | void pressed( QListViewItem * ); | 132 | void pressed( QListViewItem * ); |
130 | void doubleClicked( QListViewItem * ); | 133 | void doubleClicked( QListViewItem * ); |
131 | void returnPressed( QListViewItem * ); | 134 | void returnPressed( QListViewItem * ); |
132 | void onItem( QListViewItem * ); | 135 | void onItem( QListViewItem * ); |
133 | 136 | ||
134 | void selectionChanged( QIconViewItem * ); | 137 | void selectionChanged( QIconViewItem * ); |
135 | void currentChanged( QIconViewItem * ); | 138 | void currentChanged( QIconViewItem * ); |
136 | void clicked( QIconViewItem * ); | 139 | void clicked( QIconViewItem * ); |
137 | void pressed( QIconViewItem * ); | 140 | void pressed( QIconViewItem * ); |
138 | void doubleClicked( QIconViewItem * ); | 141 | void doubleClicked( QIconViewItem * ); |
139 | void returnPressed( QIconViewItem * ); | 142 | void returnPressed( QIconViewItem * ); |
140 | void onItem( QIconViewItem * ); | 143 | void onItem( QIconViewItem * ); |
141 | 144 | ||
142 | void expanded( QListViewItem * item ); // QListView | 145 | void expanded( QListViewItem * item ); // QListView |
143 | void collapsed( QListViewItem * item ); // QListView | 146 | void collapsed( QListViewItem * item ); // QListView |
144 | 147 | ||
145 | signals: | 148 | signals: |
146 | 149 | ||
147 | void contextMenuRequested( OVersatileViewItem * item, const QPoint& pos, int col ); | 150 | void contextMenuRequested( OVersatileViewItem * item, const QPoint& pos, int col ); |
148 | 151 | ||
149 | /*#ifndef QT_NO_DRAGANDDROP | 152 | /*#ifndef QT_NO_DRAGANDDROP |
150 | void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView | 153 | void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView |
151 | #endif | 154 | #endif |
152 | void itemRenamed( OVersatileViewItem *item, const QString & ); // QIconView | 155 | void itemRenamed( OVersatileViewItem *item, const QString & ); // QIconView |
@@ -172,13 +175,13 @@ public: | |||
172 | Bottom = 0, | 175 | Bottom = 0, |
173 | Right | 176 | Right |
174 | }; | 177 | }; |
175 | */ | 178 | */ |
176 | 179 | ||
177 | // | 180 | // |
178 | // only in QListView | 181 | // only in QListView |
179 | // | 182 | // |
180 | 183 | ||
181 | int treeStepSize() const; // QListView | 184 | int treeStepSize() const; // QListView |
182 | virtual void setTreeStepSize( int ); // QListView | 185 | virtual void setTreeStepSize( int ); // QListView |
183 | 186 | ||
184 | QHeader * header() const; // QListView | 187 | QHeader * header() const; // QListView |
@@ -225,9 +228,9 @@ public: | |||
225 | bool rootIsDecorated() const; // QListView | 228 | bool rootIsDecorated() const; // QListView |
226 | 229 | ||
227 | void setShowSortIndicator( bool show ); // QListView | 230 | void setShowSortIndicator( bool show ); // QListView |
228 | bool showSortIndicator() const; // QListView | 231 | bool showSortIndicator() const; // QListView |
229 | 232 | ||
230 | int index( const OVersatileViewItem *item ) const; // QIconView | 233 | int index( const OVersatileViewItem *item ) const; // QIconView |
231 | 234 | ||
232 | public slots: | 235 | public slots: |
233 | void triggerUpdate(); // QListView | 236 | void triggerUpdate(); // QListView |
@@ -239,11 +242,11 @@ public: | |||
239 | // | 242 | // |
240 | // only in QIconView | 243 | // only in QIconView |
241 | // | 244 | // |
242 | 245 | ||
243 | public: | 246 | public: |
244 | uint count() const; // QIconView | 247 | uint count() const; // QIconView |
245 | 248 | ||
246 | OVersatileViewItem *firstItem() const; // QIconView | 249 | OVersatileViewItem *firstItem() const; // QIconView |
247 | OVersatileViewItem *lastItem() const; // QIconView | 250 | OVersatileViewItem *lastItem() const; // QIconView |
248 | 251 | ||
249 | OVersatileViewItem *findItem( const QPoint &pos ) const; // QIconView | 252 | OVersatileViewItem *findItem( const QPoint &pos ) const; // QIconView |
@@ -286,9 +289,9 @@ public: | |||
286 | public slots: | 289 | public slots: |
287 | virtual void arrangeItemsInGrid( const QSize &grid, bool update = TRUE ); // QIconView | 290 | virtual void arrangeItemsInGrid( const QSize &grid, bool update = TRUE ); // QIconView |
288 | virtual void arrangeItemsInGrid( bool update = TRUE ); // QIconView | 291 | virtual void arrangeItemsInGrid( bool update = TRUE ); // QIconView |
289 | virtual void updateContents(); // QIconView | 292 | virtual void updateContents(); // QIconView |
290 | 293 | ||
291 | signals: | 294 | signals: |
292 | /*#ifndef QT_NO_DRAGANDDROP | 295 | /*#ifndef QT_NO_DRAGANDDROP |
293 | void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView | 296 | void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView |
294 | #endif | 297 | #endif |
@@ -321,9 +324,9 @@ public: | |||
321 | 324 | ||
322 | virtual void selectAll( bool select ); | 325 | virtual void selectAll( bool select ); |
323 | virtual void clearSelection(); | 326 | virtual void clearSelection(); |
324 | virtual void invertSelection(); | 327 | virtual void invertSelection(); |
325 | 328 | ||
326 | void ensureItemVisible( const OVersatileViewItem * ); | 329 | void ensureItemVisible( const OVersatileViewItem * ); |
327 | virtual void repaintItem( const OVersatileViewItem * ) const; | 330 | virtual void repaintItem( const OVersatileViewItem * ) const; |
328 | 331 | ||
329 | virtual void setCurrentItem( OVersatileViewItem * ); | 332 | virtual void setCurrentItem( OVersatileViewItem * ); |
@@ -343,18 +346,18 @@ public: | |||
343 | void pressed( OVersatileViewItem * ); | 346 | void pressed( OVersatileViewItem * ); |
344 | 347 | ||
345 | void doubleClicked( OVersatileViewItem * ); | 348 | void doubleClicked( OVersatileViewItem * ); |
346 | void returnPressed( OVersatileViewItem * ); | 349 | void returnPressed( OVersatileViewItem * ); |
347 | 350 | ||
348 | void onItem( OVersatileViewItem * ); | 351 | void onItem( OVersatileViewItem * ); |
349 | void onViewport(); | 352 | void onViewport(); |
350 | 353 | ||
351 | //==============================================================================================// | 354 | //==============================================================================================// |
352 | // "Derived" API - Case 2: Methods existing in QListView and QIconView with differing signatures | 355 | // "Derived" API - Case 2: Methods existing in QListView and QIconView with differing signatures |
353 | //==============================================================================================// | 356 | //==============================================================================================// |
354 | 357 | ||
355 | /* | 358 | /* |
356 | 359 | ||
357 | public: | 360 | public: |
358 | virtual void insertItem( OVersatileViewItem * ); // QListView | 361 | virtual void insertItem( OVersatileViewItem * ); // QListView |
359 | virtual void insertItem( OVersatileViewItem *item, OVersatileViewItem *after = 0L ); // QIconView | 362 | virtual void insertItem( OVersatileViewItem *item, OVersatileViewItem *after = 0L ); // QIconView |
360 | 363 | ||
@@ -367,28 +370,30 @@ public: | |||
367 | void sort(); // #### make virtual in next major release // QListView | 370 | void sort(); // #### make virtual in next major release // QListView |
368 | virtual void sort( bool ascending = TRUE ); // QIconView | 371 | virtual void sort( bool ascending = TRUE ); // QIconView |
369 | 372 | ||
370 | */ | 373 | */ |
371 | 374 | ||
372 | signals: | 375 | signals: |
373 | void clicked( OVersatileViewItem *, const QPoint &, int ); // QListView | 376 | void clicked( OVersatileViewItem *, const QPoint &, int ); // QListView |
374 | void clicked( OVersatileViewItem *, const QPoint & ); // QIconView | 377 | void clicked( OVersatileViewItem *, const QPoint & ); // QIconView |
375 | 378 | ||
376 | void pressed( OVersatileViewItem *, const QPoint &, int ); // QListView | 379 | void pressed( OVersatileViewItem *, const QPoint &, int ); // QListView |
377 | void pressed( OVersatileViewItem *, const QPoint & ); // QIconView | 380 | void pressed( OVersatileViewItem *, const QPoint & ); // QIconView |
378 | 381 | ||
379 | void rightButtonClicked( OVersatileViewItem* item, const QPoint& pos ); // QIconView | 382 | void rightButtonClicked( OVersatileViewItem* item, const QPoint& pos ); // QIconView |
380 | void rightButtonClicked( OVersatileViewItem *, const QPoint&, int ); // QListView | 383 | void rightButtonClicked( OVersatileViewItem *, const QPoint&, int ); // QListView |
381 | 384 | ||
382 | void rightButtonPressed( OVersatileViewItem* item, const QPoint& pos ); // QIconView | 385 | void rightButtonPressed( OVersatileViewItem* item, const QPoint& pos ); // QIconView |
383 | void rightButtonPressed( OVersatileViewItem *, const QPoint&, int ); // QListView | 386 | void rightButtonPressed( OVersatileViewItem *, const QPoint&, int ); // QListView |
384 | 387 | ||
385 | void mouseButtonPressed( int, OVersatileViewItem *, const QPoint& , int ); // QListView | 388 | void mouseButtonPressed( int, OVersatileViewItem *, const QPoint& , int ); // QListView |
386 | void mouseButtonPressed( int button, OVersatileViewItem* item, const QPoint& pos ); // QIconView | 389 | void mouseButtonPressed( int button, OVersatileViewItem* item, const QPoint& pos ); // QIconView |
387 | 390 | ||
388 | void mouseButtonClicked( int, OVersatileViewItem *, const QPoint&, int ); // QListView | 391 | void mouseButtonClicked( int, OVersatileViewItem *, const QPoint&, int ); // QListView |
389 | void mouseButtonClicked( int button, OVersatileViewItem* item, const QPoint& pos ); // QIconView | 392 | void mouseButtonClicked( int button, OVersatileViewItem* item, const QPoint& pos ); // QIconView |
390 | 393 | ||
391 | }; | 394 | }; |
392 | 395 | ||
396 | } | ||
397 | } | ||
393 | #endif | 398 | #endif |
394 | 399 | ||
diff --git a/libopie2/opieui/oversatileviewitem.cpp b/libopie2/opieui/oversatileviewitem.cpp index 66de8eb..03c6738 100644 --- a/libopie2/opieui/oversatileviewitem.cpp +++ b/libopie2/opieui/oversatileviewitem.cpp | |||
@@ -30,8 +30,10 @@ | |||
30 | 30 | ||
31 | #include <opie2/oversatileviewitem.h> | 31 | #include <opie2/oversatileviewitem.h> |
32 | #include <opie2/oversatileview.h> | 32 | #include <opie2/oversatileview.h> |
33 | 33 | ||
34 | using namespace Opie::Ui; | ||
35 | |||
34 | OVersatileViewItem::OVersatileViewItem( OVersatileView * parent ) | 36 | OVersatileViewItem::OVersatileViewItem( OVersatileView * parent ) |
35 | :OListViewItem( parent->_listview ), QIconViewItem( parent->_iconview ), | 37 | :OListViewItem( parent->_listview ), QIconViewItem( parent->_iconview ), |
36 | _versatileview( parent ) | 38 | _versatileview( parent ) |
37 | { | 39 | { |
diff --git a/libopie2/opieui/oversatileviewitem.h b/libopie2/opieui/oversatileviewitem.h index ee8ee20..c4977af 100644 --- a/libopie2/opieui/oversatileviewitem.h +++ b/libopie2/opieui/oversatileviewitem.h | |||
@@ -39,8 +39,11 @@ | |||
39 | /* OPIE */ | 39 | /* OPIE */ |
40 | 40 | ||
41 | #include <opie2/olistview.h> | 41 | #include <opie2/olistview.h> |
42 | 42 | ||
43 | namespace Opie { | ||
44 | namespace Ui { | ||
45 | |||
43 | class OVersatileView; | 46 | class OVersatileView; |
44 | 47 | ||
45 | class OVersatileViewItem : public OListViewItem, public QIconViewItem | 48 | class OVersatileViewItem : public OListViewItem, public QIconViewItem |
46 | { | 49 | { |
@@ -96,5 +99,7 @@ class OVersatileViewItem : public OListViewItem, public QIconViewItem | |||
96 | void init(); | 99 | void init(); |
97 | 100 | ||
98 | }; | 101 | }; |
99 | 102 | ||
103 | } | ||
104 | } | ||
100 | #endif | 105 | #endif |
diff --git a/libopie2/opieui/owait.cpp b/libopie2/opieui/owait.cpp index 8bb4ed6..9519888 100644 --- a/libopie2/opieui/owait.cpp +++ b/libopie2/opieui/owait.cpp | |||
@@ -37,8 +37,10 @@ | |||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qlayout.h> | 38 | #include <qlayout.h> |
39 | #include <qpainter.h> | 39 | #include <qpainter.h> |
40 | 40 | ||
41 | using namespace Opie::Ui; | ||
42 | |||
41 | static int frame = 0; | 43 | static int frame = 0; |
42 | 44 | ||
43 | /** | 45 | /** |
44 | * This will construct a modal dialog. | 46 | * This will construct a modal dialog. |
diff --git a/libopie2/opieui/owait.h b/libopie2/opieui/owait.h index 3267064..03c33e4 100644 --- a/libopie2/opieui/owait.h +++ b/libopie2/opieui/owait.h | |||
@@ -36,8 +36,11 @@ | |||
36 | #include <qlabel.h> | 36 | #include <qlabel.h> |
37 | #include <qpixmap.h> | 37 | #include <qpixmap.h> |
38 | #include <qtimer.h> | 38 | #include <qtimer.h> |
39 | 39 | ||
40 | |||
41 | namespace Opie { | ||
42 | namespace Ui { | ||
40 | /** | 43 | /** |
41 | * This class displays a animated waiting icon in the middle of the screen. | 44 | * This class displays a animated waiting icon in the middle of the screen. |
42 | * | 45 | * |
43 | * @short modal hour glass dialog | 46 | * @short modal hour glass dialog |
@@ -81,6 +84,7 @@ class OWait : public QDialog | |||
81 | int m_aniSize; | 84 | int m_aniSize; |
82 | class Private; | 85 | class Private; |
83 | Private *d; | 86 | Private *d; |
84 | }; | 87 | }; |
85 | 88 | } | |
89 | } | ||
86 | #endif | 90 | #endif |