Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes
icl::qt::GUI Class Reference

Main Class of ICL's GUI creation framework. More...

#include <GUI.h>

Inheritance diagram for icl::qt::GUI:
icl::qt::ChromaGUI icl::qt::ContainerGUIComponent icl::qt::Border icl::qt::HBox icl::qt::HScroll icl::qt::HSplit icl::qt::Tab icl::qt::VBox icl::qt::VScroll icl::qt::VSplit

List of all members.

Public Types

typedef utils::Function
< GUIWidget *, const
GUIDefinition & > 
CreatorFunction
 registered widget type creator function
typedef utils::Function< void > Callback
 simple callback, that can be registered at GUI components
typedef utils::Function< void,
const std::string & > 
ComplexCallback
 complex callback type that can be registered at GUI components

Public Member Functions

 GUI (QWidget *parent=0)
 Default constructor, creates a vbox GUI Component.
 GUI (const GUIComponent &component, QWidget *parent=0)
 creates a GUI from a givne GUIComponent
 GUI (const GUI &gui, QWidget *parent=0)
 copy constructor
GUIoperator= (const GUI &other)
 gui-copy operator
virtual ~GUI ()
 Destructor.
virtual GUIoperator<< (const GUIComponent &component)
 adds a new GUI component
virtual GUIoperator<< (const GUI &g)
 stream operator to add new other GUIs
template<class T >
T & allocValue (const std::string &id, const T &val=T())
 wraps the data-stores allocValue function
template<class T >
void release (const std::string &id)
 wraps the datastores release function
template<class T >
T & get (const std::string &id, bool typeCheck=true)
DataStore::Data operator[] (const std::string &key)
 returns a Data instance from the datastore
template<class T >
std::vector< T > collect (const std::vector< std::string > &keys)
 collects data from different components at once
virtual bool isVisible () const
 returns whether this gui is actually visible
virtual void create ()
 internally creates everything
virtual void show ()
 internally creates everything (and makes the gui visible)
virtual void hide ()
 make this gui invisible (nothing more)
virtual void switchVisibility ()
 if widget is visible, this hides the widget, otherwise the widget is shown
GUIWidgetgetRootWidget ()
 returns the root widget of the gui (only avialable after create() or show())
void lockData ()
 internally locks the datastore
void unlockData ()
 internally unlocks the data store
void waitForCreation ()
 waits for the gui to be created completely
const DataStoregetDataStore () const
 returns the GUI internal dataStore
void registerCallback (const Callback &cb, const std::string &handleNamesList, char listDelim=',')
 registers a callback function on each component
void registerCallback (const ComplexCallback &cb, const std::string &handleNamesList, char listDelim=',')
 registeres a complex callback at a given GUI component
void removeCallbacks (const std::string &handleNamesList, char listDelim=',')
 removes all callbacks from components
bool isDummy () const
 returns whether this GUI is a dummy GUI
bool hasBeenCreated () const
 returns whether this GUI has been created or not

Static Public Member Functions

static void register_widget_type (const std::string &tag, CreatorFunction f)
 registers a new widget type

Static Public Attributes

static const int CELLW = 20
 cell width (all sizes are given in this unit)
static const int CELLH = 20
 cell height (all sizes are given in this unit)

Protected Member Functions

 GUI (const std::string &definition, QWidget *parent)
 default constructor
virtual std::string createDefinition () const
 can be overwritten in subclasses (such as ContainerGUIComponent)

Private Member Functions

virtual GUIoperator<< (const std::string &definition)
 stream operator to add new widgets
void create (QLayout *parentLayout, ProxyLayout *proxy, QWidget *parentWidget, DataStore *ds)

Private Attributes

std::string m_sDefinition
 own definition string
std::vector< GUI * > m_children
GUIWidgetm_poWidget
DataStore m_oDataStore
bool m_bCreated
QWidget * m_poParent

Detailed Description

Main Class of ICL's GUI creation framework.

Please refer to the ICL manual for details


Member Typedef Documentation

simple callback, that can be registered at GUI components

Simple callback methods don't get any information about the source

typedef utils::Function<void,const std::string&> icl::qt::GUI::ComplexCallback

complex callback type that can be registered at GUI components

Complex callback methods get the GUI components handle name as parameters. By these means, single callbacks can be registered to several components and still be able to handle events differently

registered widget type creator function


Constructor & Destructor Documentation

icl::qt::GUI::GUI ( const std::string &  definition,
QWidget *  parent 
) [protected]

default constructor

icl::qt::GUI::GUI ( QWidget *  parent = 0)

Default constructor, creates a vbox GUI Component.

icl::qt::GUI::GUI ( const GUIComponent component,
QWidget *  parent = 0 
)

creates a GUI from a givne GUIComponent

icl::qt::GUI::GUI ( const GUI gui,
QWidget *  parent = 0 
)

copy constructor

virtual icl::qt::GUI::~GUI ( ) [virtual]

Destructor.


Member Function Documentation

template<class T >
T& icl::qt::GUI::allocValue ( const std::string &  id,
const T &  val = T() 
) [inline]

wraps the data-stores allocValue function

template<class T >
std::vector<T> icl::qt::GUI::collect ( const std::vector< std::string > &  keys) [inline]

collects data from different components at once

virtual void icl::qt::GUI::create ( ) [virtual]

internally creates everything

void icl::qt::GUI::create ( QLayout *  parentLayout,
ProxyLayout proxy,
QWidget *  parentWidget,
DataStore ds 
) [private]
virtual std::string icl::qt::GUI::createDefinition ( ) const [inline, protected, virtual]

can be overwritten in subclasses (such as ContainerGUIComponent)

Reimplemented in icl::qt::ContainerGUIComponent.

template<class T >
T& icl::qt::GUI::get ( const std::string &  id,
bool  typeCheck = true 
) [inline]
const DataStore& icl::qt::GUI::getDataStore ( ) const [inline]

returns the GUI internal dataStore

returns the root widget of the gui (only avialable after create() or show())

returns whether this GUI has been created or not

virtual void icl::qt::GUI::hide ( ) [virtual]

make this gui invisible (nothing more)

bool icl::qt::GUI::isDummy ( ) const [inline]

returns whether this GUI is a dummy GUI

Please note: dummy GUIs cannot be created are not added by the stream operator

virtual bool icl::qt::GUI::isVisible ( ) const [virtual]

returns whether this gui is actually visible

void icl::qt::GUI::lockData ( ) [inline]

internally locks the datastore

virtual GUI& icl::qt::GUI::operator<< ( const std::string &  definition) [private, virtual]

stream operator to add new widgets

if the given definition is "" or "dummy", this operator does nothing

virtual GUI& icl::qt::GUI::operator<< ( const GUIComponent component) [virtual]

adds a new GUI component

virtual GUI& icl::qt::GUI::operator<< ( const GUI g) [virtual]

stream operator to add new other GUIs

if the given GUI is a dummy GUI, this operator does nothing

GUI& icl::qt::GUI::operator= ( const GUI other)

gui-copy operator

DataStore::Data icl::qt::GUI::operator[] ( const std::string &  key) [inline]

returns a Data instance from the datastore

static void icl::qt::GUI::register_widget_type ( const std::string &  tag,
CreatorFunction  f 
) [static]

registers a new widget type

The registered widget can then be added using a corresponding extension of the GUIComponent class

void icl::qt::GUI::registerCallback ( const Callback cb,
const std::string &  handleNamesList,
char  listDelim = ',' 
)

registers a callback function on each component

Parameters:
cbcallback to execute
handleNamesList'listDelim'-separated list of handle names
listDelimdelimiter for the handle list ownership is passed to the childrens; deletion is performed by the smart pointers that are used...
void icl::qt::GUI::registerCallback ( const ComplexCallback cb,
const std::string &  handleNamesList,
char  listDelim = ',' 
)

registeres a complex callback at a given GUI component

complex callbacks are called with the actual GUI components handle name as parameter

template<class T >
void icl::qt::GUI::release ( const std::string &  id) [inline]

wraps the datastores release function

void icl::qt::GUI::removeCallbacks ( const std::string &  handleNamesList,
char  listDelim = ',' 
)

removes all callbacks from components

virtual void icl::qt::GUI::show ( ) [virtual]

internally creates everything (and makes the gui visible)

virtual void icl::qt::GUI::switchVisibility ( ) [virtual]

if widget is visible, this hides the widget, otherwise the widget is shown

void icl::qt::GUI::unlockData ( ) [inline]

internally unlocks the data store

waits for the gui to be created completely


Member Data Documentation

const int icl::qt::GUI::CELLH = 20 [static]

cell height (all sizes are given in this unit)

const int icl::qt::GUI::CELLW = 20 [static]

cell width (all sizes are given in this unit)

bool icl::qt::GUI::m_bCreated [private]
std::vector<GUI*> icl::qt::GUI::m_children [private]
QWidget* icl::qt::GUI::m_poParent [private]
std::string icl::qt::GUI::m_sDefinition [private]

own definition string


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines