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

OTabWidget Class Reference

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

#include </home/clem/local/src/opie/noncore/unsupported/libopie/otabwidget.h>

Collaboration diagram for 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.
QSize sizeHint () const
 Reimplemented for internal purposes.
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

QPixmap loadSmooth (const QString &)
 Loads icon for widget.
void selectTab (OTabInfo *)
 Internal function to select desired widget.
void setUpLayout ()
 Internal function to adjust layout.

Private Attributes

OTabInfoList tabs
OTabInfocurrTab
TabStyle tabBarStyle
TabPosition tabBarPosition
QWidgetStack * tabBarStack
OTabBartabBar
QComboBox * tabList
QWidgetStack * 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 61 of file otabwidget.h.


Member Enumeration Documentation

enum 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 88 of file otabwidget.h.

enum 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 78 of file otabwidget.h.


Constructor & Destructor Documentation

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 42 of file otabwidget.cpp.

References Bottom, currTab, IconList, IconTab, pos, Config::readEntry(), Config::readNumEntry(), Config::setGroup(), setTabPosition(), setTabStyle(), slotTabBarSelected(), slotTabListSelected(), tabBar, tabBarPosition, tabBarStack, tabList, Top, and widgetStack.

OTabWidget::~OTabWidget  ) 
 

Object destructor.

Definition at line 86 of file otabwidget.cpp.


Member Function Documentation

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 90 of file otabwidget.cpp.

References IconList, IconTab, loadSmooth(), QString::null, selectTab(), tabBar, tabBarStyle, tabList, tabs, and widgetStack.

Referenced by EmailClient::init().

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 163 of file otabwidget.cpp.

References OTabInfo::control(), i, IconList, IconTab, OTabInfo::id(), OTabInfo::label(), loadSmooth(), OTabInfo::setIcon(), OTabInfo::setLabel(), setUpLayout(), tabBar, tabBarStyle, tabList, and tabs.

OTabWidget::currentChanged QWidget *  widget  )  [signal]
 

This signal is emitted whenever the widget has changed.

Parameters:
widget Pointer to new current widget.

Referenced by selectTab().

OTabWidget::currentTab  ) 
 

returns current tab id.

Definition at line 402 of file otabwidget.cpp.

References currTab, and OTabInfo::id().

Referenced by EmailClient::deleteItem().

QWidget * OTabWidget::currentWidget  )  const
 

returns the current page of the active tab

Since:
1.2

Definition at line 411 of file otabwidget.cpp.

References OTabInfo::control(), and currTab.

OTabWidget::loadSmooth const QString name  )  [private]
 

Loads icon for widget.

Parameters:
name Name of icon image file.

Definition at line 328 of file otabwidget.cpp.

References Resource::loadImage(), p, and AppLnk::smallIconSize().

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

OTabWidget::removePage QWidget *  widget  ) 
 

Remove widget from control. Does not delete widget.

Parameters:
widget Widget control to be removed.

Definition at line 127 of file otabwidget.cpp.

References OTabInfo::control(), currTab, FALSE, i, OTabInfo::id(), OTabInfo::label(), setUpLayout(), tabBar, tabList, tabs, and widgetStack.

OTabWidget::resizeEvent QResizeEvent *   )  [protected]
 

Reimplemented for internal purposes.

Definition at line 397 of file otabwidget.cpp.

References setUpLayout().

OTabWidget::selectTab OTabInfo tab  )  [private]
 

Internal function to select desired widget.

Parameters:
tab Pointer to data for widget.

Definition at line 335 of file otabwidget.cpp.

References currentChanged(), currTab, IconTab, QString::null, setUpLayout(), tabBar, tabBarStyle, and widgetStack.

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

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 225 of file otabwidget.cpp.

References OTabInfo::id(), selectTab(), and tabs.

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 212 of file otabwidget.cpp.

References OTabInfo::label(), selectTab(), and tabs.

OTabWidget::setCurrentTab QWidget *  childwidget  ) 
 

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

Parameters:
childwidget Widget to select.

Definition at line 199 of file otabwidget.cpp.

References OTabInfo::control(), selectTab(), and tabs.

Referenced by EmailClient::allMailArrived(), EmailClient::EmailClient(), EmailClient::enqueMail(), and EmailClient::mailArrived().

OTabWidget::setTabPosition TabPosition  p  ) 
 

Set the current widget selection control position.

Parameters:
p New position of widget selection control.

Definition at line 292 of file otabwidget.cpp.

References setUpLayout(), tabBar, tabBarPosition, and Top.

Referenced by OTabWidget().

OTabWidget::setTabStyle TabStyle  s  ) 
 

Set the current widget selection control style.

Parameters:
s New style to be used.

Definition at line 243 of file otabwidget.cpp.

References currTab, IconList, IconTab, loadSmooth(), QString::null, setUpLayout(), tabBar, tabBarStack, tabBarStyle, tabList, tabs, TextList, and TextTab.

Referenced by OTabWidget().

OTabWidget::setUpLayout  )  [private]
 

Internal function to adjust layout.

Definition at line 361 of file otabwidget.cpp.

References Bottom, height, IconTab, t, tabBar, tabBarPosition, tabBarStack, tabBarStyle, widgetStack, and width.

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

OTabWidget::sizeHint  )  const
 

Reimplemented for internal purposes.

Definition at line 390 of file otabwidget.cpp.

References s, t, tabBarStack, and widgetStack.

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

Slot which is called when a tab is selected.

Parameters:
id ID of widget selected.

Definition at line 306 of file otabwidget.cpp.

References OTabInfo::id(), selectTab(), and tabs.

Referenced by OTabWidget().

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 319 of file otabwidget.cpp.

References selectTab(), and tabs.

Referenced by OTabWidget().

OTabWidget::tabPosition  )  const
 

Returns current widget selection control position.

Definition at line 287 of file otabwidget.cpp.

References tabBarPosition.

OTabWidget::tabStyle  )  const
 

Returns current widget selection control style.

Definition at line 238 of file otabwidget.cpp.

References tabBarStyle.


Member Data Documentation

OTabInfo* OTabWidget::currTab [private]
 

Definition at line 221 of file otabwidget.h.

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

Private* OTabWidget::d [private]
 

Definition at line 231 of file otabwidget.h.

OTabBar* OTabWidget::tabBar [private]
 

Definition at line 227 of file otabwidget.h.

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

TabPosition OTabWidget::tabBarPosition [private]
 

Definition at line 224 of file otabwidget.h.

Referenced by OTabWidget(), setTabPosition(), setUpLayout(), and tabPosition().

QWidgetStack* OTabWidget::tabBarStack [private]
 

Definition at line 226 of file otabwidget.h.

Referenced by OTabWidget(), setTabStyle(), setUpLayout(), and sizeHint().

TabStyle OTabWidget::tabBarStyle [private]
 

Definition at line 223 of file otabwidget.h.

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

QComboBox* OTabWidget::tabList [private]
 

Definition at line 228 of file otabwidget.h.

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

OTabInfoList OTabWidget::tabs [private]
 

Definition at line 220 of file otabwidget.h.

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

QWidgetStack* OTabWidget::widgetStack [private]
 

Definition at line 230 of file otabwidget.h.

Referenced by addTab(), OTabWidget(), removePage(), selectTab(), setUpLayout(), and sizeHint().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:43:36 2005 for OPIE by  doxygen 1.4.2