48 files changed, 309 insertions, 152 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 | |||
@@ -1,28 +1,31 @@ | |||
1 | #ifndef OPIE_BIG_SCREEN_PRIVATE | 1 | #ifndef OPIE_BIG_SCREEN_PRIVATE |
2 | #define OPIE_BIG_SCREEN_PRIVATE | 2 | #define OPIE_BIG_SCREEN_PRIVATE |
3 | 3 | ||
4 | /* QT */ | 4 | /* QT */ |
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 |
15 | { | 16 | { |
16 | if (widget != o.widget ) return false; | 17 | if (widget != o.widget ) return false; |
17 | if (icon != o.icon ) return false; | 18 | if (icon != o.icon ) return false; |
18 | if (name != o.name ) return false; | 19 | if (name != o.name ) return false; |
19 | return true; | 20 | return true; |
20 | } | 21 | } |
21 | QWidget* widget; | 22 | QWidget* widget; |
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 | |||
@@ -26,25 +26,26 @@ | |||
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "osplitter.h" | 29 | #include "osplitter.h" |
30 | 30 | ||
31 | /* OPIE */ | 31 | /* OPIE */ |
32 | #include <opie2/otabwidget.h> | 32 | #include <opie2/otabwidget.h> |
33 | 33 | ||
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 |
43 | * You might want to call setSizeChange to tell | 44 | * You might want to call setSizeChange to tell |
44 | * OSplitter to change its layout when a specefic | 45 | * OSplitter to change its layout when a specefic |
45 | * mark was crossed. OSplitter sets a default value. | 46 | * mark was crossed. OSplitter sets a default value. |
46 | * | 47 | * |
47 | * You cann add widget with addWidget to the OSplitter. | 48 | * You cann add widget with addWidget to the OSplitter. |
48 | * OSplitter supports also grouping of Splitters where they | 49 | * OSplitter supports also grouping of Splitters where they |
49 | * can share one OTabBar in small screen mode. This can be used | 50 | * can share one OTabBar in small screen mode. This can be used |
50 | * for email clients like vies but see the example. | 51 | * for email clients like vies but see the example. |
@@ -159,25 +160,25 @@ void OSplitter::setSizeChange( int width_height ) | |||
159 | */ | 160 | */ |
160 | void OSplitter::addWidget( OSplitter* split ) | 161 | void OSplitter::addWidget( OSplitter* split ) |
161 | { | 162 | { |
162 | m_splitter.append( split ); | 163 | m_splitter.append( split ); |
163 | 164 | ||
164 | /* | 165 | /* |
165 | * set tab widget | 166 | * set tab widget |
166 | */ | 167 | */ |
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 | } |
176 | 177 | ||
177 | /* | 178 | /* |
178 | * If in a tab it should be removed | 179 | * If in a tab it should be removed |
179 | * and if in a hbox the reparent kills it too | 180 | * and if in a hbox the reparent kills it too |
180 | */ | 181 | */ |
181 | /** | 182 | /** |
182 | * This removes the splitter again. You currently need to call this | 183 | * This removes the splitter again. You currently need to call this |
183 | * before you delete or otherwise you can get mem corruption | 184 | * before you delete or otherwise you can get mem corruption |
@@ -204,25 +205,25 @@ void OSplitter::removeWidget( OSplitter* split) | |||
204 | * @param icon The icon of the possible Tab | 205 | * @param icon The icon of the possible Tab |
205 | * @param label The label of the possible Tab | 206 | * @param label The label of the possible Tab |
206 | */ | 207 | */ |
207 | void OSplitter::addWidget( QWidget* wid, const QString& icon, const QString& label ) | 208 | void OSplitter::addWidget( QWidget* wid, const QString& icon, const QString& label ) |
208 | { | 209 | { |
209 | #ifdef DEBUG | 210 | #ifdef DEBUG |
210 | if (!wid ) | 211 | if (!wid ) |
211 | { | 212 | { |
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 | ||
221 | m_container.append( cont ); | 222 | m_container.append( cont ); |
222 | 223 | ||
223 | /* | 224 | /* |
224 | * | 225 | * |
225 | */ | 226 | */ |
226 | if (!m_splitter.isEmpty() && (m_tabWidget || m_parentTab ) ) | 227 | if (!m_splitter.isEmpty() && (m_tabWidget || m_parentTab ) ) |
227 | setTabWidget( m_parentTab ); | 228 | setTabWidget( m_parentTab ); |
228 | else | 229 | else |
@@ -387,39 +388,39 @@ void OSplitter::resizeEvent( QResizeEvent* res ) | |||
387 | qWarning("Changng to vbox %s", name() ); | 388 | qWarning("Changng to vbox %s", name() ); |
388 | changeVBox(); | 389 | changeVBox(); |
389 | mode = false; | 390 | mode = false; |
390 | } | 391 | } |
391 | 392 | ||
392 | emit sizeChanged(mode, m_orient ); | 393 | emit sizeChanged(mode, m_orient ); |
393 | } | 394 | } |
394 | 395 | ||
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 ) |
404 | m_parentTab->addTab( wid, con.icon, con.name ); | 405 | m_parentTab->addTab( wid, con.icon, con.name ); |
405 | else | 406 | else |
406 | m_tabWidget->addTab( wid, con.icon, con.name ); | 407 | m_tabWidget->addTab( wid, con.icon, con.name ); |
407 | } | 408 | } |
408 | 409 | ||
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 | } |
418 | 419 | ||
419 | 420 | ||
420 | /* | 421 | /* |
421 | * Removes a widget from the tab | 422 | * Removes a widget from the tab |
422 | */ | 423 | */ |
423 | void OSplitter::removeFromTab( QWidget* wid ) | 424 | void OSplitter::removeFromTab( QWidget* wid ) |
424 | { | 425 | { |
425 | if (m_parentTab ) | 426 | if (m_parentTab ) |
@@ -536,25 +537,25 @@ void OSplitter::commonChangeBox() | |||
536 | for (ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it ) | 537 | for (ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it ) |
537 | { | 538 | { |
538 | /* only if parent tab.. m_tabWidgets gets deleted and would do that as well */ | 539 | /* only if parent tab.. m_tabWidgets gets deleted and would do that as well */ |
539 | if (m_parentTab ) | 540 | if (m_parentTab ) |
540 | removeFromTab( (*it).widget ); | 541 | removeFromTab( (*it).widget ); |
541 | qWarning("Adding to box %s", (*it).name.latin1() ); | 542 | qWarning("Adding to box %s", (*it).name.latin1() ); |
542 | addToBox( (*it) ); | 543 | addToBox( (*it) ); |
543 | } | 544 | } |
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 ); |
553 | } | 554 | } |
554 | 555 | ||
555 | 556 | ||
556 | 557 | ||
557 | if (m_parentTab ) | 558 | if (m_parentTab ) |
558 | m_parentTab->addTab(m_hbox, iconName(), label() ); | 559 | m_parentTab->addTab(m_hbox, iconName(), label() ); |
559 | else | 560 | else |
560 | { | 561 | { |
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 | |||
@@ -39,50 +39,50 @@ | |||
39 | 39 | ||
40 | class QHBox; | 40 | class QHBox; |
41 | 41 | ||
42 | //template class QValueList<Opie::OSplitterContainer>; | 42 | //template class QValueList<Opie::OSplitterContainer>; |
43 | 43 | ||
44 | /* | 44 | /* |
45 | * TODO | 45 | * TODO |
46 | * -check API docu | 46 | * -check API docu |
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 | * |
57 | * If you've widgets that could be placed side by side but you think | 57 | * If you've widgets that could be placed side by side but you think |
58 | * on small resolutions is not enough place but it would really make sense | 58 | * on small resolutions is not enough place but it would really make sense |
59 | * on bigger resolutions this class will help you. | 59 | * on bigger resolutions this class will help you. |
60 | * You can add as many widgets you want to it. Set a poliy on which width/height it | 60 | * You can add as many widgets you want to it. Set a poliy on which width/height it |
61 | * should switch the layout. | 61 | * should switch the layout. |
62 | * You can either say to place widgets vertical or horizontal. | 62 | * You can either say to place widgets vertical or horizontal. |
63 | * This class uses QHBox, QVBox and QTAbWidget internally. | 63 | * This class uses QHBox, QVBox and QTAbWidget internally. |
64 | * OSplitter takes ownership of the widgets | 64 | * OSplitter takes ownership of the widgets |
65 | * | 65 | * |
66 | * @since 1.2 | 66 | * @since 1.2 |
67 | * | 67 | * |
68 | * @short a small dynamically changing its layout to store two or more widgets side by side | 68 | * @short a small dynamically changing its layout to store two or more widgets side by side |
69 | * @version 0.1 | 69 | * @version 0.1 |
70 | * @author zecke | 70 | * @author zecke |
71 | */ | 71 | */ |
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 | ||
81 | void setLabel( const QString& name ); | 81 | void setLabel( const QString& name ); |
82 | void setIconName( const QString& name ); | 82 | void setIconName( const QString& name ); |
83 | QString label()const; | 83 | QString label()const; |
84 | QString iconName()const; | 84 | QString iconName()const; |
85 | 85 | ||
86 | void setSizeChange( int width_height ); | 86 | void setSizeChange( int width_height ); |
87 | 87 | ||
88 | void addWidget( OSplitter* splitter ); | 88 | void addWidget( OSplitter* splitter ); |
@@ -115,36 +115,37 @@ signals: | |||
115 | public: | 115 | public: |
116 | // QSize sizeHint()const; | 116 | // QSize sizeHint()const; |
117 | // QSize minimumSizeHint()const; | 117 | // QSize minimumSizeHint()const; |
118 | 118 | ||
119 | protected: | 119 | protected: |
120 | void resizeEvent( QResizeEvent* ); | 120 | void resizeEvent( QResizeEvent* ); |
121 | 121 | ||
122 | private: | 122 | 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(); |
133 | void commonChangeBox(); | 133 | void commonChangeBox(); |
134 | QHBox *m_hbox; | 134 | QHBox *m_hbox; |
135 | OTabWidget *m_tabWidget; | 135 | OTabWidget *m_tabWidget; |
136 | OTabWidget *m_parentTab; | 136 | OTabWidget *m_parentTab; |
137 | Orientation m_orient; | 137 | Orientation m_orient; |
138 | int m_size_policy; | 138 | int m_size_policy; |
139 | 139 | ||
140 | ContainerList m_container; | 140 | ContainerList m_container; |
141 | QList<OSplitter> m_splitter; | 141 | QList<OSplitter> m_splitter; |
142 | 142 | ||
143 | QString m_icon, m_name; | 143 | QString m_icon, m_name; |
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 | |||
@@ -23,29 +23,29 @@ | |||
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 | #include "owidgetstack.h" | 29 | #include "owidgetstack.h" |
30 | 30 | ||
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. |
44 | * Use removeWidget before you delete a widget yourself. OWidgetStack does not | 44 | * Use removeWidget before you delete a widget yourself. OWidgetStack does not |
45 | * yet recognize removal of children. | 45 | * yet recognize removal of children. |
46 | * | 46 | * |
47 | * @param parent The parent widget. It maybe 0 but then you need to take care of deletion. | 47 | * @param parent The parent widget. It maybe 0 but then you need to take care of deletion. |
48 | * Or you use QPEApplication::showMainWidget(). | 48 | * Or you use QPEApplication::showMainWidget(). |
49 | * @param name Name will be passed on to QObject | 49 | * @param name Name will be passed on to QObject |
50 | * @param fl Additional window flags passed to QFrame. see @Qt::WFlags | 50 | * @param fl Additional window flags passed to QFrame. see @Qt::WFlags |
51 | */ | 51 | */ |
@@ -424,12 +424,15 @@ void OWidgetStack::switchTop() { | |||
424 | m_mWidget->reparent(this, 0, frameRect().topLeft() ); | 424 | m_mWidget->reparent(this, 0, frameRect().topLeft() ); |
425 | m_mWidget->setGeometry( frameRect() ); | 425 | m_mWidget->setGeometry( frameRect() ); |
426 | m_mWidget->show(); | 426 | m_mWidget->show(); |
427 | }else | 427 | }else |
428 | /* ### FIXME we need to place the widget better */ | 428 | /* ### FIXME we need to place the widget better */ |
429 | it.data()->reparent(0, WType_TopLevel, QPoint(10, 10) ); | 429 | it.data()->reparent(0, WType_TopLevel, QPoint(10, 10) ); |
430 | } | 430 | } |
431 | } | 431 | } |
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 | |||
@@ -26,26 +26,26 @@ | |||
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifndef OWIDGETSTACK_H | 29 | #ifndef OWIDGETSTACK_H |
30 | #define OWIDGETSTACK_H | 30 | #define OWIDGETSTACK_H |
31 | 31 | ||
32 | /* QT*/ | 32 | /* QT*/ |
33 | #include <qframe.h> | 33 | #include <qframe.h> |
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 |
44 | * to supply a view on click. And by clicking the (X) you go back but this | 44 | * to supply a view on click. And by clicking the (X) you go back but this |
45 | * behaviour feels strange on bigger screens. It's ok on smaller one because | 45 | * behaviour feels strange on bigger screens. It's ok on smaller one because |
46 | * one can't determine the difference. | 46 | * one can't determine the difference. |
47 | * This stack reads the default out of the size of the desktop widget but | 47 | * This stack reads the default out of the size of the desktop widget but |
48 | * can be forced to have either the one or the other behaviour. | 48 | * can be forced to have either the one or the other behaviour. |
49 | * The first widget added is considered the 'main' widget and its | 49 | * The first widget added is considered the 'main' widget and its |
50 | * sizeHint will be taking if in BigScreen mode. | 50 | * sizeHint will be taking if in BigScreen mode. |
51 | * In small screen mode this widget behaves exactly like a QWidgetStack and in BigScreen | 51 | * In small screen mode this widget behaves exactly like a QWidgetStack and in BigScreen |
@@ -118,15 +118,16 @@ private: | |||
118 | QMap<int, QWidget*> m_list; | 118 | QMap<int, QWidget*> m_list; |
119 | QWidgetStack *m_stack; | 119 | QWidgetStack *m_stack; |
120 | QWidget *m_mWidget; | 120 | QWidget *m_mWidget; |
121 | QWidget *m_last; | 121 | QWidget *m_last; |
122 | 122 | ||
123 | enum Mode m_mode; | 123 | enum Mode m_mode; |
124 | bool m_forced : 1; | 124 | bool m_forced : 1; |
125 | 125 | ||
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 | |||
@@ -30,25 +30,25 @@ | |||
30 | /* OPIE */ | 30 | /* OPIE */ |
31 | #include <opie2/ofiledialog.h> | 31 | #include <opie2/ofiledialog.h> |
32 | #include <qpe/applnk.h> | 32 | #include <qpe/applnk.h> |
33 | #include <qpe/config.h> | 33 | #include <qpe/config.h> |
34 | #include <qpe/qpeapplication.h> | 34 | #include <qpe/qpeapplication.h> |
35 | 35 | ||
36 | /* QT */ | 36 | /* QT */ |
37 | #include <qfileinfo.h> | 37 | #include <qfileinfo.h> |
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 | /* |
47 | * helper functions to load the start dir | 47 | * helper functions to load the start dir |
48 | * and to save it | 48 | * and to save it |
49 | * helper to extract the dir out of a file name | 49 | * helper to extract the dir out of a file name |
50 | */ | 50 | */ |
51 | /** | 51 | /** |
52 | * This method will use Config( argv[0] ); | 52 | * This method will use Config( argv[0] ); |
53 | * @param key The group key used | 53 | * @param key The group key used |
54 | */ | 54 | */ |
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 | |||
@@ -26,26 +26,26 @@ | |||
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifndef OFILEDIALOG_H | 29 | #ifndef OFILEDIALOG_H |
30 | #define OFILEDIALOG_H | 30 | #define OFILEDIALOG_H |
31 | 31 | ||
32 | /* OPIE */ | 32 | /* OPIE */ |
33 | #include <opie2/ofileselector.h> | 33 | #include <opie2/ofileselector.h> |
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 |
44 | * a file for either opening or saving. | 44 | * a file for either opening or saving. |
45 | * Most of the time the c'tor will not be used instead using | 45 | * Most of the time the c'tor will not be used instead using |
46 | * the static member functions is prefered. | 46 | * the static member functions is prefered. |
47 | * | 47 | * |
48 | * <pre> | 48 | * <pre> |
49 | * QMap<QString, QStringList> mimeTypes; | 49 | * QMap<QString, QStringList> mimeTypes; |
50 | * QStringList types; | 50 | * QStringList types; |
51 | * types << "text[slash]* "; | 51 | * types << "text[slash]* "; |
@@ -95,15 +95,16 @@ public: | |||
95 | 95 | ||
96 | private: | 96 | private: |
97 | class OFileDialogPrivate; | 97 | class OFileDialogPrivate; |
98 | OFileDialogPrivate *d; | 98 | OFileDialogPrivate *d; |
99 | OFileSelector *file; | 99 | OFileSelector *file; |
100 | 100 | ||
101 | private slots: | 101 | private slots: |
102 | void slotFileSelected( const QString & ); | 102 | void slotFileSelected( const QString & ); |
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 | |||
@@ -46,26 +46,29 @@ | |||
46 | #include <qdir.h> | 46 | #include <qdir.h> |
47 | #include <qhbox.h> | 47 | #include <qhbox.h> |
48 | #include <qheader.h> | 48 | #include <qheader.h> |
49 | #include <qlabel.h> | 49 | #include <qlabel.h> |
50 | #include <qlayout.h> | 50 | #include <qlayout.h> |
51 | #include <qlineedit.h> | 51 | #include <qlineedit.h> |
52 | #include <qlistview.h> | 52 | #include <qlistview.h> |
53 | #include <qpopupmenu.h> | 53 | #include <qpopupmenu.h> |
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 | ||
64 | OFileViewInterface::~OFileViewInterface() | 67 | OFileViewInterface::~OFileViewInterface() |
65 | {} | 68 | {} |
66 | 69 | ||
67 | QString OFileViewInterface::name()const | 70 | QString OFileViewInterface::name()const |
68 | { | 71 | { |
69 | return m_name; | 72 | return m_name; |
70 | } | 73 | } |
71 | 74 | ||
@@ -801,24 +804,26 @@ QWidget* OFileViewFileSystem::widget( QWidget* parent ) | |||
801 | if (!m_view ) | 804 | if (!m_view ) |
802 | { | 805 | { |
803 | m_view = new OFileViewFileListView( parent, startDirectory(), selector() ); | 806 | m_view = new OFileViewFileListView( parent, startDirectory(), selector() ); |
804 | } | 807 | } |
805 | return m_view; | 808 | return m_view; |
806 | } | 809 | } |
807 | 810 | ||
808 | void OFileViewFileSystem::activate( const QString& str) | 811 | 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 | * |
817 | * Create a OFileSelector to let the user select a file. It can | 822 | * Create a OFileSelector to let the user select a file. It can |
818 | * either be used to open a file, select a save name in a dir or | 823 | * either be used to open a file, select a save name in a dir or |
819 | * as a dropin for the FileSelector. | 824 | * as a dropin for the FileSelector. |
820 | * | 825 | * |
821 | * <pre> | 826 | * <pre> |
822 | * QMap<QString, QStringList> mimeTypes; | 827 | * QMap<QString, QStringList> mimeTypes; |
823 | * QStringList types; | 828 | * QStringList types; |
824 | * types << "text@slash* "; | 829 | * types << "text@slash* "; |
@@ -1155,12 +1160,14 @@ void OFileSelector::setCloseVisible( bool b ) | |||
1155 | m_shClose = b; | 1160 | m_shClose = b; |
1156 | currentView()->reread(); | 1161 | currentView()->reread(); |
1157 | } | 1162 | } |
1158 | 1163 | ||
1159 | void OFileSelector::setNameVisible( bool b ) | 1164 | void OFileSelector::setNameVisible( bool b ) |
1160 | { | 1165 | { |
1161 | if ( b ) | 1166 | if ( b ) |
1162 | m_nameBox->show(); | 1167 | m_nameBox->show(); |
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 | |||
@@ -43,47 +43,49 @@ | |||
43 | #include <qwidget.h> | 43 | #include <qwidget.h> |
44 | #include <qmap.h> | 44 | #include <qmap.h> |
45 | #include <qvaluelist.h> | 45 | #include <qvaluelist.h> |
46 | #include <qstringlist.h> | 46 | #include <qstringlist.h> |
47 | 47 | ||
48 | class QLineEdit; | 48 | class QLineEdit; |
49 | class QComboBox; | 49 | class QComboBox; |
50 | class QWidgetStack; | 50 | 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 |
64 | * | 66 | * |
65 | * This class is first used insert the OFileDialog. | 67 | * This class is first used insert the OFileDialog. |
66 | * It supports multiple view and mimetype filtering for now. | 68 | * It supports multiple view and mimetype filtering for now. |
67 | * | 69 | * |
68 | * @see OFileDialog | 70 | * @see OFileDialog |
69 | * @see FileSelector | 71 | * @see FileSelector |
70 | * @author zecke | 72 | * @author zecke |
71 | * @version 0.1 | 73 | * @version 0.1 |
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 |
82 | * Open = Open A File | 84 | * Open = Open A File |
83 | * Save = Save a File | 85 | * Save = Save a File |
84 | * FILESELECTOR = As A GUI in a screen to select a file | 86 | * FILESELECTOR = As A GUI in a screen to select a file |
85 | */ | 87 | */ |
86 | enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 }; | 88 | enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 }; |
87 | // enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 }; | 89 | // enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 }; |
88 | /** | 90 | /** |
89 | * Normal = The old FileSelector | 91 | * Normal = The old FileSelector |
@@ -176,44 +178,45 @@ private: | |||
176 | private: | 178 | private: |
177 | /* inits the Widgets */ | 179 | /* inits the Widgets */ |
178 | void initUI(); | 180 | void initUI(); |
179 | /* inits the MimeType ComboBox content + connects signals and slots */ | 181 | /* inits the MimeType ComboBox content + connects signals and slots */ |
180 | void initMime(); | 182 | void initMime(); |
181 | /* init the Views :) */ | 183 | /* init the Views :) */ |
182 | void initViews(); | 184 | void initViews(); |
183 | 185 | ||
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; |
199 | int m_mode; | 201 | int m_mode; |
200 | int m_selector; | 202 | int m_selector; |
201 | 203 | ||
202 | struct Data; // used for future versions | 204 | struct Data; // used for future versions |
203 | Data *d; | 205 | Data *d; |
204 | 206 | ||
205 | private slots: | 207 | private slots: |
206 | void slotMimeTypeChanged(); | 208 | void slotMimeTypeChanged(); |
207 | 209 | ||
208 | /* will set the text of the lineedit and emit a fileChanged signal */ | 210 | /* will set the text of the lineedit and emit a fileChanged signal */ |
209 | void slotDocLnkBridge( const DocLnk& ); | 211 | void slotDocLnkBridge( const DocLnk& ); |
210 | void slotFileBridge( const QString& ); | 212 | void slotFileBridge( const QString& ); |
211 | void slotViewChange( const QString& ); | 213 | void slotViewChange( const QString& ); |
212 | 214 | ||
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 | |||
@@ -47,28 +47,28 @@ | |||
47 | * b) leave some object inside the OFileSelector which can be used? | 47 | * b) leave some object inside the OFileSelector which can be used? |
48 | * c) when switching views tell which view we want o have.. internally we can switch then | 48 | * c) when switching views tell which view we want o have.. internally we can switch then |
49 | * | 49 | * |
50 | * I'll take c) -zecke | 50 | * I'll take c) -zecke |
51 | */ | 51 | */ |
52 | 52 | ||
53 | typedef QMap<QString, QStringList> MimeTypes; | 53 | typedef QMap<QString, QStringList> MimeTypes; |
54 | 54 | ||
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: |
67 | OFileViewInterface( OFileSelector* selector ); | 67 | OFileViewInterface( OFileSelector* selector ); |
68 | virtual ~OFileViewInterface(); | 68 | virtual ~OFileViewInterface(); |
69 | virtual QString selectedName()const = 0; | 69 | virtual QString selectedName()const = 0; |
70 | virtual QString selectedPath()const = 0; | 70 | virtual QString selectedPath()const = 0; |
71 | virtual QString directory()const = 0; | 71 | virtual QString directory()const = 0; |
72 | virtual void reread() = 0; | 72 | virtual void reread() = 0; |
73 | virtual int fileCount()const = 0; | 73 | virtual int fileCount()const = 0; |
74 | virtual DocLnk selectedDocument()const; | 74 | virtual DocLnk selectedDocument()const; |
@@ -177,15 +177,17 @@ private: | |||
177 | QString m_currentDir; | 177 | QString m_currentDir; |
178 | QToolButton *m_btnNew, *m_btnClose; | 178 | QToolButton *m_btnNew, *m_btnClose; |
179 | void connectSlots(); | 179 | void connectSlots(); |
180 | void addFile( QFileInfo* info, bool symlink = FALSE ); | 180 | void addFile( QFileInfo* info, bool symlink = FALSE ); |
181 | void addDir ( QFileInfo* info, bool symlink = FALSE ); | 181 | void addDir ( QFileInfo* info, bool symlink = FALSE ); |
182 | void addSymlink( QFileInfo* info, bool = FALSE ); | 182 | void addSymlink( QFileInfo* info, bool = FALSE ); |
183 | 183 | ||
184 | 184 | ||
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 | |||
@@ -28,26 +28,27 @@ | |||
28 | 28 | ||
29 | #ifndef OFILEVIEW_H | 29 | #ifndef OFILEVIEW_H |
30 | #define OFILEVIEW_H | 30 | #define OFILEVIEW_H |
31 | 31 | ||
32 | /* QT */ | 32 | /* QT */ |
33 | #include <qobject.h> | 33 | #include <qobject.h> |
34 | #include <qwidget.h> | 34 | #include <qwidget.h> |
35 | 35 | ||
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 |
46 | * With a View you can chage the user visible | 47 | * With a View you can chage the user visible |
47 | * representation of a OFileLister | 48 | * representation of a OFileLister |
48 | * OFileView is just a basic interface which helps you to | 49 | * OFileView is just a basic interface which helps you to |
49 | * write new views | 50 | * write new views |
50 | */ | 51 | */ |
51 | class OFileView : public QWidget | 52 | class OFileView : public QWidget |
52 | { | 53 | { |
53 | Q_OBJECT | 54 | Q_OBJECT |
@@ -81,15 +82,17 @@ signals: | |||
81 | 82 | ||
82 | class OFileViewFactory | 83 | class OFileViewFactory |
83 | { | 84 | { |
84 | // Q_OBJECT | 85 | // Q_OBJECT |
85 | public: | 86 | public: |
86 | OFileViewFactory() {} ; | 87 | OFileViewFactory() {} ; |
87 | virtual ~OFileViewFactory() = 0; | 88 | virtual ~OFileViewFactory() = 0; |
88 | 89 | ||
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 | |||
@@ -20,25 +20,25 @@ | |||
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
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 | #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 | * |
37 | * @param parent The parent of this label | 37 | * @param parent The parent of this label |
38 | * @param name A name of this label @see QObject | 38 | * @param name A name of this label @see QObject |
39 | * @param fl The windowing flags | 39 | * @param fl The windowing flags |
40 | */ | 40 | */ |
41 | OClickableLabel::OClickableLabel(QWidget* parent, const char* name, WFlags fl) | 41 | OClickableLabel::OClickableLabel(QWidget* parent, const char* name, WFlags fl) |
42 | :QLabel(parent,name,fl) | 42 | :QLabel(parent,name,fl) |
43 | { | 43 | { |
44 | textInverted=false; | 44 | textInverted=false; |
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 | |||
@@ -24,26 +24,26 @@ | |||
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
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 | #ifndef OCLICKABLELABEL_H | 30 | #ifndef OCLICKABLELABEL_H |
31 | #define OCLICKABLELABEL_H | 31 | #define OCLICKABLELABEL_H |
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. |
42 | * The reason to use a clickable is if you want to save space | 42 | * The reason to use a clickable is if you want to save space |
43 | * or you want to skip the border of a normal button | 43 | * or you want to skip the border of a normal button |
44 | * | 44 | * |
45 | * <pre> | 45 | * <pre> |
46 | * QLabel* lbl = new OClickableLabel( parent, "PushLabel" ); | 46 | * QLabel* lbl = new OClickableLabel( parent, "PushLabel" ); |
47 | * lbl->setPixmap( "config" ); | 47 | * lbl->setPixmap( "config" ); |
48 | * QWhatsThis::add( lbl, tr("Click here to do something") ); | 48 | * QWhatsThis::add( lbl, tr("Click here to do something") ); |
49 | * </pre> | 49 | * </pre> |
@@ -89,15 +89,16 @@ private: | |||
89 | bool isToggle : 1; | 89 | bool isToggle : 1; |
90 | bool isDown : 1; | 90 | bool isDown : 1; |
91 | bool textInverted : 1; | 91 | bool textInverted : 1; |
92 | 92 | ||
93 | void showState(bool on); | 93 | void showState(bool on); |
94 | void setInverted(bool on); | 94 | void setInverted(bool on); |
95 | 95 | ||
96 | private: | 96 | 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 | |||
@@ -23,24 +23,26 @@ | |||
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
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 | 30 | ||
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) |
39 | :QDialog(parent, name, modal, f) | 41 | :QDialog(parent, name, modal, f) |
40 | { | 42 | { |
41 | // d = new ODialogPrivate(); | 43 | // d = new ODialogPrivate(); |
42 | } | 44 | } |
43 | 45 | ||
44 | int ODialog::marginHint() | 46 | int ODialog::marginHint() |
45 | { | 47 | { |
46 | return( mMarginSize ); | 48 | return( mMarginSize ); |
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 | |||
@@ -46,24 +46,27 @@ class QLayoutItem; | |||
46 | * above, below, to the right and to the left shall be @ref marginHint(). | 46 | * above, below, to the right and to the left shall be @ref marginHint(). |
47 | * If you add a separator line above the buttons, there shall be a | 47 | * If you add a separator line above the buttons, there shall be a |
48 | * @ref marginHint() between the buttons and the separator and a | 48 | * @ref marginHint() between the buttons and the separator and a |
49 | * @ref marginHint() above the separator as well. | 49 | * @ref marginHint() above the separator as well. |
50 | * | 50 | * |
51 | * @author Michael 'Mickey' Lauer <mickey@Vanille.de> | 51 | * @author Michael 'Mickey' Lauer <mickey@Vanille.de> |
52 | */ | 52 | */ |
53 | 53 | ||
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 | ||
62 | public: | 65 | public: |
63 | 66 | ||
64 | /** | 67 | /** |
65 | * Constructor. | 68 | * Constructor. |
66 | * | 69 | * |
67 | * Takes the same arguments as @ref QDialog. | 70 | * Takes the same arguments as @ref QDialog. |
68 | */ | 71 | */ |
69 | ODialog(QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags f = 0); | 72 | ODialog(QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags f = 0); |
@@ -79,13 +82,15 @@ class ODialog : public QDialog | |||
79 | * widgets inside a dialog according to the KDE standard. | 82 | * widgets inside a dialog according to the KDE standard. |
80 | */ | 83 | */ |
81 | static int spacingHint(); | 84 | static int spacingHint(); |
82 | 85 | ||
83 | private: | 86 | private: |
84 | static int mMarginSize; | 87 | static int mMarginSize; |
85 | static int mSpacingSize; | 88 | static int mSpacingSize; |
86 | 89 | ||
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 | |||
@@ -29,47 +29,42 @@ | |||
29 | 29 | ||
30 | /* OPIE */ | 30 | /* OPIE */ |
31 | #include <opie2/ofontselector.h> | 31 | #include <opie2/ofontselector.h> |
32 | #include <qpe/fontdatabase.h> | 32 | #include <qpe/fontdatabase.h> |
33 | 33 | ||
34 | /* QT */ | 34 | /* QT */ |
35 | #include <qlayout.h> | 35 | #include <qlayout.h> |
36 | #include <qlistbox.h> | 36 | #include <qlistbox.h> |
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: |
49 | QListBox * m_font_family_list; | 49 | QListBox * m_font_family_list; |
50 | QComboBox * m_font_style_list; | 50 | QComboBox * m_font_style_list; |
51 | QComboBox * m_font_size_list; | 51 | QComboBox * m_font_size_list; |
52 | QMultiLineEdit *m_preview; | 52 | QMultiLineEdit *m_preview; |
53 | 53 | ||
54 | bool m_pointbug : 1; | 54 | bool m_pointbug : 1; |
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() |
68 | { | 63 | { |
69 | m_name = t; | 64 | m_name = t; |
70 | m_styles = styles; | 65 | m_styles = styles; |
71 | m_sizes = sizes; | 66 | m_sizes = sizes; |
72 | 67 | ||
73 | QString str = t; | 68 | QString str = t; |
74 | str [0] = str [0]. upper(); | 69 | str [0] = str [0]. upper(); |
75 | setText ( str ); | 70 | setText ( str ); |
@@ -86,37 +81,42 @@ public: | |||
86 | } | 81 | } |
87 | 82 | ||
88 | const QValueList<int> &sizes() const | 83 | const QValueList<int> &sizes() const |
89 | { | 84 | { |
90 | return m_sizes; | 85 | return m_sizes; |
91 | } | 86 | } |
92 | 87 | ||
93 | private: | 88 | 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++ ) |
103 | { | 104 | { |
104 | if ( box->text ( i ) == str ) | 105 | if ( box->text ( i ) == str ) |
105 | return i; | 106 | return i; |
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(); |
115 | 115 | ||
116 | return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' ); | 116 | return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' ); |
117 | } | 117 | } |
118 | 118 | ||
119 | /** | 119 | /** |
120 | * Constructs the Selector object | 120 | * Constructs the Selector object |
121 | * @param withpreview If a font preview should be given | 121 | * @param withpreview If a font preview should be given |
122 | * @param parent The parent of the Font Selector | 122 | * @param parent The parent of the Font Selector |
@@ -417,12 +417,13 @@ void OFontSelector::resizeEvent ( QResizeEvent *re ) | |||
417 | if ( d->m_preview ) | 417 | if ( d->m_preview ) |
418 | { | 418 | { |
419 | d->m_preview->setMinimumHeight ( 1 ); | 419 | d->m_preview->setMinimumHeight ( 1 ); |
420 | d->m_preview->setMaximumHeight ( 32767 ); | 420 | d->m_preview->setMaximumHeight ( 32767 ); |
421 | } | 421 | } |
422 | 422 | ||
423 | QWidget::resizeEvent ( re ); | 423 | QWidget::resizeEvent ( re ); |
424 | 424 | ||
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 | |||
@@ -26,28 +26,29 @@ | |||
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 | #ifndef OFONTSELECTOR_H | 30 | #ifndef OFONTSELECTOR_H |
31 | #define OFONTSELECTOR_H | 31 | #define OFONTSELECTOR_H |
32 | 32 | ||
33 | /* QT */ | 33 | /* QT */ |
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 |
46 | * fonts | 47 | * fonts |
47 | * | 48 | * |
48 | * | 49 | * |
49 | * @short A widget to select a font | 50 | * @short A widget to select a font |
50 | * @see QWidget | 51 | * @see QWidget |
51 | * @see QFont | 52 | * @see QFont |
52 | * @author Rober Griebl | 53 | * @author Rober Griebl |
53 | */ | 54 | */ |
@@ -86,19 +87,20 @@ protected slots: | |||
86 | /** @internal */ | 87 | /** @internal */ |
87 | virtual void fontSizeClicked ( int ); | 88 | virtual void fontSizeClicked ( int ); |
88 | 89 | ||
89 | protected: | 90 | protected: |
90 | virtual void resizeEvent ( QResizeEvent *re ); | 91 | virtual void resizeEvent ( QResizeEvent *re ); |
91 | 92 | ||
92 | private: | 93 | private: |
93 | void loadFonts ( QListBox * ); | 94 | void loadFonts ( QListBox * ); |
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 | |||
@@ -32,24 +32,28 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
32 | #include <math.h> | 32 | #include <math.h> |
33 | 33 | ||
34 | #include <qimage.h> | 34 | #include <qimage.h> |
35 | #include <stdlib.h> | 35 | #include <stdlib.h> |
36 | 36 | ||
37 | #include <opie2/oimageeffect.h> | 37 | #include <opie2/oimageeffect.h> |
38 | #include <opie2/odebug.h> | 38 | #include <opie2/odebug.h> |
39 | 39 | ||
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) + |
48 | 0.587*qGreen(color) + | 52 | 0.587*qGreen(color) + |
49 | 0.1140000000000001*qBlue(color)))); | 53 | 0.1140000000000001*qBlue(color)))); |
50 | } | 54 | } |
51 | 55 | ||
52 | //====================================================================== | 56 | //====================================================================== |
53 | // | 57 | // |
54 | // Gradient effects | 58 | // Gradient effects |
55 | // | 59 | // |
@@ -3756,13 +3760,14 @@ void OImageEffect::contrastHSV(QImage &img, bool sharpen) | |||
3756 | brightness=1.0; | 3760 | brightness=1.0; |
3757 | else | 3761 | else |
3758 | if (brightness < 0) | 3762 | if (brightness < 0) |
3759 | brightness=0.0; | 3763 | brightness=0.0; |
3760 | v = (int)(brightness*255); | 3764 | v = (int)(brightness*255); |
3761 | c.setHsv(h, s, v); | 3765 | c.setHsv(h, s, v); |
3762 | data[i] = qRgba(c.red(), c.green(), c.blue(), qAlpha(data[i])); | 3766 | data[i] = qRgba(c.red(), c.green(), c.blue(), qAlpha(data[i])); |
3763 | } | 3767 | } |
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 | |||
@@ -30,24 +30,26 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
30 | 30 | ||
31 | */ | 31 | */ |
32 | 32 | ||
33 | // $Id$ | 33 | // $Id$ |
34 | 34 | ||
35 | #ifndef OIMAGEEFFECT_H | 35 | #ifndef OIMAGEEFFECT_H |
36 | #define OIMAGEEFFECT_H | 36 | #define OIMAGEEFFECT_H |
37 | 37 | ||
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 |
46 | * static, so there is no need to create an instance of this class. You can | 48 | * static, so there is no need to create an instance of this class. You can |
47 | * just call the static methods. They are encapsulated here merely to provide | 49 | * just call the static methods. They are encapsulated here merely to provide |
48 | * a common namespace. | 50 | * a common namespace. |
49 | */ | 51 | */ |
50 | 52 | ||
51 | class OImageEffect | 53 | class OImageEffect |
52 | { | 54 | { |
53 | public: | 55 | public: |
@@ -547,13 +549,16 @@ private: | |||
547 | * Helper function to find the nearest color to the RBG triplet | 549 | * Helper function to find the nearest color to the RBG triplet |
548 | */ | 550 | */ |
549 | static int nearestColor( int r, int g, int b, const QColor *pal, int size ); | 551 | static int nearestColor( int r, int g, int b, const QColor *pal, int size ); |
550 | 552 | ||
551 | static void hull(const int x_offset, const int y_offset, const int polarity, | 553 | static void hull(const int x_offset, const int y_offset, const int polarity, |
552 | const int width, const int height, | 554 | const int width, const int height, |
553 | unsigned int *f, unsigned int *g); | 555 | unsigned int *f, unsigned int *g); |
554 | static unsigned int generateNoise(unsigned int pixel, NoiseType type); | 556 | static unsigned int generateNoise(unsigned int pixel, NoiseType type); |
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 | |||
@@ -27,24 +27,29 @@ | |||
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | /* QT */ | 30 | /* QT */ |
31 | 31 | ||
32 | #include <qpixmap.h> | 32 | #include <qpixmap.h> |
33 | 33 | ||
34 | /* OPIE */ | 34 | /* OPIE */ |
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 | ||
43 | OListView::OListView( QWidget *parent, const char *name ) | 48 | OListView::OListView( QWidget *parent, const char *name ) |
44 | :QListView( parent, name ) | 49 | :QListView( parent, name ) |
45 | { | 50 | { |
46 | //FIXME: get from global settings and calculate ==> see oglobalsettings.* | 51 | //FIXME: get from global settings and calculate ==> see oglobalsettings.* |
47 | 52 | ||
48 | m_alternateBackground = QColor( 238, 246, 255 ); | 53 | m_alternateBackground = QColor( 238, 246, 255 ); |
49 | m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine ); | 54 | m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine ); |
50 | m_fullWidth = true; | 55 | m_fullWidth = true; |
@@ -746,12 +751,14 @@ ONamedListViewItem* ONamedListViewItem::find( int column, const QString& text, i | |||
746 | } | 751 | } |
747 | 752 | ||
748 | 753 | ||
749 | ONamedListViewItem* ONamedListViewItem::find( const QString& column, const QString& text, int recurse ) const | 754 | ONamedListViewItem* ONamedListViewItem::find( const QString& column, const QString& text, int recurse ) const |
750 | { | 755 | { |
751 | int col = ( (ONamedListView*) listView() )->findColumn( column ); | 756 | int col = ( (ONamedListView*) listView() )->findColumn( column ); |
752 | if ( col != -1 ) | 757 | if ( col != -1 ) |
753 | return ( (ONamedListView*) listView() )->find( (ONamedListViewItem*) firstChild(), col, text, recurse ); | 758 | return ( (ONamedListView*) listView() )->find( (ONamedListViewItem*) firstChild(), col, text, recurse ); |
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 | |||
@@ -27,42 +27,46 @@ | |||
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef OLISTVIEW_H | 30 | #ifndef OLISTVIEW_H |
31 | #define OLISTVIEW_H | 31 | #define OLISTVIEW_H |
32 | 32 | ||
33 | #include <qcolor.h> | 33 | #include <qcolor.h> |
34 | #include <qlistview.h> | 34 | #include <qlistview.h> |
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 | /*====================================================================================== |
43 | * OListView | 46 | * OListView |
44 | *======================================================================================*/ | 47 | *======================================================================================*/ |
45 | 48 | ||
46 | /** | 49 | /** |
47 | * @brief A list/tree widget. | 50 | * @brief A list/tree widget. |
48 | * | 51 | * |
49 | * A @ref QListView variant featuring visual and functional enhancements | 52 | * A @ref QListView variant featuring visual and functional enhancements |
50 | * like an alternate background for odd rows, an autostretch mode | 53 | * like an alternate background for odd rows, an autostretch mode |
51 | * for the width of the widget ( >= Qt 3 only ) and persistence capabilities. | 54 | * for the width of the widget ( >= Qt 3 only ) and persistence capabilities. |
52 | * | 55 | * |
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 | * |
61 | * The parameters @a parent and @a name are handled by | 65 | * The parameters @a parent and @a name are handled by |
62 | * @ref QListView, as usual. | 66 | * @ref QListView, as usual. |
63 | */ | 67 | */ |
64 | OListView( QWidget* parent = 0, const char* name = 0 ); | 68 | OListView( QWidget* parent = 0, const char* name = 0 ); |
65 | /** | 69 | /** |
66 | * Destructor. | 70 | * Destructor. |
67 | */ | 71 | */ |
68 | virtual ~OListView(); | 72 | virtual ~OListView(); |
@@ -130,26 +134,28 @@ class OListView: public QListView | |||
130 | * Collapse all items | 134 | * Collapse all items |
131 | */ | 135 | */ |
132 | void collapse(); | 136 | void collapse(); |
133 | 137 | ||
134 | protected slots: | 138 | protected slots: |
135 | /** | 139 | /** |
136 | * expand the current OListViewItem | 140 | * expand the current OListViewItem |
137 | */ | 141 | */ |
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 | /** |
148 | * @relates OListView | 154 | * @relates OListView |
149 | * Writes @a listview to the @a stream and returns a reference to the stream. | 155 | * Writes @a listview to the @a stream and returns a reference to the stream. |
150 | */ | 156 | */ |
151 | QDataStream& operator<<( QDataStream& stream, const OListView& listview ); | 157 | QDataStream& operator<<( QDataStream& stream, const OListView& listview ); |
152 | /** | 158 | /** |
153 | * @relates OListView | 159 | * @relates OListView |
154 | * Reads @a listview from the @a stream and returns a reference to the stream. | 160 | * Reads @a listview from the @a stream and returns a reference to the stream. |
155 | */ | 161 | */ |
@@ -233,26 +239,28 @@ class OListViewItem: public QListViewItem | |||
233 | * serialize this object to or from a @ref QDataStream | 239 | * serialize this object to or from a @ref QDataStream |
234 | * @param s the stream used to serialize this object. | 240 | * @param s the stream used to serialize this object. |
235 | */ | 241 | */ |
236 | virtual void serializeFrom( QDataStream& s ); | 242 | virtual void serializeFrom( QDataStream& s ); |
237 | #endif | 243 | #endif |
238 | 244 | ||
239 | /** | 245 | /** |
240 | * expand the the item | 246 | * expand the the item |
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 | /** |
251 | * @relates QListViewItem | 259 | * @relates QListViewItem |
252 | * Writes listview @a item and all subitems recursively to @a stream | 260 | * Writes listview @a item and all subitems recursively to @a stream |
253 | * and returns a reference to the stream. | 261 | * and returns a reference to the stream. |
254 | */ | 262 | */ |
255 | QDataStream& operator<<( QDataStream& stream, const OListViewItem& item ); | 263 | QDataStream& operator<<( QDataStream& stream, const OListViewItem& item ); |
256 | /** | 264 | /** |
257 | * @relates QListViewItem | 265 | * @relates QListViewItem |
258 | * Reads listview @a item from @a stream and returns a reference to the stream. | 266 | * Reads listview @a item from @a stream and returns a reference to the stream. |
@@ -345,24 +353,27 @@ class ONamedListView: public OListView | |||
345 | * Set @a recurse to indicate how much subchild levels to search, e.g.<ul> | 353 | * Set @a recurse to indicate how much subchild levels to search, e.g.<ul> |
346 | * <li>set it to 0 to search only among direct childs, | 354 | * <li>set it to 0 to search only among direct childs, |
347 | * <li>set it to 1 to search direct childs and all 1st order subchilds | 355 | * <li>set it to 1 to search direct childs and all 1st order subchilds |
348 | * <li>set it to -1 for maximum recursion. | 356 | * <li>set it to -1 for maximum recursion. |
349 | * </ul> | 357 | * </ul> |
350 | * @sa ONamedListViewItem::find() | 358 | * @sa ONamedListViewItem::find() |
351 | */ | 359 | */ |
352 | virtual ONamedListViewItem* find( ONamedListViewItem* start, int column, const QString& text, int recurse = -1 ) const; | 360 | virtual ONamedListViewItem* find( ONamedListViewItem* start, int column, const QString& text, int recurse = -1 ) const; |
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 |
361 | *======================================================================================*/ | 372 | *======================================================================================*/ |
362 | 373 | ||
363 | /** | 374 | /** |
364 | * @brief An OListView variant with named columns. | 375 | * @brief An OListView variant with named columns. |
365 | * | 376 | * |
366 | * This class provides a higher-level interface to an OListViewItem. | 377 | * This class provides a higher-level interface to an OListViewItem. |
367 | * | 378 | * |
368 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> | 379 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> |
@@ -394,16 +405,22 @@ class ONamedListViewItem: public OListViewItem | |||
394 | virtual void setText( const QStringList& texts ); | 405 | virtual void setText( const QStringList& texts ); |
395 | /** | 406 | /** |
396 | * @returns the first child which has a @a text in column @a column. | 407 | * @returns the first child which has a @a text in column @a column. |
397 | * Set @a recurse to indicate how much subchild levels to search, e.g.<ul> | 408 | * Set @a recurse to indicate how much subchild levels to search, e.g.<ul> |
398 | * <li>set it to 0 to search only among direct childs, | 409 | * <li>set it to 0 to search only among direct childs, |
399 | * <li>set it to 1 to search direct childs and all 1st order subchilds | 410 | * <li>set it to 1 to search direct childs and all 1st order subchilds |
400 | * <li>set it to -1 for maximum recursion. | 411 | * <li>set it to -1 for maximum recursion. |
401 | * </ul> | 412 | * </ul> |
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 | |||
@@ -1,46 +1,43 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on debug | 2 | CONFIG += qt warn_on debug |
3 | DESTDIR = $(OPIEDIR)/lib | 3 | DESTDIR = $(OPIEDIR)/lib |
4 | HEADERS = oclickablelabel.h \ | 4 | 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 \ |
18 | otabwidget.h \ | 16 | otabwidget.h \ |
19 | otaskbarapplet.h \ | 17 | otaskbarapplet.h \ |
20 | oticker.h \ | 18 | oticker.h \ |
21 | otimepicker.h \ | 19 | otimepicker.h \ |
22 | oversatileview.h \ | 20 | oversatileview.h \ |
23 | oversatileviewitem.h \ | 21 | oversatileviewitem.h \ |
24 | owait.h | 22 | owait.h |
25 | 23 | ||
26 | SOURCES = oclickablelabel.cpp \ | 24 | SOURCES = oclickablelabel.cpp \ |
27 | odialog.cpp \ | 25 | odialog.cpp \ |
28 | ofontselector.cpp \ | 26 | ofontselector.cpp \ |
29 | oimageeffect.cpp \ | 27 | oimageeffect.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 \ |
39 | otaskbarapplet.cpp \ | 36 | otaskbarapplet.cpp \ |
40 | oticker.cpp \ | 37 | oticker.cpp \ |
41 | otimepicker.cpp \ | 38 | otimepicker.cpp \ |
42 | oversatileview.cpp \ | 39 | oversatileview.cpp \ |
43 | oversatileviewitem.cpp \ | 40 | oversatileviewitem.cpp \ |
44 | owait.cpp | 41 | owait.cpp |
45 | 42 | ||
46 | include ( big-screen/big-screen.pro ) | 43 | include ( big-screen/big-screen.pro ) |
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 | |||
@@ -8,24 +8,26 @@ | |||
8 | // $Id$ | 8 | // $Id$ |
9 | 9 | ||
10 | /* QT */ | 10 | /* QT */ |
11 | 11 | ||
12 | #include <qimage.h> | 12 | #include <qimage.h> |
13 | #include <qpainter.h> | 13 | #include <qpainter.h> |
14 | 14 | ||
15 | /* OPIE */ | 15 | /* OPIE */ |
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 | // |
24 | //====================================================================== | 26 | //====================================================================== |
25 | 27 | ||
26 | 28 | ||
27 | OPixmap& OPixmapEffect::gradient(OPixmap &pixmap, const QColor &ca, | 29 | OPixmap& OPixmapEffect::gradient(OPixmap &pixmap, const QColor &ca, |
28 | const QColor &cb, GradientType eff, int ncols) | 30 | const QColor &cb, GradientType eff, int ncols) |
29 | { | 31 | { |
30 | if(pixmap.depth() > 8 && | 32 | if(pixmap.depth() > 8 && |
31 | (eff == VerticalGradient || eff == HorizontalGradient)) { | 33 | (eff == VerticalGradient || eff == HorizontalGradient)) { |
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 | |||
@@ -6,24 +6,27 @@ | |||
6 | */ | 6 | */ |
7 | 7 | ||
8 | // $Id$ | 8 | // $Id$ |
9 | 9 | ||
10 | #ifndef __OPIXMAP_EFFECT_H | 10 | #ifndef __OPIXMAP_EFFECT_H |
11 | #define __OPIXMAP_EFFECT_H | 11 | #define __OPIXMAP_EFFECT_H |
12 | 12 | ||
13 | 13 | ||
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 |
22 | * static, so there is no need to create an instance of this class. You can | 25 | * static, so there is no need to create an instance of this class. You can |
23 | * just call the static methods. They are encapsulated here merely to provide | 26 | * just call the static methods. They are encapsulated here merely to provide |
24 | * a common namespace. | 27 | * a common namespace. |
25 | */ | 28 | */ |
26 | class OPixmapEffect | 29 | class OPixmapEffect |
27 | { | 30 | { |
28 | public: | 31 | public: |
29 | enum GradientType { VerticalGradient, HorizontalGradient, | 32 | enum GradientType { VerticalGradient, HorizontalGradient, |
@@ -201,15 +204,16 @@ public: | |||
201 | * @return Returns the @ref pixmap(), provided for convenience. | 204 | * @return Returns the @ref pixmap(), provided for convenience. |
202 | */ | 205 | */ |
203 | static OPixmap& dither(OPixmap &pixmap, const QColor *palette, int size); | 206 | static OPixmap& dither(OPixmap &pixmap, const QColor *palette, int size); |
204 | 207 | ||
205 | /** | 208 | /** |
206 | * Calculate a 'selected' pixmap, for instance a selected icon | 209 | * Calculate a 'selected' pixmap, for instance a selected icon |
207 | * on the desktop. | 210 | * on the desktop. |
208 | * @param pixmap the pixmap to select | 211 | * @param pixmap the pixmap to select |
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 | |||
@@ -11,17 +11,19 @@ | |||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
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 );*/ } |
27 | 29 | ||
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 | |||
@@ -14,41 +14,49 @@ | |||
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef OPIXMAPPROVIDER_H | 21 | #ifndef OPIXMAPPROVIDER_H |
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. |
31 | * | 34 | * |
32 | * Used e.g. by @ref KHistoryCombo | 35 | * Used e.g. by @ref KHistoryCombo |
33 | * | 36 | * |
34 | * @author Carsten Pfeiffer <pfeiffer@kde.org> | 37 | * @author Carsten Pfeiffer <pfeiffer@kde.org> |
35 | * @short an abstract interface for looking up icons | 38 | * @short an abstract interface for looking up icons |
36 | */ | 39 | */ |
37 | class OPixmapProvider | 40 | class OPixmapProvider |
38 | { | 41 | { |
39 | public: | 42 | public: |
40 | virtual ~OPixmapProvider(); | 43 | virtual ~OPixmapProvider(); |
41 | /** | 44 | /** |
42 | * You may subclass this and return a pixmap of size @p size for @p text. | 45 | * You may subclass this and return a pixmap of size @p size for @p text. |
43 | * @param text the text that is associated with the pixmap | 46 | * @param text the text that is associated with the pixmap |
44 | * @param size the size of the icon in pixels, 0 for defaylt size. | 47 | * @param size the size of the icon in pixels, 0 for defaylt size. |
45 | * See @ref KIcon::StdSize. | 48 | * See @ref KIcon::StdSize. |
46 | * @return the pixmap for the arguments, or null if there is none | 49 | * @return the pixmap for the arguments, or null if there is none |
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 | |||
@@ -18,24 +18,27 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | /* QT */ | 20 | /* QT */ |
21 | 21 | ||
22 | #include <qdrawutil.h> | 22 | #include <qdrawutil.h> |
23 | #include <qtimer.h> | 23 | #include <qtimer.h> |
24 | 24 | ||
25 | /* OPIE */ | 25 | /* OPIE */ |
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); |
34 | } | 37 | } |
35 | 38 | ||
36 | OPopupTitle::OPopupTitle(OPixmapEffect::GradientType /* gradient */, | 39 | OPopupTitle::OPopupTitle(OPixmapEffect::GradientType /* gradient */, |
37 | const QColor &/* color */, const QColor &/* textColor */, | 40 | const QColor &/* color */, const QColor &/* textColor */, |
38 | QWidget *parent, const char *name) | 41 | QWidget *parent, const char *name) |
39 | : QWidget(parent, name) | 42 | : QWidget(parent, name) |
40 | { | 43 | { |
41 | setMinimumSize(16, fontMetrics().height()+8); | 44 | 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 | |||
@@ -22,24 +22,26 @@ | |||
22 | #define _OPOPUP_H | 22 | #define _OPOPUP_H |
23 | 23 | ||
24 | #define INCLUDE_MENUITEM_DEF | 24 | #define INCLUDE_MENUITEM_DEF |
25 | 25 | ||
26 | /* QT */ | 26 | /* QT */ |
27 | 27 | ||
28 | #include <qpopupmenu.h> | 28 | #include <qpopupmenu.h> |
29 | 29 | ||
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 |
38 | * @ref OPopupMenu::insertTitle will do it for you, but it is allowed if | 40 | * @ref OPopupMenu::insertTitle will do it for you, but it is allowed if |
39 | * you wish to customize it's look. | 41 | * you wish to customize it's look. |
40 | * | 42 | * |
41 | * @author Daniel M. Duley <mosfet@kde.org> | 43 | * @author Daniel M. Duley <mosfet@kde.org> |
42 | * @short OPopupMenu title widget. | 44 | * @short OPopupMenu title widget. |
43 | */ | 45 | */ |
44 | class OPopupTitle : public QWidget | 46 | class OPopupTitle : public QWidget |
45 | { | 47 | { |
@@ -247,13 +249,16 @@ protected slots: | |||
247 | QString underlineText(const QString& text, uint length); | 249 | QString underlineText(const QString& text, uint length); |
248 | /// @since 3.1 | 250 | /// @since 3.1 |
249 | void resetKeyboardVars(bool noMatches = false); | 251 | void resetKeyboardVars(bool noMatches = false); |
250 | void itemHighlighted(int whichItem); | 252 | void itemHighlighted(int whichItem); |
251 | void showCtxMenu(QPoint pos); | 253 | void showCtxMenu(QPoint pos); |
252 | void ctxMenuHiding(); | 254 | void ctxMenuHiding(); |
253 | 255 | ||
254 | private: | 256 | 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 | |||
@@ -27,24 +27,26 @@ | |||
27 | #include <opie2/oimageeffect.h> | 27 | #include <opie2/oimageeffect.h> |
28 | #include <opie2/oselector.h> | 28 | #include <opie2/oselector.h> |
29 | 29 | ||
30 | #define STORE_W 8 | 30 | #define STORE_W 8 |
31 | #define STORE_W2 STORE_W * 2 | 31 | #define STORE_W2 STORE_W * 2 |
32 | 32 | ||
33 | //----------------------------------------------------------------------------- | 33 | //----------------------------------------------------------------------------- |
34 | /* | 34 | /* |
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; |
43 | yPos = 0; | 45 | yPos = 0; |
44 | minX = 0; | 46 | minX = 0; |
45 | minY = 0; | 47 | minY = 0; |
46 | maxX = 100; | 48 | maxX = 100; |
47 | maxY = 100; | 49 | maxY = 100; |
48 | store.setOptimization( QPixmap::BestOptim ); | 50 | store.setOptimization( QPixmap::BestOptim ); |
49 | store.resize( STORE_W2, STORE_W2 ); | 51 | store.resize( STORE_W2, STORE_W2 ); |
50 | } | 52 | } |
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 | |||
@@ -18,24 +18,27 @@ | |||
18 | */ | 18 | */ |
19 | //----------------------------------------------------------------------------- | 19 | //----------------------------------------------------------------------------- |
20 | // Selector widgets for KDE Color Selector, but probably useful for other | 20 | // Selector widgets for KDE Color Selector, but probably useful for other |
21 | // stuff also. | 21 | // stuff also. |
22 | 22 | ||
23 | #ifndef __OSELECT_H__ | 23 | #ifndef __OSELECT_H__ |
24 | #define __OSELECT_H__ | 24 | #define __OSELECT_H__ |
25 | 25 | ||
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 |
34 | * by a cross. An example is the @ref OHSSelector which | 37 | * by a cross. An example is the @ref OHSSelector which |
35 | * allows to choose from a range of colors, and which is | 38 | * allows to choose from a range of colors, and which is |
36 | * used in OColorDialog. | 39 | * used in OColorDialog. |
37 | * | 40 | * |
38 | * A custom drawing routine for the widget surface has | 41 | * A custom drawing routine for the widget surface has |
39 | * to be provided by the subclass. | 42 | * to be provided by the subclass. |
40 | */ | 43 | */ |
41 | class OXYSelector : public QWidget | 44 | class OXYSelector : public QWidget |
@@ -503,16 +506,18 @@ protected: | |||
503 | int h; | 506 | int h; |
504 | int s; | 507 | int s; |
505 | int v; | 508 | int v; |
506 | int r; | 509 | int r; |
507 | int g; | 510 | int g; |
508 | int b; | 511 | int b; |
509 | 512 | ||
510 | private: | 513 | 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 | |||
@@ -27,24 +27,26 @@ | |||
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 | 31 | ||
32 | /* OPIE */ | 32 | /* OPIE */ |
33 | 33 | ||
34 | #include <opie2/odebug.h> | 34 | #include <opie2/odebug.h> |
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 | { |
43 | setLineWidth(1); | 45 | setLineWidth(1); |
44 | setMidLineWidth(0); | 46 | setMidLineWidth(0); |
45 | setOrientation( HLine ); | 47 | setOrientation( HLine ); |
46 | } | 48 | } |
47 | 49 | ||
48 | 50 | ||
49 | 51 | ||
50 | OSeparator::OSeparator(int orientation, QWidget* parent, const char* name, WFlags f) | 52 | OSeparator::OSeparator(int orientation, QWidget* parent, const char* name, WFlags f) |
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 | |||
@@ -26,24 +26,27 @@ | |||
26 | -- :-=` this library; see the file COPYING.LIB. | 26 | -- :-=` this library; see the file COPYING.LIB. |
27 | If not, write to the Free Software Foundation, | 27 | If not, write to the Free Software Foundation, |
28 | Inc., 59 Temple Place - Suite 330, | 28 | Inc., 59 Temple Place - Suite 330, |
29 | Boston, MA 02111-1307, USA. | 29 | Boston, MA 02111-1307, USA. |
30 | 30 | ||
31 | */ | 31 | */ |
32 | 32 | ||
33 | #ifndef OSEPARATOR_H | 33 | #ifndef OSEPARATOR_H |
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> |
42 | * @author Michael Roth <mroth@wirlweb.de> | 45 | * @author Michael Roth <mroth@wirlweb.de> |
43 | * @version $Id$ | 46 | * @version $Id$ |
44 | */ | 47 | */ |
45 | class OSeparator : public QFrame | 48 | class OSeparator : public QFrame |
46 | { | 49 | { |
47 | Q_OBJECT | 50 | Q_OBJECT |
48 | Q_PROPERTY( int orientation READ orientation WRITE setOrientation ) | 51 | Q_PROPERTY( int orientation READ orientation WRITE setOrientation ) |
49 | public: | 52 | public: |
@@ -77,14 +80,16 @@ class OSeparator : public QFrame | |||
77 | /** | 80 | /** |
78 | * The recommended height (width) for a horizontal (vertical) separator. | 81 | * The recommended height (width) for a horizontal (vertical) separator. |
79 | **/ | 82 | **/ |
80 | virtual QSize sizeHint() const; | 83 | virtual QSize sizeHint() const; |
81 | 84 | ||
82 | protected: | 85 | protected: |
83 | virtual void drawFrame( QPainter * ); | 86 | virtual void drawFrame( QPainter * ); |
84 | 87 | ||
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 | |||
@@ -22,25 +22,25 @@ | |||
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
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 | 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 | {} |
39 | 39 | ||
40 | void OTabBar::paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const | 40 | void OTabBar::paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const |
41 | { | 41 | { |
42 | 42 | ||
43 | QRect r = br; | 43 | QRect r = br; |
44 | if ( t->iconset) | 44 | if ( t->iconset) |
45 | { | 45 | { |
46 | QIconSet::Mode mode = (t->enabled && isEnabled()) ? QIconSet::Normal : QIconSet::Disabled; | 46 | QIconSet::Mode mode = (t->enabled && isEnabled()) ? QIconSet::Normal : QIconSet::Disabled; |
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 | |||
@@ -26,26 +26,26 @@ | |||
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
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 | 31 | ||
32 | #ifndef OTABBAR_H | 32 | #ifndef OTABBAR_H |
33 | #define OTABBAR_H | 33 | #define OTABBAR_H |
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. |
44 | * | 44 | * |
45 | * OTabBar is a derivation of TrollTech's QTabBar which provides | 45 | * OTabBar is a derivation of TrollTech's QTabBar which provides |
46 | * a row of tabs for selection. The only difference between this | 46 | * a row of tabs for selection. The only difference between this |
47 | * class and QTabBar is that there is no dotted line box around | 47 | * class and QTabBar is that there is no dotted line box around |
48 | * the label of the tab with the current focus. | 48 | * the label of the tab with the current focus. |
49 | */ | 49 | */ |
50 | class OTabBar : public QTabBar | 50 | class OTabBar : public QTabBar |
51 | { | 51 | { |
@@ -71,15 +71,16 @@ protected: | |||
71 | * @param p Pointer to QPainter used for drawing. | 71 | * @param p Pointer to QPainter used for drawing. |
72 | * @param br QRect providing region to draw label in. | 72 | * @param br QRect providing region to draw label in. |
73 | * @param t Tab to draw label for. | 73 | * @param t Tab to draw label for. |
74 | * @param has_focus Boolean value not used, retained for compatibility reasons. | 74 | * @param has_focus Boolean value not used, retained for compatibility reasons. |
75 | */ | 75 | */ |
76 | void paintLabel( QPainter *, const QRect &, QTab *, bool ) const; | 76 | void paintLabel( QPainter *, const QRect &, QTab *, bool ) const; |
77 | 77 | ||
78 | private: | 78 | 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 | |||
@@ -29,26 +29,26 @@ | |||
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #ifndef OTABINFO_H | 32 | #ifndef OTABINFO_H |
33 | #define OTABINFO_H | 33 | #define OTABINFO_H |
34 | 34 | ||
35 | /* QT */ | 35 | /* QT */ |
36 | #include <qlist.h> | 36 | #include <qlist.h> |
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 |
47 | * of widgets added to the control. | 47 | * of widgets added to the control. |
48 | * | 48 | * |
49 | * OTabInfo provides the following information about a widget added to an | 49 | * OTabInfo provides the following information about a widget added to an |
50 | * OTabWidget control: | 50 | * OTabWidget control: |
51 | * | 51 | * |
52 | * ID - integer tab bar ID | 52 | * ID - integer tab bar ID |
53 | * Control - QWidget pointer to child widget | 53 | * Control - QWidget pointer to child widget |
54 | * Label - QString text label for OTabWidget selection control | 54 | * Label - QString text label for OTabWidget selection control |
@@ -126,15 +126,16 @@ private: | |||
126 | QString p; | 126 | QString p; |
127 | QString l; | 127 | QString l; |
128 | class Private; | 128 | class Private; |
129 | Private *d; | 129 | Private *d; |
130 | }; | 130 | }; |
131 | 131 | ||
132 | /** | 132 | /** |
133 | * @class OTabInfoList | 133 | * @class OTabInfoList |
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 | |||
@@ -32,25 +32,25 @@ | |||
32 | #include <opie2/otabwidget.h> | 32 | #include <opie2/otabwidget.h> |
33 | 33 | ||
34 | /* OPIE */ | 34 | /* OPIE */ |
35 | #include <qpe/applnk.h> | 35 | #include <qpe/applnk.h> |
36 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
37 | #include <qpe/resource.h> | 37 | #include <qpe/resource.h> |
38 | #include <opie2/otabbar.h> | 38 | #include <opie2/otabbar.h> |
39 | 39 | ||
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 | { |
49 | if ( s == Global ) | 49 | if ( s == Global ) |
50 | { | 50 | { |
51 | Config config( "qpe" ); | 51 | Config config( "qpe" ); |
52 | config.setGroup( "Appearance" ); | 52 | config.setGroup( "Appearance" ); |
53 | s = ( TabStyle ) config.readNumEntry( "TabStyle", (int) IconTab ); | 53 | s = ( TabStyle ) config.readNumEntry( "TabStyle", (int) IconTab ); |
54 | if ( s <= Global || s > IconList) | 54 | if ( s <= Global || s > IconList) |
55 | { | 55 | { |
56 | s = IconTab; | 56 | s = IconTab; |
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 | |||
@@ -29,33 +29,32 @@ | |||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #ifndef OTABWIDGET_H | 31 | #ifndef OTABWIDGET_H |
32 | #define OTABWIDGET_H | 32 | #define OTABWIDGET_H |
33 | 33 | ||
34 | /* OPIE */ | 34 | /* OPIE */ |
35 | #include <opie2/otabinfo.h> | 35 | #include <opie2/otabinfo.h> |
36 | 36 | ||
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 | /** |
54 | * @class OTabWidget | 53 | * @class OTabWidget |
55 | * @brief The OTabWidget class provides a stack of widgets. | 54 | * @brief The OTabWidget class provides a stack of widgets. |
56 | * | 55 | * |
57 | * OTabWidget is a derivation of TrollTech's QTabWidget which provides | 56 | * OTabWidget is a derivation of TrollTech's QTabWidget which provides |
58 | * a stack of widgets. Widgets can be selected using either a tab bar or | 57 | * a stack of widgets. Widgets can be selected using either a tab bar or |
59 | * drop down list box. | 58 | * drop down list box. |
60 | * | 59 | * |
61 | * The normal way to use OTabWidget is to do the following in the | 60 | * The normal way to use OTabWidget is to do the following in the |
@@ -278,15 +277,16 @@ private: | |||
278 | */ | 277 | */ |
279 | void slotTabBarSelected( int ); | 278 | void slotTabBarSelected( int ); |
280 | 279 | ||
281 | /** | 280 | /** |
282 | * @fn slotTabListSelected( int index ) | 281 | * @fn slotTabListSelected( int index ) |
283 | * @brief Slot which is called when a drop down selection is made. | 282 | * @brief Slot which is called when a drop down selection is made. |
284 | * | 283 | * |
285 | * @param id Index of widget selected. | 284 | * @param id Index of widget selected. |
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 | |||
@@ -19,14 +19,64 @@ | |||
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
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 | |||
@@ -24,29 +24,38 @@ | |||
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
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 | 31 | ||
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 ) |
45 | { | 54 | { |
46 | } | 55 | } |
47 | 56 | ||
48 | virtual ~OTaskbarAppletWrapper() | 57 | virtual ~OTaskbarAppletWrapper() |
49 | { | 58 | { |
50 | delete _applet; | 59 | delete _applet; |
51 | } | 60 | } |
52 | 61 | ||
@@ -71,60 +80,50 @@ template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface | |||
71 | { | 80 | { |
72 | if ( !_applet ) _applet = new T( parent ); | 81 | if ( !_applet ) _applet = new T( parent ); |
73 | return _applet; | 82 | return _applet; |
74 | } | 83 | } |
75 | 84 | ||
76 | virtual int position() const | 85 | virtual int position() const |
77 | { | 86 | { |
78 | return T::position(); | 87 | return T::position(); |
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 | ||
95 | // Must be inline until after we shipped Opie 1.0 | 100 | // Must be inline until after we shipped Opie 1.0 |
96 | 101 | ||
97 | // Having OTaskBarApplet reside in libopieui2 is not possible | 102 | // Having OTaskBarApplet reside in libopieui2 is not possible |
98 | // until we link the launcher binary against libopieui2 - | 103 | // until we link the launcher binary against libopieui2 - |
99 | // otherwise the necessary symbols are not present, when | 104 | // otherwise the necessary symbols are not present, when |
100 | // the dynamic loader [dlopen] tries to resolve an applet which | 105 | // the dynamic loader [dlopen] tries to resolve an applet which |
101 | // inherits OTaskbarApplet | 106 | // inherits OTaskbarApplet |
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 | 113 | ||
112 | virtual ~OTaskbarApplet() | 114 | protected: |
113 | { | 115 | virtual void popup( QWidget* widget ); |
116 | private: | ||
117 | class Private; | ||
118 | Private *d; | ||
119 | }; | ||
120 | } | ||
114 | } | 121 | } |
115 | 122 | ||
116 | protected: | 123 | #define EXPORT_OPIE_APPLET_v1( AppLet ) \ |
117 | virtual void popup( QWidget* widget ) | 124 | Q_EXPORT_INTERFACE() { \ |
118 | { | 125 | Q_CREATE_INSTANCE( Opie::Ui::Private::OTaskbarAppletWrapper<AppLet> ) \ |
119 | QPoint curPos = mapToGlobal( QPoint( 0, 0 ) ); | ||
120 | int w = widget->sizeHint().width(); | ||
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 | } | 126 | } |
127 | }; | ||
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 | |||
@@ -18,32 +18,36 @@ | |||
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
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 |
42 | * @param name The name of the object | 46 | * @param name The name of the object |
43 | * @param fl Window Flags | 47 | * @param fl Window Flags |
44 | */ | 48 | */ |
45 | OTimePicker::OTimePicker(QWidget* parent, const char* name, Qt::WFlags fl) | 49 | OTimePicker::OTimePicker(QWidget* parent, const char* name, Qt::WFlags fl) |
46 | :QWidget(parent,name,fl) | 50 | :QWidget(parent,name,fl) |
47 | { | 51 | { |
48 | QVBoxLayout *vbox=new QVBoxLayout(this); | 52 | QVBoxLayout *vbox=new QVBoxLayout(this); |
49 | 53 | ||
@@ -211,24 +215,26 @@ void OTimePicker::setHour(int h) | |||
211 | 215 | ||
212 | 216 | ||
213 | /** | 217 | /** |
214 | * This is a modal Dialog. | 218 | * This is a modal Dialog. |
215 | * | 219 | * |
216 | * @param parent The parent widget | 220 | * @param parent The parent widget |
217 | * @param name The name of the object | 221 | * @param name The name of the object |
218 | * @param fl Possible window flags | 222 | * @param fl Possible window flags |
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&) ), |
227 | this, SLOT ( setMinute(const QString&) ) ); | 233 | this, SLOT ( setMinute(const QString&) ) ); |
228 | connect ( hourField, SIGNAL( textChanged(const QString&) ), | 234 | connect ( hourField, SIGNAL( textChanged(const QString&) ), |
229 | this, SLOT ( setHour(const QString&) ) ); | 235 | this, SLOT ( setHour(const QString&) ) ); |
230 | 236 | ||
231 | } | 237 | } |
232 | 238 | ||
233 | /** | 239 | /** |
234 | * @return the time | 240 | * @return the time |
@@ -281,12 +287,15 @@ void OTimePickerDialog::setHour ( const QString& hour ) | |||
281 | * Method to set a new minute. It tries to convert the string to int and | 287 | * Method to set a new minute. It tries to convert the string to int and |
282 | * if the resulting date is valid a new date is set. | 288 | * if the resulting date is valid a new date is set. |
283 | * @see setHour | 289 | * @see setHour |
284 | */ | 290 | */ |
285 | void OTimePickerDialog::setMinute ( const QString& minute ) | 291 | void OTimePickerDialog::setMinute ( const QString& minute ) |
286 | { | 292 | { |
287 | if ( QTime::isValid ( m_time.hour(), minute.toInt(), 00 ) ) | 293 | if ( QTime::isValid ( m_time.hour(), minute.toInt(), 00 ) ) |
288 | { | 294 | { |
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 | |||
@@ -23,36 +23,35 @@ | |||
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
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 | #ifndef OTIMEPICKER_H | 30 | #ifndef OTIMEPICKER_H |
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. |
51 | * A time can be selected by two clicks of a user | 50 | * A time can be selected by two clicks of a user |
52 | * | 51 | * |
53 | * @short A widget to quickly pick a QTime | 52 | * @short A widget to quickly pick a QTime |
54 | * @version 1.0 | 53 | * @version 1.0 |
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 | */ |
@@ -105,21 +104,29 @@ class OTimePickerDialog: public OTimePickerDialogBase | |||
105 | public: | 104 | public: |
106 | OTimePickerDialog ( QWidget* parent = 0, const char* name = NULL, WFlags fl = 0 ); | 105 | OTimePickerDialog ( QWidget* parent = 0, const char* name = NULL, WFlags fl = 0 ); |
107 | ~OTimePickerDialog() { }; | 106 | ~OTimePickerDialog() { }; |
108 | 107 | ||
109 | QTime time()const; | 108 | QTime time()const; |
110 | 109 | ||
111 | public slots: | 110 | public slots: |
112 | void setTime( const QTime& time ); | 111 | void setTime( const QTime& time ); |
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 | |||
@@ -2,25 +2,25 @@ | |||
2 | <class>OTimePickerDialogBase</class> | 2 | <class>OTimePickerDialogBase</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>OTimePickerDialogBase</cstring> | 7 | <cstring>OTimePickerDialogBase</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
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"> |
19 | <name>sizePolicy</name> | 19 | <name>sizePolicy</name> |
20 | <sizepolicy> | 20 | <sizepolicy> |
21 | <hsizetype>3</hsizetype> | 21 | <hsizetype>3</hsizetype> |
22 | <vsizetype>1</vsizetype> | 22 | <vsizetype>1</vsizetype> |
23 | </sizepolicy> | 23 | </sizepolicy> |
24 | </property> | 24 | </property> |
25 | <property stdset="1"> | 25 | <property stdset="1"> |
26 | <name>caption</name> | 26 | <name>caption</name> |
@@ -240,53 +240,17 @@ | |||
240 | <name>title</name> | 240 | <name>title</name> |
241 | <string>Pick Time:</string> | 241 | <string>Pick Time:</string> |
242 | </property> | 242 | </property> |
243 | <grid> | 243 | <grid> |
244 | <property stdset="1"> | 244 | <property stdset="1"> |
245 | <name>margin</name> | 245 | <name>margin</name> |
246 | <number>11</number> | 246 | <number>11</number> |
247 | </property> | 247 | </property> |
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 | |||
@@ -31,24 +31,27 @@ | |||
31 | /* OPIE */ | 31 | /* OPIE */ |
32 | 32 | ||
33 | #include <opie2/odebug.h> | 33 | #include <opie2/odebug.h> |
34 | #include <opie2/oversatileview.h> | 34 | #include <opie2/oversatileview.h> |
35 | #include <opie2/oversatileviewitem.h> | 35 | #include <opie2/oversatileviewitem.h> |
36 | #include <opie2/olistview.h> | 36 | #include <opie2/olistview.h> |
37 | 37 | ||
38 | /* QT */ | 38 | /* QT */ |
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", |
47 | ".c #87BD88", | 50 | ".c #87BD88", |
48 | "+c #8BBE8B", | 51 | "+c #8BBE8B", |
49 | "@c #81BA81", | 52 | "@c #81BA81", |
50 | "#c #6DAF6D", | 53 | "#c #6DAF6D", |
51 | "$c #87BD87", | 54 | "$c #87BD87", |
52 | "%c #FCFDFC", | 55 | "%c #FCFDFC", |
53 | "&c #AED0AE", | 56 | "&c #AED0AE", |
54 | "*c #4E9C4C", | 57 | "*c #4E9C4C", |
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 | |||
@@ -36,33 +36,36 @@ | |||
36 | #include <qwidgetstack.h> | 36 | #include <qwidgetstack.h> |
37 | #include <qiconview.h> | 37 | #include <qiconview.h> |
38 | 38 | ||
39 | /* OPIE */ | 39 | /* OPIE */ |
40 | 40 | ||
41 | #include <opie2/oapplication.h> | 41 | #include <opie2/oapplication.h> |
42 | 42 | ||
43 | /* FORWARDS */ | 43 | /* FORWARDS */ |
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 |
65 | //==============================================================================================// | 68 | //==============================================================================================// |
66 | 69 | ||
67 | public: | 70 | public: |
68 | OVersatileView( QWidget* parent = 0, const char* name = 0, int mode = 0 ); | 71 | OVersatileView( QWidget* parent = 0, const char* name = 0, int mode = 0 ); |
@@ -381,14 +384,16 @@ public: | |||
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 | |||
@@ -22,24 +22,26 @@ | |||
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
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 | 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 | { |
38 | init(); | 40 | init(); |
39 | } | 41 | } |
40 | 42 | ||
41 | OVersatileViewItem::OVersatileViewItem( OVersatileView * parent, OVersatileViewItem * after ) | 43 | OVersatileViewItem::OVersatileViewItem( OVersatileView * parent, OVersatileViewItem * after ) |
42 | :OListViewItem( parent->_listview, after ), QIconViewItem( parent->_iconview, after ), | 44 | :OListViewItem( parent->_listview, after ), QIconViewItem( parent->_iconview, after ), |
43 | _versatileview( parent ) | 45 | _versatileview( parent ) |
44 | { | 46 | { |
45 | init(); | 47 | init(); |
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 | |||
@@ -31,24 +31,27 @@ | |||
31 | 31 | ||
32 | #ifndef OVERSATILEVIEWITEM_H | 32 | #ifndef OVERSATILEVIEWITEM_H |
33 | #define OVERSATILEVIEWITEM_H | 33 | #define OVERSATILEVIEWITEM_H |
34 | 34 | ||
35 | /* QT */ | 35 | /* QT */ |
36 | 36 | ||
37 | #include <qiconview.h> | 37 | #include <qiconview.h> |
38 | 38 | ||
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 | { |
47 | public: | 50 | public: |
48 | OVersatileViewItem( OVersatileView * parent ); | 51 | OVersatileViewItem( OVersatileView * parent ); |
49 | 52 | ||
50 | OVersatileViewItem( OVersatileView * parent, OVersatileViewItem * after ); | 53 | OVersatileViewItem( OVersatileView * parent, OVersatileViewItem * after ); |
51 | 54 | ||
52 | OVersatileViewItem( OVersatileViewItem * parent, OVersatileViewItem * after ); | 55 | OVersatileViewItem( OVersatileViewItem * parent, OVersatileViewItem * after ); |
53 | 56 | ||
54 | OVersatileViewItem( OVersatileView * parent, QString, | 57 | OVersatileViewItem( OVersatileView * parent, QString, |
@@ -88,13 +91,15 @@ class OVersatileViewItem : public OListViewItem, public QIconViewItem | |||
88 | virtual void setRenameEnabled( bool ); | 91 | virtual void setRenameEnabled( bool ); |
89 | 92 | ||
90 | // TODO: Implement the remaining method multiplexers | 93 | // TODO: Implement the remaining method multiplexers |
91 | 94 | ||
92 | private: | 95 | private: |
93 | OVersatileView* _versatileview; | 96 | OVersatileView* _versatileview; |
94 | 97 | ||
95 | private: | 98 | private: |
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 | |||
@@ -29,24 +29,26 @@ | |||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include "owait.h" | 31 | #include "owait.h" |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <qpe/qpeapplication.h> | 34 | #include <qpe/qpeapplication.h> |
35 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
36 | 36 | ||
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. |
45 | * | 47 | * |
46 | * The default timer length is 10. | 48 | * The default timer length is 10. |
47 | * | 49 | * |
48 | * @param parent The parent of the widget | 50 | * @param parent The parent of the widget |
49 | * @param msg The name of the object | 51 | * @param msg The name of the object |
50 | * @param dispIcon Display Icon? | 52 | * @param dispIcon Display Icon? |
51 | */ | 53 | */ |
52 | OWait::OWait( QWidget *parent, const char* msg, bool dispIcon ) | 54 | OWait::OWait( QWidget *parent, const char* msg, bool dispIcon ) |
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 | |||
@@ -28,24 +28,27 @@ | |||
28 | 28 | ||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #ifndef OWAIT_H | 31 | #ifndef OWAIT_H |
32 | #define OWAIT_H | 32 | #define OWAIT_H |
33 | 33 | ||
34 | /* QT */ | 34 | /* QT */ |
35 | #include <qdialog.h> | 35 | #include <qdialog.h> |
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 |
44 | * @see QDialog | 47 | * @see QDialog |
45 | * @author Maximilian Reiß | 48 | * @author Maximilian Reiß |
46 | */ | 49 | */ |
47 | class OWait : public QDialog | 50 | class OWait : public QDialog |
48 | { | 51 | { |
49 | Q_OBJECT | 52 | Q_OBJECT |
50 | 53 | ||
51 | public: | 54 | public: |
@@ -73,14 +76,15 @@ class OWait : public QDialog | |||
73 | private: | 76 | private: |
74 | void timerEvent( QTimerEvent * ); | 77 | void timerEvent( QTimerEvent * ); |
75 | void paintEvent( QPaintEvent * ); | 78 | void paintEvent( QPaintEvent * ); |
76 | 79 | ||
77 | QPixmap m_pix; | 80 | QPixmap m_pix; |
78 | QLabel *m_lb; | 81 | QLabel *m_lb; |
79 | QTimer *m_waitTimer; | 82 | QTimer *m_waitTimer; |
80 | int m_timerLength; | 83 | int m_timerLength; |
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 |