48 files changed, 378 insertions, 221 deletions
diff --git a/libopie2/opieui/big-screen/obigscreen_p.h b/libopie2/opieui/big-screen/obigscreen_p.h index db8fc83..a85a56c 100644 --- a/libopie2/opieui/big-screen/obigscreen_p.h +++ b/libopie2/opieui/big-screen/obigscreen_p.h @@ -5,10 +5,11 @@ #include <qstring.h> class QWidget; -namespace Opie -{ +namespace Opie { +namespace Ui { +namespace Private{ struct OSplitterContainer { bool operator==( const OSplitterContainer& o) const @@ -22,7 +23,9 @@ struct OSplitterContainer QString icon; QString name; }; -}; +} +} +} #endif diff --git a/libopie2/opieui/big-screen/osplitter.cpp b/libopie2/opieui/big-screen/osplitter.cpp index 89f3793..bcfd3a6 100644 --- a/libopie2/opieui/big-screen/osplitter.cpp +++ b/libopie2/opieui/big-screen/osplitter.cpp @@ -34,9 +34,10 @@ /* QT */ #include <qvaluelist.h> #include <qvbox.h> -using namespace Opie; +using namespace Opie::Ui; +using namespace Opie::Ui::Private; /** * * This is the constructor of OSplitter @@ -167,9 +168,9 @@ void OSplitter::addWidget( OSplitter* split ) if (m_tabWidget ) setTabWidget( m_parentTab ); else { - Opie::OSplitterContainer con; + OSplitterContainer con; con.widget =split; addToBox( con ); } } @@ -212,9 +213,9 @@ void OSplitter::addWidget( QWidget* wid, const QString& icon, const QString& lab qWarning("Widget is not valid!"); return; } #endif - Opie::OSplitterContainer cont; + OSplitterContainer cont; cont.widget = wid; cont.icon =icon; cont.name = label; @@ -395,9 +396,9 @@ void OSplitter::resizeEvent( QResizeEvent* res ) /* * Adds a container to a tab either the parent tab * or our own */ -void OSplitter::addToTab( const Opie::OSplitterContainer& con ) +void OSplitter::addToTab( const Opie::Ui::Private::OSplitterContainer& con ) { QWidget *wid = con.widget; // not needed widgetstack will reparent as well wid.reparent(m_tabWidget, wid->getWFlags(), QPoint(0, 0) ); if (m_parentTab ) @@ -409,9 +410,9 @@ void OSplitter::addToTab( const Opie::OSplitterContainer& con ) /* * adds a container to the box */ -void OSplitter::addToBox( const Opie::OSplitterContainer& con ) +void OSplitter::addToBox( const Opie::Ui::Private::OSplitterContainer& con ) { QWidget* wid = con.widget; wid->reparent(m_hbox, 0, QPoint(0, 0) ); } @@ -544,9 +545,9 @@ void OSplitter::commonChangeBox() for ( OSplitter* split = m_splitter.first(); split; split = m_splitter.next() ) { /* tell them the world had changed */ split->setTabWidget( 0 ); - Opie::OSplitterContainer con; + OSplitterContainer con; con.widget = split; // con.widget = split->m_tabWidget ? static_cast<QWidget*>(split->m_tabWidget) // : static_cast<QWidget*>(split->m_hbox); addToBox( con ); diff --git a/libopie2/opieui/big-screen/osplitter.h b/libopie2/opieui/big-screen/osplitter.h index 2daae7f..7b5ea53 100644 --- a/libopie2/opieui/big-screen/osplitter.h +++ b/libopie2/opieui/big-screen/osplitter.h @@ -22,9 +22,9 @@ -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - + */ #ifndef OSPLITTER_H #define OSPLITTER_H @@ -47,10 +47,10 @@ class QHBox; * -one more example * -allow inserting at a position */ -namespace Opie -{ +namespace Opie{ +namespace Ui { class OTabWidget; /** * @@ -72,9 +72,9 @@ class OTabWidget; class OSplitter : public QFrame { Q_OBJECT public: - typedef QValueList<Opie::OSplitterContainer> ContainerList; + typedef QValueList<Opie::Ui::Private::OSplitterContainer> ContainerList; OSplitter( Qt::Orientation = Horizontal, QWidget *parent = 0, const char* name = 0, WFlags fl = 0 ); ~OSplitter(); @@ -123,10 +123,10 @@ private: /* true if OTabMode */ bool layoutMode()const; // void reparentAll(); void setTabWidget( OTabWidget*); - void addToTab( const Opie::OSplitterContainer& ); - void addToBox( const Opie::OSplitterContainer& ); + void addToTab( const Opie::Ui::Private::OSplitterContainer& ); + void addToBox( const Opie::Ui::Private::OSplitterContainer& ); void removeFromTab( QWidget* ); void changeTab(); void changeHBox(); void changeVBox(); @@ -144,7 +144,8 @@ private: struct Private; Private *d; }; -}; +} +} #endif diff --git a/libopie2/opieui/big-screen/owidgetstack.cpp b/libopie2/opieui/big-screen/owidgetstack.cpp index 57e97e3..a0a6355 100644 --- a/libopie2/opieui/big-screen/owidgetstack.cpp +++ b/libopie2/opieui/big-screen/owidgetstack.cpp @@ -31,13 +31,13 @@ /* QT */ #include <qapplication.h> #include <qwidgetstack.h> -namespace { +namespace Opie { +namespace Ui { const int mode_size = 330; -} -using namespace Opie; + /** * This is the standard widget. For simple usage see the example. Normally this widget * is the central widget of a QMainWindow. @@ -432,4 +432,7 @@ void OWidgetStack::switchTop() { delete m_stack; m_stack = 0; } + +} +}
\ No newline at end of file diff --git a/libopie2/opieui/big-screen/owidgetstack.h b/libopie2/opieui/big-screen/owidgetstack.h index 53818c8..d2f9a9f 100644 --- a/libopie2/opieui/big-screen/owidgetstack.h +++ b/libopie2/opieui/big-screen/owidgetstack.h @@ -34,10 +34,10 @@ #include <qmap.h> class QWidgetStack; -namespace Opie -{ +namespace Opie { +namespace Ui { /** * * OWidgetStack is the answer to the problem of using Opie at different screen * sizes and to have a different behaviour. Most applications use a QWidgetStack @@ -126,7 +126,8 @@ private: struct Private; Private *d; }; -}; +} +} #endif diff --git a/libopie2/opieui/fileselector/ofiledialog.cpp b/libopie2/opieui/fileselector/ofiledialog.cpp index e7daead..beb4d6c 100644 --- a/libopie2/opieui/fileselector/ofiledialog.cpp +++ b/libopie2/opieui/fileselector/ofiledialog.cpp @@ -38,9 +38,9 @@ #include <qstring.h> #include <qapplication.h> #include <qlayout.h> -using namespace Opie; +using namespace Opie::Ui; namespace { /* diff --git a/libopie2/opieui/fileselector/ofiledialog.h b/libopie2/opieui/fileselector/ofiledialog.h index 01a599b..dfecf3d 100644 --- a/libopie2/opieui/fileselector/ofiledialog.h +++ b/libopie2/opieui/fileselector/ofiledialog.h @@ -34,10 +34,10 @@ /* QT */ #include <qdialog.h> -namespace Opie -{ +namespace Opie { +namespace Ui { /** * This class places a OFileSelector inside a QDialog. * It provides static method for letting a user chose @@ -103,7 +103,8 @@ private slots: void slotDirSelected(const QString & ); void slotSelectorOk(); }; -}; +} +} #endif diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp index 15cadd4..c4d5033 100644 --- a/libopie2/opieui/fileselector/ofileselector.cpp +++ b/libopie2/opieui/fileselector/ofileselector.cpp @@ -54,10 +54,13 @@ #include <qwidgetstack.h> #include <qregexp.h> #include <qobjectlist.h> -using namespace Opie; +using namespace Opie::Ui::Private; +namespace Opie { +namespace Ui { +namespace Private { OFileViewInterface::OFileViewInterface( OFileSelector* selector ) : m_selector( selector ) {} @@ -809,8 +812,10 @@ void OFileViewFileSystem::activate( const QString& str) { m_all = (str != QObject::tr("Files") ); } + +} /* Selector */ /** * @short new and complete c'tor * @@ -1163,4 +1168,6 @@ void OFileSelector::setNameVisible( bool b ) else m_nameBox->hide(); } +} +} diff --git a/libopie2/opieui/fileselector/ofileselector.h b/libopie2/opieui/fileselector/ofileselector.h index 7fa657b..2205963 100644 --- a/libopie2/opieui/fileselector/ofileselector.h +++ b/libopie2/opieui/fileselector/ofileselector.h @@ -51,13 +51,15 @@ class QWidgetStack; class QHBox; typedef QMap<QString, QStringList> MimeTypes; -namespace Opie -{ +namespace Opie { +namespace Ui { +namespace Private { class OFileViewInterface; class OFileViewFileListView; +} /** * @short a dropin replacement for the FileSelector @@ -72,10 +74,10 @@ class OFileViewFileListView; */ class OFileSelector : public QWidget { Q_OBJECT - friend class Opie::OFileViewInterface; - friend class Opie::OFileViewFileListView; + friend class Private::OFileViewInterface; + friend class Private::OFileViewFileListView; public: /** * The Mode of the Fileselector @@ -184,15 +186,15 @@ private: private: QLineEdit* m_lneEdit; // the LineEdit for the Name QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType QWidgetStack* m_stack; // our widget stack which will contain the views - OFileViewInterface* currentView() const; // returns the currentView - OFileViewInterface* m_current; // here is the view saved + Private::OFileViewInterface* currentView() const; // returns the currentView + Private::OFileViewInterface* m_current; // here is the view saved bool m_shNew : 1; // should we show New? bool m_shClose : 1; // should we show Close? MimeTypes m_mimeType; // list of mimetypes - QMap<QString, OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr + QMap<QString, Private::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr QHBox* m_nameBox; // the LineEdit + Label is hold here QHBox* m_cmbBox; // this holds the two combo boxes QString m_startDir; @@ -213,7 +215,8 @@ private slots: bool eventFilter (QObject *o, QEvent *e); }; -}; +} +} #endif diff --git a/libopie2/opieui/fileselector/ofileselector_p.h b/libopie2/opieui/fileselector/ofileselector_p.h index 818ced9..376dc98 100644 --- a/libopie2/opieui/fileselector/ofileselector_p.h +++ b/libopie2/opieui/fileselector/ofileselector_p.h @@ -55,12 +55,12 @@ typedef QMap<QString, QStringList> MimeTypes; /* the View Interface */ class QFileInfo; class QToolButton; -namespace Opie -{ - +namespace Opie{ +namespace Ui{ class OFileSelector; +namespace Private { class OFileViewInterface { public: @@ -185,7 +185,9 @@ private: private: QListView* m_view; }; -}; +} +} +} #endif diff --git a/libopie2/opieui/fileselector/ofileview.h b/libopie2/opieui/fileselector/ofileview.h index 495401b..aaf56b1 100644 --- a/libopie2/opieui/fileselector/ofileview.h +++ b/libopie2/opieui/fileselector/ofileview.h @@ -36,10 +36,11 @@ class QFileInfo; class QDir; class DocLnk; -namespace Opie -{ +namespace Opie { +namespace Ui { +namespace Private { /** * A OFileView is a specialised View for the * OFileSelector @@ -89,7 +90,9 @@ public: OFileView* newView(QWidget *parent, const char *name ); QString name()const; }; -}; +} +} +} #endif diff --git a/libopie2/opieui/oclickablelabel.cpp b/libopie2/opieui/oclickablelabel.cpp index 4c4e581..53cb77a 100644 --- a/libopie2/opieui/oclickablelabel.cpp +++ b/libopie2/opieui/oclickablelabel.cpp @@ -28,9 +28,9 @@ */ #include <opie2/oclickablelabel.h> -using namespace Opie; +using namespace Opie::Ui; /** * This constructs the clickable ButtonLabel * diff --git a/libopie2/opieui/oclickablelabel.h b/libopie2/opieui/oclickablelabel.h index b224d61..90859a0 100644 --- a/libopie2/opieui/oclickablelabel.h +++ b/libopie2/opieui/oclickablelabel.h @@ -32,10 +32,10 @@ /* QT */ #include <qlabel.h> -namespace Opie -{ +namespace Opie{ +namespace Ui { /** * This class is a special QLabel which can behave * as a QPushButton or QToggleButton. @@ -97,7 +97,8 @@ private: class Private; Private *d; // private d pointer }; -}; +} +} #endif diff --git a/libopie2/opieui/odialog.cpp b/libopie2/opieui/odialog.cpp index 4d269d4..27f8d20 100644 --- a/libopie2/opieui/odialog.cpp +++ b/libopie2/opieui/odialog.cpp @@ -31,8 +31,10 @@ #include <opie2/odialog.h> #warning Make Margin and Spacing device dependend and configurable! +using namespace Opie::Ui; + int ODialog::mMarginSize = 5; int ODialog::mSpacingSize = 2; ODialog::ODialog(QWidget *parent, const char *name, bool modal, WFlags f) diff --git a/libopie2/opieui/odialog.h b/libopie2/opieui/odialog.h index ceff612..57f534c 100644 --- a/libopie2/opieui/odialog.h +++ b/libopie2/opieui/odialog.h @@ -54,8 +54,11 @@ class QLayoutItem; // lets fix up Qt instead! Size does matter. -zecke // while that may be true, reducing maintainance effort for the future does also matter - // and I believe that maintaining a patch against QtE is more work than our classes -mml +namespace Opie { +namespace Ui { + class ODialog : public QDialog { Q_OBJECT @@ -87,5 +90,7 @@ class ODialog : public QDialog class ODialogPrivate; ODialogPrivate *d; }; +} +} #endif // ODIALOG_H diff --git a/libopie2/opieui/ofontselector.cpp b/libopie2/opieui/ofontselector.cpp index f93781f..b19c26e 100644 --- a/libopie2/opieui/ofontselector.cpp +++ b/libopie2/opieui/ofontselector.cpp @@ -37,12 +37,12 @@ #include <qcombobox.h> #include <qlabel.h> #include <qmultilineedit.h> -using namespace Opie; -namespace Opie -{ +namespace Opie { +namespace Ui { +namespace Private { class OFontSelectorPrivate { public: @@ -55,13 +55,8 @@ public: FontDatabase m_fdb; }; -}; - -namespace -{ - class FontListItem : public QListBoxText { public: FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText() @@ -94,9 +89,15 @@ private: QStringList m_styles; QValueList<int> m_sizes; QString m_name; }; +} +} +} + +using namespace Opie::Ui; +using namespace Opie::Ui::Private; static int findItemCB( QComboBox *box, const QString &str ) { for ( int i = 0; i < box->count(); i++ ) @@ -106,9 +107,8 @@ static int findItemCB( QComboBox *box, const QString &str ) } return -1; } -} /* static same as anon. namespace */ static int qt_version() { const char *qver = qVersion(); @@ -425,4 +425,5 @@ void OFontSelector::resizeEvent ( QResizeEvent *re ) if ( d->m_preview ) d->m_preview->setFixedHeight ( d->m_preview->height()); } + diff --git a/libopie2/opieui/ofontselector.h b/libopie2/opieui/ofontselector.h index ad51819..1d97233 100644 --- a/libopie2/opieui/ofontselector.h +++ b/libopie2/opieui/ofontselector.h @@ -34,12 +34,13 @@ #include <qwidget.h> class QListBox; -namespace Opie -{ - +namespace Opie { +namespace Ui { +namespace Private { class OFontSelectorPrivate; +} /** * This class lets you chose a Font out of a list of Fonts. * It can show a preview too. This selector will use all available @@ -94,11 +95,12 @@ private: void changeFont ( ); private: - OFontSelectorPrivate *d; + Private::OFontSelectorPrivate *d; }; -}; +} +} #endif diff --git a/libopie2/opieui/oimageeffect.cpp b/libopie2/opieui/oimageeffect.cpp index 9a58bb9..be47eb2 100644 --- a/libopie2/opieui/oimageeffect.cpp +++ b/libopie2/opieui/oimageeffect.cpp @@ -40,8 +40,12 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define MaxRGB 255L #define DegreesToRadians(x) ((x)*M_PI/180.0) using namespace std; +using namespace Opie::Core; + +namespace Opie { +namespace Ui { inline unsigned int intensityValue(unsigned int color) { return((unsigned int)((0.299*qRed(color) + @@ -3764,5 +3768,6 @@ void OImageEffect::contrastHSV(QImage &img, bool sharpen) } - +} +} diff --git a/libopie2/opieui/oimageeffect.h b/libopie2/opieui/oimageeffect.h index fb4d22d..4f86d5b 100644 --- a/libopie2/opieui/oimageeffect.h +++ b/libopie2/opieui/oimageeffect.h @@ -38,8 +38,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. class QImage; class QSize; class QColor; +namespace Opie { +namespace Ui { /** * This class includes various @ref QImage based graphical effects. * * Everything is @@ -555,5 +557,8 @@ private: static unsigned int interpolateColor(QImage *image, double x, double y, unsigned int background); }; +} +} + #endif diff --git a/libopie2/opieui/olistview.cpp b/libopie2/opieui/olistview.cpp index 0ee2fde..38670b4 100644 --- a/libopie2/opieui/olistview.cpp +++ b/libopie2/opieui/olistview.cpp @@ -35,8 +35,13 @@ #include <opie2/odebug.h> #include <opie2/olistview.h> +using namespace Opie::Core; + + +namespace Opie { +namespace Ui { /*====================================================================================== * OListView *======================================================================================*/ @@ -754,4 +759,6 @@ ONamedListViewItem* ONamedListViewItem::find( const QString& column, const QStri else return 0; } +} +} diff --git a/libopie2/opieui/olistview.h b/libopie2/opieui/olistview.h index 59b0973..8195a62 100644 --- a/libopie2/opieui/olistview.h +++ b/libopie2/opieui/olistview.h @@ -35,8 +35,11 @@ #include <qpen.h> #include <qdatastream.h> #include <qstringlist.h> + +namespace Opie { +namespace Ui { class OListViewItem; /*====================================================================================== @@ -53,8 +56,9 @@ class OListViewItem; * @author Michael 'Mickey' Lauer <mickey@vanille.de> */ class OListView: public QListView { + Q_OBJECT public: /** * Constructor. * @@ -138,10 +142,12 @@ class OListView: public QListView void expand(QListViewItem*); private: QColor m_alternateBackground; - bool m_fullWidth; + bool m_fullWidth : 1; QPen m_columnSeparator; + class Private; + Private *d; }; #ifndef QT_NO_DATASTREAM /** @@ -241,10 +247,12 @@ class OListViewItem: public QListViewItem */ virtual void expand(){}; private: - bool m_known; - bool m_odd; + bool m_known : 1; + bool m_odd : 1; + class Private; + Private *d; }; #ifndef QT_NO_DATASTREAM /** @@ -353,8 +361,11 @@ class ONamedListView: public OListView virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; virtual ONamedListViewItem* find( ONamedListViewItem* start, const QString& column, const QString& text, int recurse = -1 ) const; virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; + private: + class Private; + Private *d; }; /*====================================================================================== * ONamedListViewItem @@ -402,8 +413,14 @@ class ONamedListViewItem: public OListViewItem * @sa ONamedListView::find() */ virtual ONamedListViewItem* find( int column, const QString& text, int recurse = -1 ) const; virtual ONamedListViewItem* find( const QString& column, const QString& text, int recurse = -1 ) const; -}; + private: + class Private; + Private *d; + +}; +} +} #endif // OLISTVIEW_H diff --git a/libopie2/opieui/opieui.pro b/libopie2/opieui/opieui.pro index 1be8db5..e895edc 100644 --- a/libopie2/opieui/opieui.pro +++ b/libopie2/opieui/opieui.pro @@ -5,13 +5,11 @@ HEADERS = oclickablelabel.h \ odialog.h \ ofontselector.h \ oimageeffect.h \ olistview.h \ - omessagebox.h \ opixmapeffect.h \ opopupmenu.h \ opixmapprovider.h \ - oresource.h \ oselector.h \ oseparator.h \ otabinfo.h \ otabbar.h \ @@ -30,9 +28,8 @@ SOURCES = oclickablelabel.cpp \ olistview.cpp \ opixmapeffect.cpp \ opopupmenu.cpp \ opixmapprovider.cpp \ - oresource.cpp \ oselector.cpp \ oseparator.cpp \ otabbar.cpp \ otabwidget.cpp \ diff --git a/libopie2/opieui/opixmapeffect.cpp b/libopie2/opieui/opixmapeffect.cpp index 05f851d..794c7b2 100644 --- a/libopie2/opieui/opixmapeffect.cpp +++ b/libopie2/opieui/opixmapeffect.cpp @@ -16,8 +16,10 @@ #include <opie2/opixmapeffect.h> #include <opie2/oimageeffect.h> + +using namespace Opie::Ui; //====================================================================== // // Gradient effects // diff --git a/libopie2/opieui/opixmapeffect.h b/libopie2/opieui/opixmapeffect.h index 283fe2d..b780f9f 100644 --- a/libopie2/opieui/opixmapeffect.h +++ b/libopie2/opieui/opixmapeffect.h @@ -14,8 +14,11 @@ #include <qsize.h> typedef QPixmap OPixmap; class QColor; + +namespace Opie { +namespace Ui { /** * This class includes various pixmap-based graphical effects. * * Everything is @@ -209,7 +212,8 @@ public: * @param col the selected color, usually from QColorGroup::highlight(). */ static OPixmap selectedPixmap( const OPixmap &pixmap, const QColor &col ); }; - +} +} #endif diff --git a/libopie2/opieui/opixmapprovider.cpp b/libopie2/opieui/opixmapprovider.cpp index 7be9e3b..7eb67a2 100644 --- a/libopie2/opieui/opixmapprovider.cpp +++ b/libopie2/opieui/opixmapprovider.cpp @@ -19,8 +19,10 @@ */ #include <opie2/opixmapprovider.h> +using namespace Opie::Ui; + OPixmapProvider::~OPixmapProvider() {} void OPixmapProvider::virtual_hook( int , void* ) { /*BASE::virtual_hook( id, data );*/ } diff --git a/libopie2/opieui/opixmapprovider.h b/libopie2/opieui/opixmapprovider.h index 5b76647..9d9bd69 100644 --- a/libopie2/opieui/opixmapprovider.h +++ b/libopie2/opieui/opixmapprovider.h @@ -22,9 +22,12 @@ #define OPIXMAPPROVIDER_H #include <qpixmap.h> +namespace Opie { +namespace Ui { /** + * \todo make usefull * A tiny abstract class with just one method: * @ref pixmapFor() * * It will be called whenever an icon is searched for @p text. @@ -47,8 +50,13 @@ public: */ virtual QPixmap pixmapFor( const QString& text, int size = 0 ) = 0; protected: virtual void virtual_hook( int id, void* data ); +private: + class Private; + Private *d; }; +} +} #endif // OPIXMAPPROVIDER_H diff --git a/libopie2/opieui/opopupmenu.cpp b/libopie2/opieui/opopupmenu.cpp index d5cc575..3ab8490 100644 --- a/libopie2/opieui/opopupmenu.cpp +++ b/libopie2/opieui/opopupmenu.cpp @@ -26,8 +26,11 @@ #include <opie2/opopupmenu.h> #include <opie2/oconfig.h> +using namespace Opie::Core; +using namespace Opie::Ui; + OPopupTitle::OPopupTitle(QWidget *parent, const char *name) : QWidget(parent, name) { setMinimumSize(16, fontMetrics().height()+8); diff --git a/libopie2/opieui/opopupmenu.h b/libopie2/opieui/opopupmenu.h index 54e4301..419a954 100644 --- a/libopie2/opieui/opopupmenu.h +++ b/libopie2/opieui/opopupmenu.h @@ -30,8 +30,10 @@ /* OPIE */ #include <opie2/opixmapeffect.h> +namespace Opie { +namespace Ui { /** * Title widget for use in @ref OPopupMenu. * * You usually don't have to create this manually since @@ -255,5 +257,8 @@ private: class OPopupMenuPrivate; OPopupMenuPrivate *d; }; +} +} + #endif diff --git a/libopie2/opieui/oselector.cpp b/libopie2/opieui/oselector.cpp index 23b3ce3..5f6f10f 100644 --- a/libopie2/opieui/oselector.cpp +++ b/libopie2/opieui/oselector.cpp @@ -35,8 +35,10 @@ * 2D value selector. * The contents of the selector are drawn by derived class. */ +using namespace Opie::Ui; + OXYSelector::OXYSelector( QWidget *parent, const char *name ) : QWidget( parent, name ) { xPos = 0; @@ -72,9 +74,9 @@ void OXYSelector::setValues( int _xPos, int _yPos ) if ( xPos > maxX ) xPos = maxX; else if ( xPos < minX ) xPos = minX; - + if ( yPos > maxY ) yPos = maxY; else if ( yPos < minY ) yPos = minY; @@ -257,9 +259,9 @@ void OSelector::paintEvent( QPaintEvent * ) colorGroup(), TRUE, 2, &brush ); } QPoint pos = calcArrowPos( value() ); - drawArrow( &painter, TRUE, pos ); + drawArrow( &painter, TRUE, pos ); painter.end(); } @@ -287,12 +289,12 @@ void OSelector::valueChange() painter.begin( this ); pos = calcArrowPos( prevValue() ); - drawArrow( &painter, FALSE, pos ); + drawArrow( &painter, FALSE, pos ); pos = calcArrowPos( value() ); - drawArrow( &painter, TRUE, pos ); + drawArrow( &painter, TRUE, pos ); painter.end(); } @@ -360,10 +362,10 @@ void OSelector::drawArrow( QPainter *painter, bool show, const QPoint &pos ) array.setPoint( 2, pos.x()-5, pos.y()+5 ); } painter->drawPolygon( array ); - } - else + } + else { if ( orientation() == Vertical ) { repaint(pos.x(), pos.y()-5, 6, 11, true); @@ -399,9 +401,9 @@ OGradientSelector::~OGradientSelector() void OGradientSelector::init() { color1.setRgb( 0, 0, 0 ); color2.setRgb( 255, 255, 255 ); - + text1 = text2 = ""; } @@ -471,9 +473,9 @@ void OGradientSelector::drawContents( QPainter *painter ) painter->setPen( pen ); painter->drawText( xPos, yPos, text2 ); yPos = contentsRect().bottom() - painter->fontMetrics().descent() - 2; - xPos = contentsRect().left() + (contentsRect().width() - + xPos = contentsRect().left() + (contentsRect().width() - painter->fontMetrics().width( text1 )) / 2; pen.setColor( color1 ); painter->setPen( pen ); painter->drawText( xPos, yPos, text1 ); diff --git a/libopie2/opieui/oselector.h b/libopie2/opieui/oselector.h index f832239..fe75a46 100644 --- a/libopie2/opieui/oselector.h +++ b/libopie2/opieui/oselector.h @@ -26,8 +26,11 @@ #include <qwidget.h> #include <qrangecontrol.h> #include <qpixmap.h> + +namespace Opie { +namespace Ui { /** * OXYSelector is the base class for other widgets which * provides the ability to choose from a two-dimensional * range of values. The currently chosen value is indicated @@ -511,8 +514,10 @@ private: class OColorPrivate; OColorPrivate *d; }; +} +} #endif // __OSELECT_H__ diff --git a/libopie2/opieui/oseparator.cpp b/libopie2/opieui/oseparator.cpp index b93c225..bbc4381 100644 --- a/libopie2/opieui/oseparator.cpp +++ b/libopie2/opieui/oseparator.cpp @@ -35,8 +35,10 @@ #include <opie2/oseparator.h> /* QT */ +using namespace Opie::Core; +using namespace Opie::Ui; OSeparator::OSeparator(QWidget* parent, const char* name, WFlags f) : QFrame(parent, name, 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 @@ -34,8 +34,11 @@ #define OSEPARATOR_H #include <qframe.h> +namespace Opie { +namespace Ui { + /** * Standard horizontal or vertical separator. * * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> @@ -85,6 +88,8 @@ protected: private: class OSeparatorPrivate* d; }; +} +} #endif // OSEPARATOR_H diff --git a/libopie2/opieui/otabbar.cpp b/libopie2/opieui/otabbar.cpp index cd3a34b..a62e18b 100644 --- a/libopie2/opieui/otabbar.cpp +++ b/libopie2/opieui/otabbar.cpp @@ -30,9 +30,9 @@ */ #include <opie2/otabbar.h> -using namespace Opie; +using namespace Opie::Ui; OTabBar::OTabBar( QWidget *parent , const char *name ) :QTabBar( parent, name ) {} diff --git a/libopie2/opieui/otabbar.h b/libopie2/opieui/otabbar.h index 2f35c85..925ae96 100644 --- a/libopie2/opieui/otabbar.h +++ b/libopie2/opieui/otabbar.h @@ -34,10 +34,10 @@ /* QT */ #include <qtabbar.h> -namespace Opie -{ +namespace Opie { +namespace Ui { /** * @class OTabBar * @brief The OTabBar class is a derivative of QTabBar. @@ -79,7 +79,8 @@ private: class Private; Private *d; }; -}; +} +} #endif diff --git a/libopie2/opieui/otabinfo.h b/libopie2/opieui/otabinfo.h index 4a6ce14..426c45a 100644 --- a/libopie2/opieui/otabinfo.h +++ b/libopie2/opieui/otabinfo.h @@ -37,10 +37,10 @@ #include <qstring.h> class QWidget; -namespace Opie -{ +namespace Opie{ +namespace Ui { /** * @class OTabInfo * @brief The OTabInfo class is used internally by OTabWidget to keep track @@ -134,7 +134,8 @@ private: * @brief A list of OTabInfo objects used by OTabWidget. */ typedef QList<OTabInfo> OTabInfoList; -}; +} +} #endif diff --git a/libopie2/opieui/otabwidget.cpp b/libopie2/opieui/otabwidget.cpp index f47c90b..a9f7da9 100644 --- a/libopie2/opieui/otabwidget.cpp +++ b/libopie2/opieui/otabwidget.cpp @@ -40,9 +40,9 @@ /* QT */ #include <qcombobox.h> #include <qwidgetstack.h> -using namespace Opie; +using namespace Opie::Ui; OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPosition p ) : QWidget( parent, name ) { diff --git a/libopie2/opieui/otabwidget.h b/libopie2/opieui/otabwidget.h index 092f22c..6a64b7d 100644 --- a/libopie2/opieui/otabwidget.h +++ b/libopie2/opieui/otabwidget.h @@ -37,17 +37,16 @@ /* QT */ #include <qwidget.h> #include <qlist.h> -using namespace Opie; class QComboBox; class QPixmap; class QTabBar; class QWidgetStack; -namespace Opie -{ +namespace Opie { +namespace Ui { class OTabBar; /** @@ -286,7 +285,8 @@ private: */ void slotTabListSelected( int ); }; -}; +} +} #endif diff --git a/libopie2/opieui/otaskbarapplet.cpp b/libopie2/opieui/otaskbarapplet.cpp index a67356d..b5268f0 100644 --- a/libopie2/opieui/otaskbarapplet.cpp +++ b/libopie2/opieui/otaskbarapplet.cpp @@ -27,6 +27,56 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include <opie2/otaskbarapplet.h> + +#include <qpe/qpeapplication.h> +#include <qframe.h> + +using namespace Opie::Ui; + + +/** + * \todo no example yet!!! + * If you want to implement an Applet for the Opie Taskbar + * use this interface. + * The only specail thing about applets is that you need to build + * it as plugin/library and do EXPORT_OPIE_APPLET_v1( YourApplet ) + * at the bottom of your application. This takes care of + * the activation and implementing the TaskbarAppletInterface. + * You also need to add a static int position() functions to your + * application. + * \code + * class MyApplet : public OTaskBarApplet { + * public: + * static int position() { return 3: } + * void doStuff() { + * popup( myWidget ); + * } + * }; + * EXPORT_OPIE_APPLET_v1( MyApplet ) + * \endcode + * + * @author Michael Lauer + * @version 0.5 + * @see TaskbarAppletInterface + */ +OTaskbarApplet::OTaskbarApplet( QWidget* parent, const char* name ) + :QWidget( parent, name ){ + setFixedHeight( 18 ); + setFixedWidth( 14 ); +} + +OTaskbarApplet::~OTaskbarApplet(){ +} + +void OTaskbarApplet::popup( QWidget* widget ){ + QPoint curPos = mapToGlobal( QPoint( 0, 0 ) ); + int w = widget->sizeHint().width(); + int x = curPos.x() - (w/2 ); + if ( (x+w) > QPEApplication::desktop()->width() ) + x = QPEApplication::desktop()->width()-w; + widget->move( x, curPos.y()-widget->sizeHint().height() ); + widget->show(); +} -// Empty on purpose until we shipped Opie 1.0 (see otaskbarapplet.h for explanation) diff --git a/libopie2/opieui/otaskbarapplet.h b/libopie2/opieui/otaskbarapplet.h index 074367f..0c85ee7 100644 --- a/libopie2/opieui/otaskbarapplet.h +++ b/libopie2/opieui/otaskbarapplet.h @@ -32,13 +32,22 @@ #ifndef OTASKBARAPPLET_H #define OTASKBARAPPLET_H #include <qpe/taskbarappletinterface.h> +#include <qpe/qcom.h> +#include <qwidget.h> + +class QMouseEvent; + +namespace Opie { +namespace Ui { +namespace Private { /*====================================================================================== * OTaskbarAppletWrapper *======================================================================================*/ +class OTaskbarAppletWrapperPrivate; template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface { public: OTaskbarAppletWrapper():_applet( 0 ) @@ -79,16 +88,12 @@ template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface } private: T* _applet; + OTaskbarAppletWrapperPrivate *d; }; -#include <qframe.h> -#include <qwidget.h> -#include <qpe/qpeapplication.h> - -class QMouseEvent; - +} /*====================================================================================== * OTaskbarApplet *======================================================================================*/ @@ -102,29 +107,23 @@ class QMouseEvent; class OTaskbarApplet : public QWidget { public: - OTaskbarApplet( QWidget* parent, const char* name = 0 ):QWidget( parent, name ) - { - setFixedHeight( 18 ); - setFixedWidth( 14 ); - } - - virtual ~OTaskbarApplet() - { - } + OTaskbarApplet( QWidget* parent, const char* name = 0 ); + virtual ~OTaskbarApplet(); protected: - virtual void popup( QWidget* widget ) - { - QPoint curPos = mapToGlobal( QPoint( 0, 0 ) ); - int w = widget->sizeHint().width(); - int x = curPos.x() - (w/2 ); - if ( (x+w) > QPEApplication::desktop()->width() ) - x = QPEApplication::desktop()->width()-w; - widget->move( x, curPos.y()-widget->sizeHint().height() ); - widget->show(); - } + virtual void popup( QWidget* widget ); +private: + class Private; + Private *d; }; +} +} + +#define EXPORT_OPIE_APPLET_v1( AppLet ) \ + Q_EXPORT_INTERFACE() { \ + Q_CREATE_INSTANCE( Opie::Ui::Private::OTaskbarAppletWrapper<AppLet> ) \ + } #endif diff --git a/libopie2/opieui/otimepicker.cpp b/libopie2/opieui/otimepicker.cpp index 66f9ce0..7de0fd3 100644 --- a/libopie2/opieui/otimepicker.cpp +++ b/libopie2/opieui/otimepicker.cpp @@ -26,16 +26,20 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* OPIE */ +#include <opie2/otimepicker.h> + /* QT */ +#include <qgroupbox.h> #include <qlayout.h> #include <qlineedit.h> -/* OPIE */ -#include <opie2/otimepicker.h> -using namespace Opie; + +namespace Opie { +namespace Ui { /** * Constructs the widget * @param parent The parent of the OTimePicker @@ -219,8 +223,10 @@ void OTimePicker::setHour(int h) */ OTimePickerDialog::OTimePickerDialog ( QWidget* parent, const char* name, WFlags fl ) : OTimePickerDialogBase (parent , name, true , fl) { + m_timePicker = new OTimePicker( GroupBox1, "m_timePicker" ); + GroupBox1Layout->addWidget( m_timePicker, 0, 0 ); connect ( m_timePicker, SIGNAL( timeChanged(const QTime&) ), this, SLOT( setTime(const QTime&) ) ); connect ( minuteField, SIGNAL( textChanged(const QString&) ), @@ -289,4 +295,7 @@ void OTimePickerDialog::setMinute ( const QString& minute ) m_time.setHMS ( m_time.hour(), minute.toInt(), 00 ); setTime ( m_time ); } } + +} +} diff --git a/libopie2/opieui/otimepicker.h b/libopie2/opieui/otimepicker.h index 2da7773..01bb557 100644 --- a/libopie2/opieui/otimepicker.h +++ b/libopie2/opieui/otimepicker.h @@ -31,20 +31,19 @@ #define OTIMEPICKER_H /* OPIE */ #include <opie2/oclickablelabel.h> -#include "otimepickerbase.h" +#include <opie2/otimepickerbase.h> /* QT */ #include <qwidget.h> #include <qvaluelist.h> #include <qdatetime.h> #include <qdialog.h> -using namespace Opie; -// namespace Opie -// { +namespace Opie { +namespace Ui { /** * A class to pick time. It uses clickable labels * internally to allow a quick selection of a time. @@ -55,9 +54,9 @@ using namespace Opie; * @see QWidget * @see QTime * @author Hakan Ardo, Stefan Eilers */ -class OTimePicker: public QWidget +class OTimePicker : public QWidget { Q_OBJECT public: @@ -113,13 +112,21 @@ public slots: void setHour( const QString& hour ); void setMinute( const QString& minute ); private: + OTimePicker *m_timePicker; QTime m_time; class Private; Private* d; }; -// }; +} +} +/* for Qt2 */ +#if ( QT_VERSION-0 >= 0x030000 ) +#error "Fix the UI File to use namespaces" +#else +typedef Opie::Ui::OTimePicker OUIOTimePicker; +#endif #endif diff --git a/libopie2/opieui/otimepickerbase.ui b/libopie2/opieui/otimepickerbase.ui index 3e7f2fb..c2eb7c5 100644 --- a/libopie2/opieui/otimepickerbase.ui +++ b/libopie2/opieui/otimepickerbase.ui @@ -10,9 +10,9 @@ <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>210</width> + <width>182</width> <height>137</height> </rect> </property> <property stdset="1"> @@ -248,45 +248,9 @@ <property stdset="1"> <name>spacing</name> <number>6</number> </property> - <widget row="0" column="0" > - <class>OTimePicker</class> - <property stdset="1"> - <name>name</name> - <cstring>m_timePicker</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>3</hsizetype> - <vsizetype>3</vsizetype> - </sizepolicy> - </property> - </widget> </grid> </widget> </vbox> </widget> -<customwidgets> - <customwidget> - <class>OTimePicker</class> - <header location="local">otimepicker.h</header> - <sizehint> - <width>-1</width> - <height>-1</height> - </sizehint> - <container>0</container> - <sizepolicy> - <hordata>7</hordata> - <verdata>1</verdata> - </sizepolicy> - <pixmap>image0</pixmap> - </customwidget> -</customwidgets> -<images> - <image> - <name>image0</name> - <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data> - </image> -</images> </UI> diff --git a/libopie2/opieui/oversatileview.cpp b/libopie2/opieui/oversatileview.cpp index 78154b7..f6c6410 100644 --- a/libopie2/opieui/oversatileview.cpp +++ b/libopie2/opieui/oversatileview.cpp @@ -39,8 +39,11 @@ #include <qaction.h> #include <qpopupmenu.h> +using namespace Opie::Core; +using namespace Opie::Ui; + /* XPM */ static const char * view_icon_xpm[] = { "16 16 16 1", " c None", @@ -131,17 +134,17 @@ OVersatileView::OVersatileView( QWidget* parent, const char* name, int mode ) _listview->setShowSortIndicator( true ); _iconview->setGridX( 90 ); _iconview->setGridY( 42 ); _iconview->setAutoArrange( true ); - + #ifdef QWS // TODO: Let this depend on current geometry (rotation) _iconview->setArrangement( QIconView::TopToBottom ); #else _iconview->setArrangement( QIconView::LeftToRight ); #endif - + _iconview->setResizeMode( QIconView::Adjust ); - + // qt-embedded: map stylus right on hold to right button press #ifdef QWS ( (QPEApplication*) qApp)->setStylusOperation( _iconview->viewport(), QPEApplication::RightOnHold ); @@ -167,59 +170,59 @@ OVersatileView::OVersatileView( QWidget* parent, const char* name, int mode ) else if ( mode == Tree ) a2->setOn( true ); connect( a1, SIGNAL( activated() ), this, SLOT( setIconViewMode() ) ); connect( a2, SIGNAL( activated() ), this, SLOT( setTreeViewMode() ) ); - + #if (QT_VERSION >= 0x030000) connect( _listview, SIGNAL( contextMenuRequested(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); connect( _iconview, SIGNAL( contextMenuRequested(QIconViewItem*,const QPoint&) ), this, SLOT( contextMenuRequested(QIconViewItem*,const QPoint&) ) ); #else connect( _listview, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); connect( _iconview, SIGNAL( rightButtonPressed(QIconViewItem*,const QPoint&) ), this, SLOT( contextMenuRequested(QIconViewItem*,const QPoint&) ) ); #endif - + // // signal forwarders // // unfortunately we can't short-circuit all the QListView and QIconView signals // to OVersatileView signals, because the signal/slot mechanism doesn't allow // type-conversion :-( // common signals for listview - + connect( _listview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); connect( _listview, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( selectionChanged(QListViewItem*) ) ); - connect( _listview, SIGNAL( currentChanged(QListViewItem*) ), this, SLOT( currentChanged(QListViewItem*) ) ); + connect( _listview, SIGNAL( currentChanged(QListViewItem*) ), this, SLOT( currentChanged(QListViewItem*) ) ); connect( _listview, SIGNAL( clicked(QListViewItem*) ), this, SLOT( clicked(QListViewItem*) ) ); connect( _listview, SIGNAL( pressed(QListViewItem*) ), this, SLOT( pressed(QListViewItem*) ) ); - + connect( _listview, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( doubleClicked(QListViewItem*) ) ); connect( _listview, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( returnPressed(QListViewItem*) ) ); - + connect( _listview, SIGNAL( onItem(QListViewItem*) ), this, SLOT( onItem(QListViewItem*) ) ); connect( _listview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) ); // common signals for iconview - + connect( _iconview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); connect( _iconview, SIGNAL( selectionChanged(QIconViewItem*) ), this, SLOT( selectionChanged(QIconViewItem*) ) ); - connect( _iconview, SIGNAL( currentChanged(QIconViewItem*) ), this, SLOT( currentChanged(QIconViewItem*) ) ); + connect( _iconview, SIGNAL( currentChanged(QIconViewItem*) ), this, SLOT( currentChanged(QIconViewItem*) ) ); connect( _iconview, SIGNAL( clicked(QIconViewItem*) ), this, SLOT( clicked(QIconViewItem*) ) ); connect( _iconview, SIGNAL( pressed(QIconViewItem*) ), this, SLOT( pressed(QIconViewItem*) ) ); - + connect( _iconview, SIGNAL( doubleClicked(QIconViewItem*) ), this, SLOT( doubleClicked(QIconViewItem*) ) ); connect( _iconview, SIGNAL( returnPressed(QIconViewItem*) ), this, SLOT( returnPressed(QIconViewItem*) ) ); - + connect( _iconview, SIGNAL( onItem(QIconViewItem*) ), this, SLOT( onItem(QIconViewItem*) ) ); connect( _iconview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) ); - + // listview only signals - + connect( _listview, SIGNAL( expanded(QListViewItem*) ), this, SLOT( expanded(QListViewItem*) ) ); connect( _listview, SIGNAL( collapsed(QListViewItem*) ), this, SLOT( collapsed(QListViewItem*) ) ); - + // iconview only signals - + connect( _iconview, SIGNAL( moved() ), this, SIGNAL( moved() ) ); } OVersatileView::~OVersatileView() @@ -419,9 +422,9 @@ void OVersatileView::doubleClicked( QIconViewItem * item ) void OVersatileView::returnPressed( QListViewItem * item ) { emit( returnPressed( static_cast<OVersatileViewItem*>( item ) ) ); } - + void OVersatileView::returnPressed( QIconViewItem * item ) { emit( returnPressed( static_cast<OVersatileViewItem*>( item ) ) ); } @@ -452,9 +455,9 @@ void OVersatileView::collapsed( QListViewItem *item ) // QListView //=============================================================================================// // OVersatileView Case I - API only existing in QListView or QIconView but not in both! //==============================================================================================// - + int OVersatileView::treeStepSize() const // QListView { if ( !isValidViewMode( Tree ) ) { @@ -744,9 +747,9 @@ void OVersatileView::triggerUpdate() // QListView // // only in QIconView // - + uint OVersatileView::count() const // QIconView { if ( !isValidViewMode( Icons ) ) { diff --git a/libopie2/opieui/oversatileview.h b/libopie2/opieui/oversatileview.h index 8af21dc..61b61db 100644 --- a/libopie2/opieui/oversatileview.h +++ b/libopie2/opieui/oversatileview.h @@ -44,21 +44,24 @@ class QHeader; class QIconSet; class QIconViewItem; -class OListView; class QListViewItem; class QPopupMenu; class QString; #ifndef QT_NO_DRAGANDDROP class QIconDragItem; #endif +namespace Opie { +namespace Ui { +class OListView; + class OVersatileView : public QWidgetStack { Q_OBJECT - + friend class OVersatileViewItem; //==============================================================================================// // OVersatileView High Level API @@ -68,85 +71,85 @@ class OVersatileView : public QWidgetStack OVersatileView( QWidget* parent = 0, const char* name = 0, int mode = 0 ); ~OVersatileView(); QPopupMenu* contextMenu() const; - + void setSynchronization( bool sync ); bool synchronization(); - + enum ViewMode { Tree = 0, Icons }; int viewMode(); - + QIconView* iconView() const; OListView* listView() const; - + enum WarningPolicy { None = 0, Warn, WarnReturn }; - + void setWarningPolicy( int ) const; // warn, if calling a method which doesn't apply to the current viewmode bool warningPolicy() const; - + void setDefaultPixmaps( int mode, QPixmap& leaf, QPixmap& opened, QPixmap& closed ); - + public slots: void setViewMode( int mode ); void setIconViewMode(); void setTreeViewMode(); protected: virtual bool isValidViewMode( int mode ) const; virtual void popupContextMenu( OVersatileViewItem* item, const QPoint& pos, int col = 0 ); - + private: int _viewmode; bool _synchronization; mutable int _warningpolicy; - + OListView* _listview; QIconView* _iconview; - + QPixmap _treeleaf; QPixmap _treeopened; QPixmap _treeclosed; QPixmap _iconleaf; QPixmap _iconopened; QPixmap _iconclosed; - + QPopupMenu* _contextmenu; - + int _iconstyle; int _treestyle; - + private slots: - + void contextMenuRequested( QListViewItem*, const QPoint&, int ); void contextMenuRequested( QIconViewItem*, const QPoint& ); // type converting signal forwarders - + void selectionChanged( QListViewItem * ); void currentChanged( QListViewItem * ); void clicked( QListViewItem * ); void pressed( QListViewItem * ); void doubleClicked( QListViewItem * ); void returnPressed( QListViewItem * ); void onItem( QListViewItem * ); - + void selectionChanged( QIconViewItem * ); void currentChanged( QIconViewItem * ); void clicked( QIconViewItem * ); void pressed( QIconViewItem * ); void doubleClicked( QIconViewItem * ); void returnPressed( QIconViewItem * ); void onItem( QIconViewItem * ); - + void expanded( QListViewItem * item ); // QListView void collapsed( QListViewItem * item ); // QListView signals: - + void contextMenuRequested( OVersatileViewItem * item, const QPoint& pos, int col ); - + /*#ifndef QT_NO_DRAGANDDROP void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView #endif void itemRenamed( OVersatileViewItem *item, const QString & ); // QIconView @@ -172,13 +175,13 @@ public: Bottom = 0, Right }; */ - + // // only in QListView // - + int treeStepSize() const; // QListView virtual void setTreeStepSize( int ); // QListView QHeader * header() const; // QListView @@ -225,9 +228,9 @@ public: bool rootIsDecorated() const; // QListView void setShowSortIndicator( bool show ); // QListView bool showSortIndicator() const; // QListView - + int index( const OVersatileViewItem *item ) const; // QIconView public slots: void triggerUpdate(); // QListView @@ -239,11 +242,11 @@ public: // // only in QIconView // - public: + public: uint count() const; // QIconView - + OVersatileViewItem *firstItem() const; // QIconView OVersatileViewItem *lastItem() const; // QIconView OVersatileViewItem *findItem( const QPoint &pos ) const; // QIconView @@ -286,9 +289,9 @@ public: public slots: virtual void arrangeItemsInGrid( const QSize &grid, bool update = TRUE ); // QIconView virtual void arrangeItemsInGrid( bool update = TRUE ); // QIconView virtual void updateContents(); // QIconView - + signals: /*#ifndef QT_NO_DRAGANDDROP void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView #endif @@ -321,9 +324,9 @@ public: virtual void selectAll( bool select ); virtual void clearSelection(); virtual void invertSelection(); - + void ensureItemVisible( const OVersatileViewItem * ); virtual void repaintItem( const OVersatileViewItem * ) const; virtual void setCurrentItem( OVersatileViewItem * ); @@ -343,18 +346,18 @@ public: void pressed( OVersatileViewItem * ); void doubleClicked( OVersatileViewItem * ); void returnPressed( OVersatileViewItem * ); - + void onItem( OVersatileViewItem * ); void onViewport(); - + //==============================================================================================// // "Derived" API - Case 2: Methods existing in QListView and QIconView with differing signatures //==============================================================================================// - + /* - + public: virtual void insertItem( OVersatileViewItem * ); // QListView virtual void insertItem( OVersatileViewItem *item, OVersatileViewItem *after = 0L ); // QIconView @@ -367,28 +370,30 @@ public: void sort(); // #### make virtual in next major release // QListView virtual void sort( bool ascending = TRUE ); // QIconView */ - + signals: void clicked( OVersatileViewItem *, const QPoint &, int ); // QListView void clicked( OVersatileViewItem *, const QPoint & ); // QIconView - + void pressed( OVersatileViewItem *, const QPoint &, int ); // QListView void pressed( OVersatileViewItem *, const QPoint & ); // QIconView - + void rightButtonClicked( OVersatileViewItem* item, const QPoint& pos ); // QIconView void rightButtonClicked( OVersatileViewItem *, const QPoint&, int ); // QListView - - void rightButtonPressed( OVersatileViewItem* item, const QPoint& pos ); // QIconView + + void rightButtonPressed( OVersatileViewItem* item, const QPoint& pos ); // QIconView void rightButtonPressed( OVersatileViewItem *, const QPoint&, int ); // QListView - + void mouseButtonPressed( int, OVersatileViewItem *, const QPoint& , int ); // QListView void mouseButtonPressed( int button, OVersatileViewItem* item, const QPoint& pos ); // QIconView - + void mouseButtonClicked( int, OVersatileViewItem *, const QPoint&, int ); // QListView void mouseButtonClicked( int button, OVersatileViewItem* item, const QPoint& pos ); // QIconView }; +} +} #endif diff --git a/libopie2/opieui/oversatileviewitem.cpp b/libopie2/opieui/oversatileviewitem.cpp index 66de8eb..03c6738 100644 --- a/libopie2/opieui/oversatileviewitem.cpp +++ b/libopie2/opieui/oversatileviewitem.cpp @@ -30,8 +30,10 @@ #include <opie2/oversatileviewitem.h> #include <opie2/oversatileview.h> +using namespace Opie::Ui; + OVersatileViewItem::OVersatileViewItem( OVersatileView * parent ) :OListViewItem( parent->_listview ), QIconViewItem( parent->_iconview ), _versatileview( parent ) { diff --git a/libopie2/opieui/oversatileviewitem.h b/libopie2/opieui/oversatileviewitem.h index ee8ee20..c4977af 100644 --- a/libopie2/opieui/oversatileviewitem.h +++ b/libopie2/opieui/oversatileviewitem.h @@ -39,8 +39,11 @@ /* OPIE */ #include <opie2/olistview.h> +namespace Opie { +namespace Ui { + class OVersatileView; class OVersatileViewItem : public OListViewItem, public QIconViewItem { @@ -96,5 +99,7 @@ class OVersatileViewItem : public OListViewItem, public QIconViewItem void init(); }; +} +} #endif diff --git a/libopie2/opieui/owait.cpp b/libopie2/opieui/owait.cpp index 8bb4ed6..9519888 100644 --- a/libopie2/opieui/owait.cpp +++ b/libopie2/opieui/owait.cpp @@ -37,8 +37,10 @@ /* QT */ #include <qlayout.h> #include <qpainter.h> +using namespace Opie::Ui; + static int frame = 0; /** * This will construct a modal dialog. diff --git a/libopie2/opieui/owait.h b/libopie2/opieui/owait.h index 3267064..03c33e4 100644 --- a/libopie2/opieui/owait.h +++ b/libopie2/opieui/owait.h @@ -36,8 +36,11 @@ #include <qlabel.h> #include <qpixmap.h> #include <qtimer.h> + +namespace Opie { +namespace Ui { /** * This class displays a animated waiting icon in the middle of the screen. * * @short modal hour glass dialog @@ -81,6 +84,7 @@ class OWait : public QDialog int m_aniSize; class Private; Private *d; }; - +} +} #endif |