#include </home/clem/local/src/opie/libopie2/qt3/opieui/ojanuswidget.h>
Collaboration diagram for OJanusWidget:

Public Types | |
| enum | Face { TreeList = 0, Tabbed, Plain, Swallow, IconList } |
Public Slots | |
| virtual void | setFocus () |
Signals | |
| void | aboutToShowPage (QWidget *page) |
Public Member Functions | |
| OJanusWidget (QWidget *parent=0, const char *name=0, int face=Plain) | |
| ~OJanusWidget () | |
| virtual bool | showPage (int index) |
| virtual int | activePageIndex () const |
| virtual bool | isValid () const |
| virtual int | face () const |
| virtual QSize | minimumSizeHint () const |
| virtual QSize | sizeHint () const |
| virtual QFrame * | plainPage () |
| virtual QFrame * | addPage (const QString &item, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
| virtual QFrame * | addPage (const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
| virtual QVBox * | addVBoxPage (const QString &item, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
| virtual QVBox * | addVBoxPage (const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
| virtual QHBox * | addHBoxPage (const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
| virtual QHBox * | addHBoxPage (const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
| virtual QGrid * | addGridPage (int n, Orientation dir, const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
| virtual QGrid * | addGridPage (int n, Orientation dir, const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
| void | removePage (QWidget *page) |
| Removes a page created with addPage, addVBoxPage, addHBoxPage or addGridPage. If the page has already been deleted or has already been removed, nothing happens. The widget itself is not deleted. | |
| virtual int | pageIndex (QWidget *widget) const |
| virtual bool | setSwallowedWidget (QWidget *widget) |
| virtual void | setTreeListAutoResize (bool state) |
| virtual void | setShowIconsInTreeList (bool state) |
| virtual void | setRootIsDecorated (bool state) |
| void | unfoldTreeList (bool persist=false) |
| virtual void | setIconListAllVisible (bool state) |
| virtual void | setFolderIcon (const QStringList &path, const QPixmap &pixmap) |
Protected Member Functions | |
| virtual void | showEvent (QShowEvent *) |
| virtual bool | eventFilter (QObject *o, QEvent *e) |
| bool | showPage (QWidget *w) |
| void | addPageWidget (QFrame *page, const QStringList &items, const QString &header, const QPixmap &pixmap) |
| void | InsertTreeListItem (const QStringList &items, const QPixmap &pixmap, QFrame *page) |
| QWidget * | FindParent () |
Private Slots | |
| bool | slotShowPage () |
| void | slotFontChanged () |
| void | slotItemClicked (QListViewItem *it) |
| void | pageGone (QObject *obj) |
| void | slotReopen (QListViewItem *item) |
Private Attributes | |
| bool | mValid |
| QPtrList< QWidget > * | mPageList |
| QStringList * | mTitleList |
| int | mFace |
| QListView * | mTreeList |
| IconListBox * | mIconList |
| QWidgetStack * | mPageStack |
| QLabel * | mTitleLabel |
| QTabWidget * | mTabControl |
| QFrame * | mPlainPage |
| QWidget * | mSwallowPage |
| QWidget * | mActivePageWidget |
| OSeparator * | mTitleSep |
| QSplitter::ResizeMode | mTreeListResizeMode |
| bool | mShowIconsInTreeList |
| QMap< QListViewItem *, QWidget * > | mTreeListToPageStack |
| QMap< QListBoxItem *, QWidget * > | mIconListToPageStack |
| QMap< QString, QPixmap > | mFolderIconMap |
| QMap< QString, QStringList > | mChildrenNames |
| QMap< QString, QWidget * > | mChildPages |
| OJanusWidgetPrivate * | d |
Classes | |
| class | IconListBox |
| class | IconListItem |
Provides a number of ready to use layouts (faces). It is used as an internal widget in 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.
The IconList face provides an icon list in the left area and pages in the right. For each entry the Icon is on top with the text below. The style is somewhat similar to the layout of the Eudora configuation dialog box. A page is raised by selecting the corresponding icon list item. The preferred icon size is 32x32 pixels.
The Tabbed face is a common tabbed widget. The procedure for creating a page is similar for creating a TreeList. This has the advantage that if your widget contain too many pages it is trivial to convert it into a TreeList. Just change the face in the KJanusWidget constructor to KJanusWidget::TreeList and you have a tree list layout instead.
The Plain face provides an empty widget (QFrame) where you can place your widgets. The KJanusWidget makes no assumptions regarding the contents so you are free to add whatever you want.
The Swallow face is provided in order to simplify the usage of existing widgets and to allow changing the visible widget. You specify the widget to be displayed by setSwallowedWidget(). Your widget will be reparented inside the widget. You can specify a Null (0) widget. A empty space is then displayed.
For all modes it is important that you specify the QWidget::minimumSize() on the page, plain widget or the swallowed widget. If you use a QLayout on the page, plain widget or the swallowed widget this will be taken care of automatically. The size is used when the KJanusWidget determines its own minimum size. You get the minimum size by using the minimumSizeHint() or sizeHint() methods.
Pages that have been added in TreeList, IconList or Tabbed mode can be removed by simply deleting the page.
Definition at line 100 of file ojanuswidget.h.
|
|
Definition at line 124 of file ojanuswidget.h. |
|
||||||||||||||||
|
Constructor where you specify the face.
Definition at line 86 of file ojanuswidget.cpp. References aboutToShowPage(), QString::fromLatin1(), IconList, QSplitter::KeepSize, mFace, mIconList, mPageList, mPageStack, mPlainPage, mSwallowPage, mTabControl, mTitleLabel, mTitleList, mTitleSep, mTreeList, mTreeListResizeMode, mValid, p, Plain, setSwallowedWidget(), slotItemClicked(), slotShowPage(), Swallow, Tabbed, and TreeList. |
|
|
Destructor. Definition at line 197 of file ojanuswidget.cpp. References mPageList, and mTitleList. |
|
|
Referenced by OJanusWidget(). |
|
|
Returns the index of the page that are currently displayed.
Definition at line 652 of file ojanuswidget.cpp. References false, QPtrList< type >::findRef(), IconList, mFace, mIconList, mIconListToPageStack, mPageList, mTabControl, mTreeList, mTreeListToPageStack, Tabbed, and TreeList. |
|
||||||||||||||||||||||||
|
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. Definition at line 320 of file ojanuswidget.cpp. References addPageWidget(), false, FindParent(), mValid, and qDebug(). |
|
||||||||||||||||||||||||
|
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 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.
Definition at line 339 of file ojanuswidget.cpp. References items. |
|
||||||||||||||||
|
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. Definition at line 295 of file ojanuswidget.cpp. References addPageWidget(), false, FindParent(), mValid, and qDebug(). |
|
||||||||||||||||
|
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 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.
Definition at line 311 of file ojanuswidget.cpp. References items. |
|
||||||||||||||||
|
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. Definition at line 233 of file ojanuswidget.cpp. References addPageWidget(), false, FindParent(), mValid, and qDebug(). |
|
||||||||||||||||
|
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.
Definition at line 259 of file ojanuswidget.cpp. References items. |
|
||||||||||||||||||||
|
||||||||||||||||
|
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. Definition at line 269 of file ojanuswidget.cpp. References addPageWidget(), false, FindParent(), mValid, and qDebug(). |
|
||||||||||||||||
|
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 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.
Definition at line 286 of file ojanuswidget.cpp. References items. |
|
||||||||||||
|
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.
Definition at line 890 of file ojanuswidget.cpp. References mIconList, and OJanusWidget::IconListItem::width(). |
|
|
Returns the face type.
Definition at line 218 of file ojanuswidget.cpp. References mFace. |
|
|
Definition at line 223 of file ojanuswidget.cpp. References mFace, mTabControl, and Tabbed. Referenced by addGridPage(), addHBoxPage(), addPage(), and addVBoxPage(). |
|
||||||||||||||||
|
Definition at line 349 of file ojanuswidget.cpp. References QValueList< T >::begin(), QMap< Key, T >::contains(), QValueList< T >::count(), QValueList< T >::end(), QMap< Key, T >::insert(), QStringList::join(), mFolderIconMap, mShowIconsInTreeList, mTreeList, mTreeListToPageStack, name, p, and qDebug(). Referenced by addPageWidget(). |
|
|
Use this to verify that no memory allocation failed.
Definition at line 206 of file ojanuswidget.cpp. References mValid. |
|
|
Returns the minimum size that must be made available for the widget so that UIs can be displayed properly
Definition at line 764 of file ojanuswidget.cpp. References IconList, mFace, mIconList, mPageStack, mPlainPage, mSwallowPage, mTabControl, mTitleLabel, mTitleSep, mTreeList, Plain, Swallow, Tabbed, TreeList, true, OJanusWidget::IconListBox::updateMinimumHeight(), and OJanusWidget::IconListBox::updateWidth(). Referenced by sizeHint(). |
|
|
Definition at line 248 of file ojanuswidget.cpp. References removePage(). Referenced by addPageWidget(). |
|
|
Returns the index of a page created with addPage , addVBoxPage , addHBoxPage or addGridPage . You can can compare this index with the value returned from activePageIndex if you need to do some page specific actions in your code. The returned index will never change so you can safely use this function once and save the value.
Definition at line 676 of file ojanuswidget.cpp. References QPtrList< type >::findRef(), IconList, mFace, mPageList, Tabbed, and TreeList. |
|
|
Returns the empty widget that is available in Plain mode.
Definition at line 212 of file ojanuswidget.cpp. References mPlainPage. |
|
|
Removes a page created with addPage, addVBoxPage, addHBoxPage or addGridPage. If the page has already been deleted or has already been removed, nothing happens. The widget itself is not deleted.
Definition at line 1077 of file ojanuswidget.cpp. References QMap< Key, T >::begin(), QPtrList< type >::containsRef(), QMap< Key, T >::end(), QPtrList< type >::findRef(), i, IconList, mFace, mIconListToPageStack, mPageList, mPageStack, mTabControl, mTitleList, mTreeListToPageStack, QMap< Key, T >::remove(), QPtrList< type >::removeRef(), and TreeList. Referenced by pageGone(). |
|
|
Give the keyboard input focus to the widget. Definition at line 738 of file ojanuswidget.cpp. References false, IconList, mFace, mIconList, mPlainPage, mSwallowPage, mTabControl, mTreeList, mValid, Plain, Swallow, Tabbed, and TreeList. |
|
||||||||||||
|
Sets the icon used in TreeList Mode for the given path. Definition at line 490 of file ojanuswidget.cpp. References QMap< Key, T >::insert(), QStringList::join(), and mFolderIconMap. |
|
|
This function has only effect in IconList mode. Defines how the icon list widget is displayed. By default it is the widgets in the pages that decide the minimum height of the toplevel widget. A vertical scrollbar can be used in the icon list area.
Definition at line 841 of file ojanuswidget.cpp. References IconList, mFace, mIconList, and OJanusWidget::IconListBox::setShowAll(). |
|
|
This function has only effect in TreeList mode. This tells the widgets whether the root should be decorated. For details see QListView::setRootIsDecorated
Definition at line 854 of file ojanuswidget.cpp. |
|
|
This function has only effect in TreeList mode. This tells the widgets whether the icons given in the addPage, addVBoxPage, addHBoxPage, or addGridPage methods should be shown in the TreeList. Note: This method must be called before calling any of the methods which add icons to the page.
Definition at line 849 of file ojanuswidget.cpp. References mShowIconsInTreeList. |
|
|
Defines the widget to be swallowed. This method can be used several times. Only the latest defined widget will be shown.
Definition at line 498 of file ojanuswidget.cpp. References false, i, l, mFace, mSwallowPage, mValid, o, Swallow, and true. Referenced by OJanusWidget(). |
|
|
This function has only effect in TreeList mode. Defines how the tree list is resized when the widget is resized horizontally. By default the tree list keeps its width when the widget becomes wider.
Definition at line 829 of file ojanuswidget.cpp. References QSplitter::KeepSize, mFace, mTreeList, mTreeListResizeMode, QSplitter::setResizeMode(), QSplitter::Stretch, and TreeList. |
|
|
Reimplemented to handle the splitter width when the the face is TreeList Definition at line 875 of file ojanuswidget.cpp. References mFace, mTreeList, mTreeListResizeMode, QSplitter::setResizeMode(), and TreeList. |
|
|
Definition at line 590 of file ojanuswidget.cpp. References QValueList< T >::at(), QMap< Key, T >::begin(), QMap< Key, T >::end(), false, QPtrList< type >::findRef(), IconList, mActivePageWidget, mFace, mIconList, mIconListToPageStack, mPageList, mPageStack, mTabControl, mTitleLabel, mTitleList, mTreeList, mTreeListToPageStack, mValid, Tabbed, TreeList, true, and val. |
|
|
Raises the page which was added by addPage().
Definition at line 577 of file ojanuswidget.cpp. References QPtrList< type >::at(), false, mPageList, and mValid. Referenced by addPageWidget(), and slotShowPage(). |
|
|
Returns the recommended size for the widget in order to be displayed properly.
Definition at line 823 of file ojanuswidget.cpp. References minimumSizeHint(). |
|
|
Definition at line 708 of file ojanuswidget.cpp. References KGlobalSettings::generalFont(), IconList, OJanusWidget::IconListBox::invalidateHeight(), OJanusWidget::IconListBox::invalidateWidth(), mFace, mIconList, and mTitleLabel. |
|
|
Definition at line 732 of file ojanuswidget.cpp. Referenced by OJanusWidget(). |
|
|
Definition at line 253 of file ojanuswidget.cpp. Referenced by unfoldTreeList(). |
|
|
Definition at line 550 of file ojanuswidget.cpp. References false, IconList, mFace, mIconList, mIconListToPageStack, mTreeList, mTreeListToPageStack, mValid, showPage(), and TreeList. Referenced by OJanusWidget(). |
|
|
This function has only effect in TreeList mode. This tells the TreeList to unfold the whole tree so that all entries are visible.
If the list is empty when you call this method newly created entries will not automatically be opened. If the
Definition at line 861 of file ojanuswidget.cpp. References mFace, mTreeList, slotReopen(), and TreeList. |
|
|
Definition at line 547 of file ojanuswidget.h. |
|
|
Definition at line 533 of file ojanuswidget.h. Referenced by showPage(). |
|
|
Definition at line 541 of file ojanuswidget.h. |
|
|
Definition at line 540 of file ojanuswidget.h. |
|
|
Definition at line 525 of file ojanuswidget.h. Referenced by activePageIndex(), addPageWidget(), face(), FindParent(), minimumSizeHint(), OJanusWidget(), pageIndex(), removePage(), setFocus(), setIconListAllVisible(), setRootIsDecorated(), setSwallowedWidget(), setTreeListAutoResize(), showEvent(), showPage(), slotFontChanged(), slotShowPage(), and unfoldTreeList(). |
|
|
Definition at line 539 of file ojanuswidget.h. Referenced by InsertTreeListItem(), and setFolderIcon(). |
|
|
Definition at line 527 of file ojanuswidget.h. Referenced by activePageIndex(), addPageWidget(), eventFilter(), minimumSizeHint(), OJanusWidget(), setFocus(), setIconListAllVisible(), showPage(), slotFontChanged(), and slotShowPage(). |
|
|
Definition at line 538 of file ojanuswidget.h. Referenced by activePageIndex(), addPageWidget(), removePage(), showPage(), and slotShowPage(). |
|
|
Definition at line 522 of file ojanuswidget.h. Referenced by activePageIndex(), addPageWidget(), OJanusWidget(), pageIndex(), removePage(), showPage(), and ~OJanusWidget(). |
|
|
Definition at line 528 of file ojanuswidget.h. Referenced by addPageWidget(), minimumSizeHint(), OJanusWidget(), removePage(), and showPage(). |
|
|
Definition at line 531 of file ojanuswidget.h. Referenced by minimumSizeHint(), OJanusWidget(), plainPage(), and setFocus(). |
|
|
Definition at line 536 of file ojanuswidget.h. Referenced by InsertTreeListItem(), and setShowIconsInTreeList(). |
|
|
Definition at line 532 of file ojanuswidget.h. Referenced by minimumSizeHint(), OJanusWidget(), setFocus(), and setSwallowedWidget(). |
|
|
Definition at line 530 of file ojanuswidget.h. Referenced by activePageIndex(), addPageWidget(), FindParent(), minimumSizeHint(), OJanusWidget(), removePage(), setFocus(), and showPage(). |
|
|
Definition at line 529 of file ojanuswidget.h. Referenced by addPageWidget(), minimumSizeHint(), OJanusWidget(), showPage(), and slotFontChanged(). |
|
|
Definition at line 523 of file ojanuswidget.h. Referenced by addPageWidget(), OJanusWidget(), removePage(), showPage(), and ~OJanusWidget(). |
|
|
Definition at line 534 of file ojanuswidget.h. Referenced by minimumSizeHint(), and OJanusWidget(). |
|
|
Definition at line 526 of file ojanuswidget.h. Referenced by activePageIndex(), InsertTreeListItem(), minimumSizeHint(), OJanusWidget(), setFocus(), setRootIsDecorated(), setTreeListAutoResize(), showEvent(), showPage(), slotShowPage(), and unfoldTreeList(). |
|
|
Definition at line 535 of file ojanuswidget.h. Referenced by OJanusWidget(), setTreeListAutoResize(), and showEvent(). |
|
|
Definition at line 537 of file ojanuswidget.h. Referenced by activePageIndex(), InsertTreeListItem(), removePage(), showPage(), and slotShowPage(). |
|
|
Definition at line 520 of file ojanuswidget.h. Referenced by addGridPage(), addHBoxPage(), addPage(), addVBoxPage(), isValid(), OJanusWidget(), setFocus(), setSwallowedWidget(), showPage(), and slotShowPage(). |
1.4.2