Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::Ui::OTabWidget Class Reference

The OTabWidget class provides a stack of widgets. More...

#include </home/clem/local/src/opie/libopie2/opieui/otabwidget.h>

Inheritance diagram for Opie::Ui::OTabWidget:

Inheritance graph
[legend]
Collaboration diagram for Opie::Ui::OTabWidget:

Collaboration graph
[legend]
List of all members.

Public Types

enum  TabStyle {
  Global, TextTab, IconTab, TextList,
  IconList
}
 Defines how the widget selection control is displayed. More...
enum  TabPosition { Top, Bottom }
 Defines where the widget selection control is drawn. More...

Signals

void currentChanged (QWidget *)
 This signal is emitted whenever the widget has changed.

Public Member Functions

 OTabWidget (QWidget *=0, const char *=0, TabStyle=Global, TabPosition=Top)
 Object constructor.
 ~OTabWidget ()
 Object destructor.
void addTab (QWidget *, const QString &, const QString &)
 Add new widget to control.
void removePage (QWidget *)
 Remove widget from control. Does not delete widget.
void changeTab (QWidget *, const QString &, const QString &)
 Change text and/or icon for existing tab.
TabStyle tabStyle () const
 Returns current widget selection control style.
void setTabStyle (TabStyle)
 Set the current widget selection control style.
TabPosition tabPosition () const
 Returns current widget selection control position.
void setTabPosition (TabPosition)
 Set the current widget selection control position.
void setCurrentTab (QWidget *)
 Selects and brings to top the desired widget by using widget pointer.
void setCurrentTab (const QString &)
 Selects and brings to top the desired widget, by using label.
void setCurrentTab (int)
 Selects and brings to top the desired widget, by using id.
int currentTab ()
 returns current tab id.
QWidget * currentWidget () const
 returns the current page of the active tab

Protected Member Functions

void resizeEvent (QResizeEvent *)
 Reimplemented for internal purposes.

Private Slots

void slotTabBarSelected (int)
 Slot which is called when a tab is selected.
void slotTabListSelected (int)
 Slot which is called when a drop down selection is made.

Private Member Functions

void selectTab (OTabInfo *)
 Internal function to select desired widget.
void setUpLayout ()
 Internal function to adjust layout.

Private Attributes

OTabInfoList m_tabs
OTabInfom_currTab
TabStyle m_tabBarStyle
TabPosition m_tabBarPosition
bool m_usingTabs
OTabBarm_tabBar
QComboBox * m_tabList
QWidgetStack * m_widgetStack
Private * d

Detailed Description

The OTabWidget class provides a stack of widgets.

OTabWidget is a derivation of TrollTech's QTabWidget which provides a stack of widgets. Widgets can be selected using either a tab bar or drop down list box.

The normal way to use OTabWidget is to do the following in the constructor:

Definition at line 67 of file otabwidget.h.


Member Enumeration Documentation

enum Opie::Ui::OTabWidget::TabPosition
 

Defines where the widget selection control is drawn.

Valid values:

  • Top: Widget selection control is drawn above widgets
  • Bottom: Widget selection control is drawn below widgets
Enumeration values:
Top 
Bottom 

Definition at line 94 of file otabwidget.h.

enum Opie::Ui::OTabWidget::TabStyle
 

Defines how the widget selection control is displayed.

Valid values:

  • Global: use globally selected options (qpe.conf - TabStyle & TabPosition)
  • TextTab: Tabbed widget selection with text labels
  • IconTab: Tabbed widget selection with icon labels, text label for active widget (similar to Opie launcher)
  • TextList: Drop down list widget selection with text labels
  • IconList: Drop down list widget selection with icon & text labels
Enumeration values:
Global 
TextTab 
IconTab 
TextList 
IconList 

Definition at line 84 of file otabwidget.h.


Constructor & Destructor Documentation

Opie::Ui::OTabWidget::OTabWidget QWidget *  parent = 0,
const char *  name = 0,
TabStyle  s = Global,
TabPosition  p = Top
 

Object constructor.

Parameters:
parent Pointer to parent of this control.
name Name of control.
s Style of widget selection control.
p Position of the widget selection control.
Constructs a new OTabWidget control with parent and name. The style and position parameters determine how the widget selection control will be displayed.

Definition at line 45 of file otabwidget.cpp.

References Bottom, IconList, IconTab, m_widgetStack, Config::readEntry(), Config::readNumEntry(), Config::setGroup(), setTabPosition(), setTabStyle(), and Top.

Opie::Ui::OTabWidget::~OTabWidget  ) 
 

Object destructor.

Definition at line 80 of file otabwidget.cpp.

References m_tabs.


Member Function Documentation

Opie::Ui::OTabWidget::addTab QWidget *  child,
const QString icon,
const QString label
 

Add new widget to control.

Parameters:
child Widget control.
icon Path to icon.
label Text label.

Definition at line 86 of file otabwidget.cpp.

References IconList, IconTab, Opie::Core::OResource::loadPixmap(), m_tabBar, m_tabBarStyle, m_tabList, m_tabs, m_usingTabs, m_widgetStack, QString::null, resizeEvent(), selectTab(), and Opie::Core::OResource::SmallIcon.

Referenced by TabWidget::add(), Opie::Ui::OSplitter::addToTab(), Checkbook::Checkbook(), ConfigureDlg::ConfigureDlg(), main(), MainWindow::MainWindow(), MemoryStatus::MemoryStatus(), MultiauthConfig::MultiauthConfig(), OIpkgConfigDlg::OIpkgConfigDlg(), TinyKate::open(), MainWindow::openModule(), PackageInfoDlg::PackageInfoDlg(), SettingsImpl::SettingsImpl(), PMainWindow::slotConfig(), TinyKate::slotNew(), and SystemInfo::SystemInfo().

Opie::Ui::OTabWidget::changeTab QWidget *  widget,
const QString icon,
const QString label
 

Change text and/or icon for existing tab.

Parameters:
child Widget control.
icon Path to icon.
label Text label.

Definition at line 179 of file otabwidget.cpp.

References Opie::Ui::OTabInfo::control(), i, IconList, IconTab, Opie::Ui::OTabInfo::id(), Opie::Ui::OTabInfo::label(), Opie::Core::OResource::loadPixmap(), m_tabBar, m_tabBarStyle, m_tabList, m_tabs, m_usingTabs, resizeEvent(), Opie::Ui::OTabInfo::setIcon(), Opie::Ui::OTabInfo::setLabel(), setUpLayout(), and Opie::Core::OResource::SmallIcon.

Opie::Ui::OTabWidget::currentChanged QWidget *  widget  )  [signal]
 

This signal is emitted whenever the widget has changed.

Parameters:
widget Pointer to new current widget.

Referenced by selectTab(), and TabWidget::TabWidget().

Opie::Ui::OTabWidget::currentTab  ) 
 

returns current tab id.

Definition at line 467 of file otabwidget.cpp.

References Opie::Ui::OTabInfo::id(), and m_currTab.

QWidget * OTabWidget::currentWidget  )  const
 

returns the current page of the active tab

Since:
1.2

Definition at line 476 of file otabwidget.cpp.

References Opie::Ui::OTabInfo::control(), and m_currTab.

Referenced by Opie::Ui::OSplitter::currentWidget(), MainWindow::initConfig(), MainWindow::slotBookmarkAdd(), MainWindow::slotBookmarkRemove(), MainWindow::slotEditCopy(), MainWindow::slotNavKeyChanged(), MainWindow::slotNavNextPage(), MainWindow::slotNavNextVerse(), MainWindow::slotNavPrevPage(), MainWindow::slotNavPrevVerse(), MainWindow::slotSearchResultClicked(), MainWindow::slotShow(), MainWindow::slotTextClose(), and MainWindow::slotTextRefClicked().

Opie::Ui::OTabWidget::removePage QWidget *  widget  ) 
 

Remove widget from control. Does not delete widget.

Parameters:
widget Widget control to be removed.

Definition at line 131 of file otabwidget.cpp.

References Opie::Ui::OTabInfo::control(), false, i, Opie::Ui::OTabInfo::id(), Opie::Ui::OTabInfo::label(), m_currTab, m_tabBar, m_tabList, m_tabs, m_usingTabs, m_widgetStack, resizeEvent(), and setUpLayout().

Referenced by MainWindowImp::MainWindowImp(), TabWidget::remove(), Opie::Ui::OSplitter::removeFromTab(), TinyKate::slotClose(), and MainWindow::slotTextClose().

Opie::Ui::OTabWidget::resizeEvent QResizeEvent *   )  [protected]
 

Reimplemented for internal purposes.

Definition at line 426 of file otabwidget.cpp.

References Bottom, height, m_tabBar, m_tabBarPosition, m_tabList, m_usingTabs, m_widgetStack, t, and width.

Referenced by addTab(), changeTab(), and removePage().

Opie::Ui::OTabWidget::selectTab OTabInfo tab  )  [private]
 

Internal function to select desired widget.

Parameters:
tab Pointer to data for widget.

Definition at line 377 of file otabwidget.cpp.

References Bottom, Opie::Ui::OTabInfo::control(), currentChanged(), height, IconTab, Opie::Ui::OTabInfo::id(), Opie::Ui::OTabInfo::label(), m_currTab, m_tabBar, m_tabBarPosition, m_tabBarStyle, m_widgetStack, QString::null, setUpLayout(), t, TextTab, and width.

Referenced by addTab(), setCurrentTab(), slotTabBarSelected(), and slotTabListSelected().

Opie::Ui::OTabWidget::setCurrentTab int  tabindex  ) 
 

Selects and brings to top the desired widget, by using id.

Parameters:
tab id for widget to select.

Definition at line 251 of file otabwidget.cpp.

References Opie::Ui::OTabInfo::id(), m_tabs, and selectTab().

Opie::Ui::OTabWidget::setCurrentTab const QString tabname  ) 
 

Selects and brings to top the desired widget, by using label.

Parameters:
tabname Text label for widget to select.

Definition at line 238 of file otabwidget.cpp.

References Opie::Ui::OTabInfo::label(), m_tabs, and selectTab().

Opie::Ui::OTabWidget::setCurrentTab QWidget *  childwidget  ) 
 

Selects and brings to top the desired widget by using widget pointer.

Parameters:
childwidget Widget to select.

Definition at line 225 of file otabwidget.cpp.

References Opie::Ui::OTabInfo::control(), m_tabs, and selectTab().

Referenced by Checkbook::Checkbook(), ConfigureDlg::ConfigureDlg(), MainWindow::initConfig(), MainWindow::MainWindow(), MultiauthConfig::MultiauthConfig(), OIpkgConfigDlg::OIpkgConfigDlg(), MainWindow::openModule(), PackageInfoDlg::PackageInfoDlg(), TabWidget::setCurrent(), Opie::Ui::OSplitter::setCurrentWidget(), ContactEditor::setEntry(), SettingsImpl::SettingsImpl(), and PMainWindow::slotConfig().

Opie::Ui::OTabWidget::setTabPosition TabPosition  p  ) 
 

Set the current widget selection control position.

Parameters:
p New position of widget selection control.

Definition at line 345 of file otabwidget.cpp.

References m_tabBar, m_tabBarPosition, m_usingTabs, setUpLayout(), and Top.

Referenced by OTabWidget().

Opie::Ui::OTabWidget::setTabStyle TabStyle  s  ) 
 

Set the current widget selection control style.

Parameters:
s New style to be used.

Definition at line 270 of file otabwidget.cpp.

References IconList, IconTab, l, Opie::Core::OResource::loadPixmap(), m_tabBar, m_tabBarStyle, m_tabList, m_tabs, m_usingTabs, QString::null, setUpLayout(), slotTabBarSelected(), slotTabListSelected(), Opie::Core::OResource::SmallIcon, and TextTab.

Referenced by ProfileEditorDialog::initUI(), and OTabWidget().

Opie::Ui::OTabWidget::setUpLayout  )  [private]
 

Internal function to adjust layout.

Definition at line 417 of file otabwidget.cpp.

References m_tabBar, and m_usingTabs.

Referenced by changeTab(), removePage(), selectTab(), setTabPosition(), and setTabStyle().

Opie::Ui::OTabWidget::slotTabBarSelected int  id  )  [private, slot]
 

Slot which is called when a tab is selected.

Parameters:
id ID of widget selected.

Definition at line 360 of file otabwidget.cpp.

References Opie::Ui::OTabInfo::id(), m_tabs, and selectTab().

Referenced by setTabStyle().

Opie::Ui::OTabWidget::slotTabListSelected int  index  )  [private, slot]
 

Slot which is called when a drop down selection is made.

Parameters:
id Index of widget selected.

Definition at line 370 of file otabwidget.cpp.

References m_tabs, and selectTab().

Referenced by setTabStyle().

Opie::Ui::OTabWidget::tabPosition  )  const
 

Returns current widget selection control position.

Definition at line 340 of file otabwidget.cpp.

References m_tabBarPosition.

Opie::Ui::OTabWidget::tabStyle  )  const
 

Returns current widget selection control style.

Definition at line 265 of file otabwidget.cpp.

References m_tabBarStyle.


Member Data Documentation

Private* Opie::Ui::OTabWidget::d [private]
 

Definition at line 230 of file otabwidget.h.

OTabInfo* Opie::Ui::OTabWidget::m_currTab [private]
 

Definition at line 219 of file otabwidget.h.

Referenced by currentTab(), currentWidget(), removePage(), and selectTab().

OTabBar* Opie::Ui::OTabWidget::m_tabBar [private]
 

Definition at line 226 of file otabwidget.h.

Referenced by addTab(), changeTab(), removePage(), resizeEvent(), selectTab(), setTabPosition(), setTabStyle(), and setUpLayout().

TabPosition Opie::Ui::OTabWidget::m_tabBarPosition [private]
 

Definition at line 221 of file otabwidget.h.

Referenced by resizeEvent(), selectTab(), setTabPosition(), and tabPosition().

TabStyle Opie::Ui::OTabWidget::m_tabBarStyle [private]
 

Definition at line 220 of file otabwidget.h.

Referenced by addTab(), changeTab(), selectTab(), setTabStyle(), and tabStyle().

QComboBox* Opie::Ui::OTabWidget::m_tabList [private]
 

Definition at line 227 of file otabwidget.h.

Referenced by addTab(), changeTab(), removePage(), resizeEvent(), and setTabStyle().

OTabInfoList Opie::Ui::OTabWidget::m_tabs [private]
 

Definition at line 218 of file otabwidget.h.

Referenced by addTab(), changeTab(), removePage(), setCurrentTab(), setTabStyle(), slotTabBarSelected(), slotTabListSelected(), and ~OTabWidget().

bool Opie::Ui::OTabWidget::m_usingTabs [private]
 

Definition at line 222 of file otabwidget.h.

Referenced by addTab(), changeTab(), removePage(), resizeEvent(), setTabPosition(), setTabStyle(), and setUpLayout().

QWidgetStack* Opie::Ui::OTabWidget::m_widgetStack [private]
 

Definition at line 228 of file otabwidget.h.

Referenced by addTab(), OTabWidget(), removePage(), resizeEvent(), and selectTab().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:02:08 2005 for OPIE by  doxygen 1.4.2