author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kdeui/kjanuswidget.h | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'microkde/kdeui/kjanuswidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kdeui/kjanuswidget.h | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/microkde/kdeui/kjanuswidget.h b/microkde/kdeui/kjanuswidget.h index 6d3f23d..72465ea 100644 --- a/microkde/kdeui/kjanuswidget.h +++ b/microkde/kdeui/kjanuswidget.h @@ -11,48 +11,54 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with 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 _KJANUS_WIDGET_H_ #define _KJANUS_WIDGET_H_ -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qwidget.h> #include <qmap.h> -#include <qgrid.h> +#include <q3grid.h> +//Added by qt3to4: +#include <QShowEvent> +#include <Q3Frame> +#include <QPixmap> +#include <QLabel> +#include <QEvent> #include <klistbox.h> /*US #include <qptrlist.h> #include <qpixmap.h> #include <qsplitter.h> #include <qstringlist.h> #include <qmap.h> */ class KSeparator; class KListView; -class QWidgetStack; +class Q3WidgetStack; class QLabel; class QTabWidget; -class QListViewItem; -class QVBox; -class QHBox; +class Q3ListViewItem; +class Q3VBox; +class Q3HBox; /** * Provides a number of ready to use layouts (faces). It is used * as an internal widget in @ref KDialogBase, but can also used as a * widget of its own. * * It provides TreeList, IconList, Tabbed, Plain and Swallow layouts. * * The TreeList face provides a list in the left area and pages in the * right. The area are separated by a movable splitter. The style is somewhat * similar to the layout in the Control Center. A page is raised by * selecting the corresponding tree list item. @@ -93,25 +99,25 @@ class QHBox; * * @short Easy to use widget with many layouts * @author Espen Sand (espen@kde.org) */ class KJanusWidget : public QWidget { Q_OBJECT private: class IconListBox : public KListBox { public: - IconListBox( QWidget *parent=0, const char *name=0, WFlags f=0 ); + IconListBox( QWidget *parent=0, const char *name=0, Qt::WFlags f=0 ); void updateMinimumHeight(); void updateWidth(); void invalidateHeight(); void invalidateWidth(); void setShowAll( bool showAll ); private: bool mShowAll; bool mHeightValid; bool mWidthValid; }; @@ -184,141 +190,141 @@ class KJanusWidget : public QWidget * Returns the recommended size for the widget in order to be displayed * properly. * * @return The recommended size. */ virtual QSize sizeHint() const; /** * Returns the empty widget that is available in Plain mode. * * @return The widget or 0 if the face in not Plain. */ - virtual QFrame *plainPage(); + virtual Q3Frame *plainPage(); /** * Add a new page when the class is used in TreeList, IconList or Tabbed * mode. The returned widget is empty and you must add your widgets * as children to this widget. In most cases you must create a layout * manager and associate it with this widget as well. * * Deleting the returned frame will cause the listitem or tab to be * removed (you can re-add a page with the same name later. * * @param item String used in the list or Tab item. * @param header A longer string used in TreeList and IconList mode to * describe the contents of a page. If empty, the item string * will be used instead. * @param pixmap Used in IconList mode or in TreeList mode. You should * prefer a pixmap with size 32x32 pixels. * * @return The empty page or 0 if the face is not TreeList, IconList or * Tabbed. */ - virtual QFrame *addPage(const QString &item,const QString &header=QString::null, + virtual Q3Frame *addPage(const QString &item,const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); /** * This is like addPage just above, with the difference that the first * element is a list of strings. These strings are used to form a path * of folders down to the given page. The initial elements are names * for the folders, while the last element is the name of the page. * Note: This does yet only work for the TreeList face. Later this may * be added for the IconList face too. In other faces than the * TreeList, all the strings except the last one is ignored. * Deleting the returned frame will cause the listitem or tab to be * removed (you can re-add a page with the same name later. * * Deleting the returned frame will cause the listitem or tab to be * removed (you can re-add a page with the same name later. **/ - virtual QFrame *addPage(const QStringList &items, const QString &header=QString::null, + virtual Q3Frame *addPage(const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); /** * Add a new page when the class is used in TreeList, IconList or Tabbed * mode. The returned widget is empty and you must add your widgets * as children to this widget. The returned widget is a @ref QVBox * so it contains a QVBoxLayout layout that lines up the child widgets * are vertically. * * Deleting the returned frame will cause the listitem or tab to be * removed (you can re-add a page with the same name later. * * @param item String used in the list or Tab item. * @param header A longer string used in TreeList and IconList mode to * describe the contents of a page. If empty, the item string * will be used instead. * @param pixmap Used in IconList mode or in TreeList mode. You should * prefer a pixmap with size 32x32 pixels. * * @return The empty page or 0 if the face is not TreeList, IconList or * Tabbed. */ - virtual QVBox *addVBoxPage( const QString &item, + virtual Q3VBox *addVBoxPage( const QString &item, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); /** * This is like addVBoxPage just above, with the difference that the first * element is a list of strings. These strings are used to form a path * of folders down to the given page. The initial elements are names * for the folders, while the last element is the name of the page. * Note: This does yet only work for the TreeList face. Later this may * be added for the IconList face too. In other faces than the * TreeList, all the strings except the last one is ignored. * * Deleting the returned frame will cause the listitem or tab to be * removed (you can re-add a page with the same name later. **/ - virtual QVBox *addVBoxPage( const QStringList &items, + virtual Q3VBox *addVBoxPage( const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); /** * Add a new page when the class is used in TreeList, IconList or Tabbed * mode. The returned widget is empty and you must add your widgets * as children to this widget. The returned widget is a @ref QHBox * so it contains a QHBoxLayout layout that lines up the child widgets * are horizontally. * * Deleting the returned frame will cause the listitem or tab to be * removed (you can re-add a page with the same name later. * * @param item String used in the list or Tab item. * @param header A longer string used in TreeList and IconList mode to * describe the contents of a page. If empty, the item string * will be used instead. * @param pixmap Used in IconList mode or in TreeList mode. You should * prefer a pixmap with size 32x32 pixels. * * @return The empty page or 0 if the face is not TreeList, IconList or * Tabbed. */ - virtual QHBox *addHBoxPage( const QString &itemName, + virtual Q3HBox *addHBoxPage( const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); /** * This is like addHBoxPage just above, with the difference that the first * element is a list of strings. These strings are used to form a path * of folders down to the given page. The initial elements are names * for the folders, while the last element is the name of the page. * Note: This does yet only work for the TreeList face. Later this may * be added for the IconList face too. In other faces than the * TreeList, all the strings except the last one is ignored. * * Deleting the returned frame will cause the listitem or tab to be * removed (you can re-add a page with the same name later. **/ - virtual QHBox *addHBoxPage( const QStringList &items, + virtual Q3HBox *addHBoxPage( const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); /** * Add a new page when the class is used in either TreeList or Tabbed * mode. The returned widget is empty and you must add your widgets * as children to this widget. The returned widget is a @ref QGrid * so it contains a QGridLayout layout that places up the child widgets * in a grid. * * Deleting the returned frame will cause the listitem or tab to be * removed (you can re-add a page with the same name later. @@ -328,43 +334,43 @@ class KJanusWidget : public QWidget * @param dir Can be QGrid::Horizontal or QGrid::Vertical. * @param item String used in the list or Tab item. * @param header A longer string used in TreeList and IconList mode to * describe the contents of a page. If empty, the item string * will be used instead. * @param pixmap Used in IconList mode or in TreeList mode. You should * prefer a pixmap with size 32x32 pixels. * * @return The empty page or 0 if the face is not TreeList, IconList or * Tabbed. */ //US changed Orientation into Direction for compatibility - virtual QGrid *addGridPage( int n, QGrid::Direction dir, + virtual Q3Grid *addGridPage( int n, Qt::Orientation dir, const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); /** * This is like addGridPage just above, with the difference that the first * element is a list of strings. These strings are used to form a path * of folders down to the given page. The initial elements are names * for the folders, while the last element is the name of the page. * Note: This does yet only work for the TreeList face. Later this may * be added for the IconList face too. In other faces than the * TreeList, all the strings except the last one is ignored. * * Deleting the returned frame will cause the listitem or tab to be * removed (you can re-add a page with the same name later. **/ //US changed Orientation into Direction for compatibility - virtual QGrid *addGridPage( int n, QGrid::Direction dir, + virtual Q3Grid *addGridPage( int n, Qt::Orientation dir, const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap() ); /** * @short Removes a page created with @ref addPage, @ref addVBoxPage, * @ref addHBoxPage or @ref addGridPage. If the page has already * been deleted or has already been removed, nothing happens. The widget * itself is not deleted. * * @param page The widget returned by @ref addPage , @ref addVBoxPage , * @ref addHBoxPage or @ref addGridPage . @@ -508,56 +514,56 @@ class KJanusWidget : public QWidget * This function is used internally when in IconList mode. If you * reimplement this class a make your own event filter, make sure to * call this function from your filter. * * @param o Object that has received an event. * @param e The event. */ virtual bool eventFilter( QObject *o, QEvent *e ); private slots: bool slotShowPage(); //US not yet implemented void slotFontChanged(); - void slotItemClicked(QListViewItem *it); + void slotItemClicked(Q3ListViewItem *it); void pageGone( QObject *obj); // signal from the added page's "destroyed" signal - void slotReopen(QListViewItem *item); + void slotReopen(Q3ListViewItem *item); protected: bool showPage( QWidget *w ); - void addPageWidget( QFrame *page, const QStringList &items, + void addPageWidget( Q3Frame *page, const QStringList &items, const QString &header, const QPixmap &pixmap ); - void InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, QFrame *page); + void InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, Q3Frame *page); QWidget *FindParent(); private: bool mValid; // Obsolete members. Remove in KDE 4. - QPtrList<QWidget> *mPageList; + Q3PtrList<QWidget> *mPageList; QStringList *mTitleList; int mFace; KListView *mTreeList; IconListBox *mIconList; - QWidgetStack *mPageStack; + Q3WidgetStack *mPageStack; QLabel *mTitleLabel; QTabWidget *mTabControl; - QFrame *mPlainPage; + Q3Frame *mPlainPage; QWidget *mSwallowPage; QWidget *mActivePageWidget; KSeparator *mTitleSep; //US QSplitter::ResizeMode mTreeListResizeMode; bool mShowIconsInTreeList; - QMap<QListViewItem *, QWidget *> mTreeListToPageStack; - QMap<QListBoxItem *, QWidget *> mIconListToPageStack; + QMap<Q3ListViewItem *, QWidget *> mTreeListToPageStack; + QMap<Q3ListBoxItem *, QWidget *> mIconListToPageStack; QMap<QString, QPixmap> mFolderIconMap; QMap<QString, QStringList> mChildrenNames; QMap<QString, QWidget *> mChildPages; public: class IconListItem; protected: virtual void virtual_hook( int id, void* data ); private: class KJanusWidgetPrivate; KJanusWidgetPrivate *d; }; |