Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

YQWizard Class Reference

#include <YQWizard.h>

Inheritance diagram for YQWizard:

YWizard YContainerWidget YWidget List of all members.

Public Types

enum  Direction { Forward, Backward }

Public Slots

void setHelpText (QString helpText)
void resizeClientArea ()
void showHelp ()
void showSteps ()
void showTree ()
static void setGradient (QWidget *widget, const QPixmap &pixmap)
static void setBottomCroppedGradient (QWidget *widget, const QPixmap &pixmap, int croppedHeight)
static QPixmap bottomCropPixmap (const QPixmap &pixmap, int croppedHeight)
static QColor pixelColor (const QPixmap &pixmap, int x, int y)

Public Member Functions

 YQWizard (QWidget *parent, const YWidgetOpt &opt, const YCPValue &backButtonId, const YCPString &backButtonLabel, const YCPValue &abortButtonId, const YCPString &abortButtonLabel, const YCPValue &nextButtonId, const YCPString &nextButtonLabel)
virtual ~YQWizard ()
Direction direction () const
virtual YCPValue command (const YCPTerm &command)
virtual std::string debugLabel ()
void addChild (YWidget *child)
long nicesize (YUIDimension dim)
void setSize (long newWidth, long newHeight)
bool eventFilter (QObject *obj, QEvent *ev)
void setDialogIcon (const char *iconName)
void setDialogHeading (const QString &headingText)
bool stepsEnabled () const
void addStep (const QString &text, const QString &id)
void addStepHeading (const QString &text)
void deleteSteps ()
void setCurrentStep (const QString &id)
void updateSteps ()
bool treeEnabled () const
YQWizardButtonnextButton () const
YQWizardButtonbackButton () const
YQWizardButtonabortButton () const
void setVerboseCommands (bool verbose)
void addTreeItem (const QString &parentID, const QString &text, const QString &id)
void selectTreeItem (const QString &id)
void deleteTreeItems ()
void addMenu (const QString &text, const QString &id)
void addSubMenu (const QString &parentMenuID, const QString &text, const QString &id)
void addMenuEntry (const QString &parentMenuID, const QString &text, const QString &id)
void addMenuSeparator (const QString &parentMenuID)
void deleteMenus ()

Protected Slots

void backClicked ()
void abortClicked ()
void nextClicked ()
void releaseNotesClicked ()
void sendTreeEvent (QListViewItem *item)
void treeSelectionChanged ()
void sendMenuEvent (int numID)
void retranslateInternalButtons ()

Protected Member Functions

void layoutTitleBar (QWidget *parent)
void layoutSideBar (QWidget *parent)
void layoutSideBarButtonBox (QWidget *parent, QPushButton *button)
void layoutStepsPanel ()
void layoutHelpPanel ()
void layoutTreePanel ()
void layoutWorkArea (QHBox *parentHBox)
void layoutClientArea (QWidget *parent)
void layoutButtonBox (QWidget *parent)
void loadGradientPixmaps ()
void loadStepsIcons ()
void destroyButtons ()
void updateStepStates ()
void addGradientColumn (QWidget *parent, int width=8)
void sendEvent (YCPValue id)
bool runningEmbedded () const
bool highColorDisplay () const
bool isCommand (QString declaration, const YCPTerm &term)
QString qStringArg (const YCPTerm &term, int argNo)
std::string stringArg (const YCPTerm &term, int argNo)
bool boolArg (const YCPTerm &term, int argNo)
YCPValue anyArg (const YCPTerm &term, int argNo)
void setButtonLabel (YQWizardButton *button, const QString &newLabel)
void setButtonID (YQWizardButton *button, const YCPValue &id)
void enableButton (YQWizardButton *button, bool enabled)
void setButtonFocus (YQWizardButton *button)
void setStepStatus (YQWizard::Step *step, const QPixmap &icon, const QColor &color)
YQWizard::StepfindStep (const QString &id)
YQWizard::TreeItemfindTreeItem (const QString &id)
YCPString currentTreeSelection ()
void showReleaseNotesButton (string label, const YCPValue &id)
void hideReleaseNotesButton ()

Protected Attributes

bool _stepsEnabled
bool _treeEnabled
bool _verboseCommands
bool _protectNextButton
bool _stepsDirty
bool _runningEmbedded
Direction _direction
QPixmap _titleBarGradientPixmap
QPixmap _topGradientPixmap
QColor _gradientCenterColor
QPixmap _bottomGradientPixmap
QPixmap _stepCurrentIcon
QPixmap _stepToDoIcon
QPixmap _stepDoneIcon
QColor _stepCurrentColor
QColor _stepToDoColor
QColor _stepDoneColor
QString _currentStepID
QWidgetStack * _sideBar
QVBox * _stepsPanel
QVBox * _stepsBox
QGridLayout * _stepsGrid
QPushButton * _releaseNotesButton
YCPValue _releaseNotesButtonId
QPushButton * _helpButton
QHBox * _helpPanel
QTextBrowser * _helpBrowser
QPushButton * _stepsButton
QPushButton * _treeButton
QHBox * _treePanel
QY2ListView_tree
QVBox * _clientArea
QWidget * _menuBarBox
QMenuBar * _menuBar
QLabel * _dialogIcon
QLabel * _dialogHeading
YQAlignment_contents
YQWizardButton_backButton
QSpacerItem * _backButtonSpacer
YQWizardButton_abortButton
YQWizardButton_nextButton
QPtrList< YQWizard::Step_stepsList
QDict< YQWizard::Step_stepsIDs
QDict< YQWizard::TreeItem_treeIDs
QDict< QPopupMenu > _menuIDs
vector< QString > _menuEntryIDs

Classes

class  Step
class  StepHeading
class  TreeItem

Member Enumeration Documentation

enum YQWizard::Direction
 

Enumerator:
Forward 
Backward 


Constructor & Destructor Documentation

YQWizard::YQWizard QWidget *  parent,
const YWidgetOpt opt,
const YCPValue backButtonId,
const YCPString backButtonLabel,
const YCPValue abortButtonId,
const YCPString abortButtonLabel,
const YCPValue nextButtonId,
const YCPString nextButtonLabel
 

Constructor

YQWizard::~YQWizard  )  [virtual]
 

Destructor


Member Function Documentation

YQWizardButton* YQWizard::abortButton  )  const [inline]
 

Returns the wizard's "Abort" button.

void YQWizard::abortClicked  )  [protected, slot]
 

Internal notification that the "Abort" button has been clicked.

void YQWizard::addChild YWidget child  )  [virtual]
 

Notification that a child widget has been added. Reimplemented from YContainerWidget.

Reimplemented from YContainerWidget.

void YQWizard::addGradientColumn QWidget *  parent,
int  width = 8
[protected]
 

Add a (left or right) margin of the specified width to a widget, consisting of a fixed height top gradient , a flexible center part (in the gradient center color) and a fixed height bottom gradient.

The bottom gradient widget is returned as a reference for other background pixmaps.

void YQWizard::addMenu const QString &  text,
const QString &  id
 

Add a menu to the menu bar. If the menu bar is not visible yet, it will be made visible. 'text' is the user-visible text for the menu bar (including keyboard shortcuts marked with '&'), 'id' is the menu ID for later addMenuEntry() etc. calls.

void YQWizard::addMenuEntry const QString &  parentMenuID,
const QString &  text,
const QString &  id
 

Add a menu entry to the menu with ID 'parentMenuID'. 'id' is what will be returned by UI::UserInput() etc. when a user activates this menu entry.

void YQWizard::addMenuSeparator const QString &  parentMenuID  ) 
 

Add a menu separator to a menu.

void YQWizard::addStep const QString &  text,
const QString &  id
 

Add a step for the steps panel on the side bar. This only adds the step to the internal list of steps. The display is only updated upon calling updateSteps().

void YQWizard::addStepHeading const QString &  text  ) 
 

Add a step heading for the steps panel on the side bar. This only adds the heading to the internal list of steps. The display is only updated upon calling updateSteps().

void YQWizard::addSubMenu const QString &  parentMenuID,
const QString &  text,
const QString &  id
 

Add a submenu to the menu with ID 'parentMenuID'.

void YQWizard::addTreeItem const QString &  parentID,
const QString &  text,
const QString &  id
 

Add a tree item. If "parentID" is an empty string, it will be a root item. 'text' is the text that will be displayed in the tree, 'id' the ID with which this newly created item can be referenced - and that will be returned when the user clicks on a tree item.

YCPValue YQWizard::anyArg const YCPTerm term,
int  argNo
[protected]
 

Return argument as type 'any' (plain YCPValue)

YQWizardButton* YQWizard::backButton  )  const [inline]
 

Returns the wizard's "Back" button.

void YQWizard::backClicked  )  [protected, slot]
 

Internal notification that the "Back" button has been clicked.

bool YQWizard::boolArg const YCPTerm term,
int  argNo
[protected]
 

Return argument number 'argNo' from 'term' as bool.

QPixmap YQWizard::bottomCropPixmap const QPixmap &  pixmap,
int  croppedHeight
[static, slot]
 

Bottom-crop a pixmap: Return a pixmap with the bottom 'croppedHeight' pixels.

YCPValue YQWizard::command const YCPTerm command  )  [virtual]
 

Generic direct access to implementation-specific functions. See YQWizard.cc for details.

Returns 'true' on success, 'false' on failure. Reimplemented from YWizard.

Reimplemented from YWizard.

YCPString YQWizard::currentTreeSelection  )  [protected, virtual]
 

Returns the current tree selection or an empty string if nothing is selected or there is no tree.

Reimplemented from YWizard.

Reimplemented from YWizard.

string YQWizard::debugLabel  )  [virtual]
 

Returns a descriptive label of this dialog instance for debugging.

Reimplemented from YWidget

Reimplemented from YContainerWidget.

void YQWizard::deleteMenus  ) 
 

Delete all menus and hide the menu bar.

void YQWizard::deleteSteps  ) 
 

Delete all steps and step headings from the internal lists. The display is only updated upon calling updateSteps().

void YQWizard::deleteTreeItems  ) 
 

Delete all tree items.

void YQWizard::destroyButtons  )  [protected]
 

Destroy the button box's buttons

Direction YQWizard::direction  )  const [inline]
 

Returns the current direction of wizard operations - going forward or going backward. This can be used to maintain a consistent direction when assigning default buttons to a dialog.

void YQWizard::enableButton YQWizardButton button,
bool  enabled
[protected]
 

Enable or disable a button.

bool YQWizard::eventFilter QObject *  obj,
QEvent *  ev
 

Event filter - inherited from QWidget

YQWizard::Step * YQWizard::findStep const QString &  id  )  [protected]
 

Find a step with the specified ID. Returns 0 if there is no such step.

YQWizard::TreeItem * YQWizard::findTreeItem const QString &  id  )  [protected]
 

Find a tree item with the specified ID. Tree items without IDs cannot be found at all. Returns the item or 0 if no such item found.

void YQWizard::hideReleaseNotesButton  )  [protected]
 

Hide an existing "Release Notes" button.

bool YQWizard::highColorDisplay  )  const [protected]
 

Returns 'true' if the application is running on a high-color display, i.e., on an X visual with more than 8 bit depth.

bool YQWizard::isCommand QString  declaration,
const YCPTerm term
[protected]
 

Check if 'term' matches wizard command 'declaration'. 'declaration' is a function prototype like this:

myFunction ( string, boolean, string )

Void functions are declared without any parameters:

myFunction ()

Function names must be unique. They cannot be overloaded.

void YQWizard::layoutButtonBox QWidget *  parent  )  [protected]
 

void YQWizard::layoutClientArea QWidget *  parent  )  [protected]
 

void YQWizard::layoutHelpPanel  )  [protected]
 

void YQWizard::layoutSideBar QWidget *  parent  )  [protected]
 

void YQWizard::layoutSideBarButtonBox QWidget *  parent,
QPushButton *  button
[protected]
 

void YQWizard::layoutStepsPanel  )  [protected]
 

void YQWizard::layoutTitleBar QWidget *  parent  )  [protected]
 

void YQWizard::layoutTreePanel  )  [protected]
 

void YQWizard::layoutWorkArea QHBox *  parentHBox  )  [protected]
 

void YQWizard::loadGradientPixmaps  )  [protected]
 

Load gradient pixmaps

void YQWizard::loadStepsIcons  )  [protected]
 

Load step status icons

YQWizardButton* YQWizard::nextButton  )  const [inline]
 

Returns the wizard's "Next" (or "Accept") button.

void YQWizard::nextClicked  )  [protected, slot]
 

Internal notification that the "Next" button has been clicked.

long YQWizard::nicesize YUIDimension  dim  )  [virtual]
 

Minimum size the widget should have to make it look and feel nice. Dimension, either YD_HORIZ or YD_VERT

Reimplemented from YContainerWidget.

QColor YQWizard::pixelColor const QPixmap &  pixmap,
int  x,
int  y
[static, slot]
 

Return the color of pixel( x, y ) of a pixmap. This is a _very_ expensive operation!

QString YQWizard::qStringArg const YCPTerm term,
int  argNo
[protected]
 

Return argument number 'argNo' from 'term' as QString.

void YQWizard::releaseNotesClicked  )  [protected, slot]
 

Propagate button clicked event of release notes button to the YCP application.

void YQWizard::resizeClientArea  )  [slot]
 

Adapt the size of the client area (the ReplacePoint(`id(`contents)) to fit in its current space.

void YQWizard::retranslateInternalButtons  )  [protected, slot]
 

Retranslate internal buttons that are not accessible from the outside:

  • [Help]
  • [Steps]
  • [Tree]

bool YQWizard::runningEmbedded  )  const [inline, protected]
 

Check if we are running embedded as a KCMShell or KPart or something similar. This is really just a (chached) shortcut to YQUI::runningEmbedded().

void YQWizard::selectTreeItem const QString &  id  ) 
 

Select the tree item with the specified ID, if such an item exists.

void YQWizard::sendEvent YCPValue  id  )  [protected]
 

Send a wizard event with the specified ID.

void YQWizard::sendMenuEvent int  numID  )  [protected, slot]
 

Internal notification that a menu item with numeric ID 'numID' has been activated.

void YQWizard::sendTreeEvent QListViewItem *  item  )  [protected, slot]
 

Internal notification that [Space] or [Return] has been pressed on a tree item. If the item has an ID, that ID will be returned to UI::UserInput().

void YQWizard::setBottomCroppedGradient QWidget *  widget,
const QPixmap &  pixmap,
int  croppedHeight
[static, slot]
 

Set a widget's background to the lower portion (the bottom 'croppedHeight' pixels) of a pixmap and set the widget's height (fixed) to that 'croppedHeight'.

void YQWizard::setButtonFocus YQWizardButton button  )  [protected]
 

Set the keyboard focus to a button.

void YQWizard::setButtonID YQWizardButton button,
const YCPValue id
[protected]
 

Set a button's ID.

void YQWizard::setButtonLabel YQWizardButton button,
const QString &  newLabel
[protected]
 

Set a button's label.

void YQWizard::setCurrentStep const QString &  id  ) 
 

Set the current step. This also triggers updateSteps() if necessary.

void YQWizard::setDialogHeading const QString &  headingText  ) 
 

Set a dialog heading. 0 is a valid value - it clears the old text.

void YQWizard::setDialogIcon const char *  iconName  ) 
 

Set a dialog icon. 0 is a valid value - it clears the current icon.

void YQWizard::setGradient QWidget *  widget,
const QPixmap &  pixmap
[static, slot]
 

Set a widget's background pixmap to a gradient pixmap and set the widget's height (fixed) to that pixmap's height.

void YQWizard::setHelpText QString  helpText  )  [slot]
 

Set the help text. 0 is a valid value - it clears the old text.

void YQWizard::setSize long  newWidth,
long  newHeight
[virtual]
 

Sets the new size of the widget.

Reimplemented from YContainerWidget.

void YQWizard::setStepStatus YQWizard::Step step,
const QPixmap &  icon,
const QColor &  color
[protected]
 

Set text color and status icon for one wizard step

void YQWizard::setVerboseCommands bool  verbose  )  [inline]
 

Set wizard command verbosity

void YQWizard::showHelp  )  [slot]
 

Show the current help text.

This is useful only if it is obscured by any wizard steps, but it can safely be called at any time.

void YQWizard::showReleaseNotesButton string  label,
const YCPValue id
[protected]
 

Show a "Release Notes" button above the "Help" button in the steps panel with the specified label that will return the specified id to UI::UserInput() when clicked.

void YQWizard::showSteps  )  [slot]
 

Show the current wizard steps, if there are any. If there are none, nothing happens.

void YQWizard::showTree  )  [slot]
 

Show the current selection tree in the side panel, if there is any. If there is none, nothing happens.

bool YQWizard::stepsEnabled  )  const [inline]
 

Returns 'true' if this wizard was created with steps enabled, i.e. the side bar has a "steps" view.

string YQWizard::stringArg const YCPTerm term,
int  argNo
[protected]
 

Return argument number 'argNo' from 'term' as std::string.

bool YQWizard::treeEnabled  )  const [inline]
 

Returns 'true' if this wizard was created with a selection tree enabled, i.e. the side bar has a tree selection.

void YQWizard::treeSelectionChanged  )  [protected, slot]
 

Internal notification that the tree selection has changed.

If the currently selected item has an ID, that ID will be returned to UI::UserInput().

void YQWizard::updateSteps  ) 
 

Update the steps display: Reflect the internal steps and heading lists in the layout.

void YQWizard::updateStepStates  )  [protected]
 

Update all step - use appropriate icons and colors


Member Data Documentation

YQWizardButton* YQWizard::_abortButton [protected]
 

YQWizardButton* YQWizard::_backButton [protected]
 

QSpacerItem* YQWizard::_backButtonSpacer [protected]
 

QPixmap YQWizard::_bottomGradientPixmap [protected]
 

QVBox* YQWizard::_clientArea [protected]
 

YQAlignment* YQWizard::_contents [protected]
 

QString YQWizard::_currentStepID [protected]
 

QLabel* YQWizard::_dialogHeading [protected]
 

QLabel* YQWizard::_dialogIcon [protected]
 

Direction YQWizard::_direction [protected]
 

QColor YQWizard::_gradientCenterColor [protected]
 

QTextBrowser* YQWizard::_helpBrowser [protected]
 

QPushButton* YQWizard::_helpButton [protected]
 

QHBox* YQWizard::_helpPanel [protected]
 

QMenuBar* YQWizard::_menuBar [protected]
 

QWidget* YQWizard::_menuBarBox [protected]
 

vector<QString> YQWizard::_menuEntryIDs [protected]
 

QDict<QPopupMenu> YQWizard::_menuIDs [protected]
 

YQWizardButton* YQWizard::_nextButton [protected]
 

bool YQWizard::_protectNextButton [protected]
 

QPushButton* YQWizard::_releaseNotesButton [protected]
 

YCPValue YQWizard::_releaseNotesButtonId [protected]
 

bool YQWizard::_runningEmbedded [protected]
 

QWidgetStack* YQWizard::_sideBar [protected]
 

QColor YQWizard::_stepCurrentColor [protected]
 

QPixmap YQWizard::_stepCurrentIcon [protected]
 

QColor YQWizard::_stepDoneColor [protected]
 

QPixmap YQWizard::_stepDoneIcon [protected]
 

QVBox* YQWizard::_stepsBox [protected]
 

QPushButton* YQWizard::_stepsButton [protected]
 

bool YQWizard::_stepsDirty [protected]
 

bool YQWizard::_stepsEnabled [protected]
 

QGridLayout* YQWizard::_stepsGrid [protected]
 

QDict<YQWizard::Step> YQWizard::_stepsIDs [protected]
 

QPtrList<YQWizard::Step> YQWizard::_stepsList [protected]
 

QVBox* YQWizard::_stepsPanel [protected]
 

QColor YQWizard::_stepToDoColor [protected]
 

QPixmap YQWizard::_stepToDoIcon [protected]
 

QPixmap YQWizard::_titleBarGradientPixmap [protected]
 

QPixmap YQWizard::_topGradientPixmap [protected]
 

QY2ListView* YQWizard::_tree [protected]
 

QPushButton* YQWizard::_treeButton [protected]
 

bool YQWizard::_treeEnabled [protected]
 

QDict<YQWizard::TreeItem> YQWizard::_treeIDs [protected]
 

QHBox* YQWizard::_treePanel [protected]
 

bool YQWizard::_verboseCommands [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Sep 14 10:59:04 2005 for yast2-qt by  doxygen 1.4.4