Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QtxPreferenceMgr Class Reference

Class for managing preferences items.

#include <QtxPreferenceMgr.h>

Inheritance diagram for QtxPreferenceMgr:
Inheritance graph

Public Member Functions

 QtxPreferenceMgr (QtxResourceMgr *)
 Constructor. More...
 
virtual ~QtxPreferenceMgr ()
 Destructor. More...
 
virtual QtxResourceMgrresourceMgr () const
 Get the resources manager. More...
 
virtual QtxPreferenceMgrpreferenceMgr () const
 Get the parent preferences manager. More...
 
QVariant option (const int, const QString &) const
 Get preference item option value. More...
 
void setOption (const int, const QString &, const QVariant &)
 Set preference item option value. More...
 
virtual void store ()
 Store all preferences item to the resource manager. More...
 
virtual void retrieve ()
 Retrieve all preference items from the resource manager. More...
 
virtual void update ()
 Update preferences manager. More...
 
virtual void toBackup ()
 Dumps all values to the backup container. More...
 
virtual void fromBackup ()
 Restore all values from the backup container. More...
 
- Public Member Functions inherited from QtxPreferenceItem
 QtxPreferenceItem (QtxPreferenceItem *=0)
 Constructor. More...
 
 QtxPreferenceItem (const QString &, QtxPreferenceItem *)
 Constructor. More...
 
 QtxPreferenceItem (const QString &, const QString &, const QString &, QtxPreferenceItem *)
 Constructor. More...
 
virtual ~QtxPreferenceItem ()
 Destructor. More...
 
int id () const
 Get unique item identifier. More...
 
virtual int rtti () const
 Get unique item type identifier. More...
 
QtxPreferenceItemrootItem () const
 Get root preference item. More...
 
QtxPreferenceItemparentItem () const
 Get parent preference item. More...
 
QList< QtxPreferenceItem * > childItems (const bool=false) const
 Get all child preference items. More...
 
int depth () const
 Get preference item depth. More...
 
int count () const
 Get child preference items number. More...
 
virtual bool isEmpty () const
 Check if the item has children. More...
 
void appendItem (QtxPreferenceItem *)
 Append child preference item. More...
 
void removeItem (QtxPreferenceItem *)
 Remove child preference item. More...
 
void insertItem (QtxPreferenceItem *, QtxPreferenceItem *=0)
 Insert child preference item before specified item. If the before item is 0 then new item is appended. More...
 
QIcon icon () const
 Get preference item icon. More...
 
QString title () const
 Get preference item title. More...
 
void resource (QString &, QString &) const
 Get resource file settings associated to the preference item. More...
 
virtual void setIcon (const QIcon &)
 Set prefence item icon. More...
 
virtual void setTitle (const QString &)
 Set preference item title . More...
 
virtual void setResource (const QString &, const QString &)
 Assign resource file settings to the preference item. More...
 
virtual void updateContents ()
 Update preference item. More...
 
QVariant option (const QString &) const
 Get preference item option value. More...
 
void setOption (const QString &, const QVariant &)
 Set preference item option value. More...
 
bool isEvaluateValues () const
 Get variables auto-conversion option value. More...
 
void setEvaluateValues (const bool)
 Switch variables auto-conversion option on/off. More...
 
bool isRestartRequired () const
 Get restart needed option value. More...
 
void setRestartRequired (const bool)
 Switch restart needed option on/off. More...
 
QString resourceValue () const
 Get the value of the associated resource file setting. More...
 
void setResourceValue (const QString &)
 Get the value of the associated resource file setting. More...
 
QtxPreferenceItemfindItem (const int, const bool=false) const
 Find the item by the specified identifier. More...
 
QtxPreferenceItemfindItem (const QString &, const bool=false) const
 Find the item by the specified title. More...
 
QtxPreferenceItemfindItem (const QString &, const int, const bool=false) const
 Find the item by the specified title and identifier. More...
 
virtual void activate ()
 
void ensureVisible ()
 

Protected Types

typedef QMap
< QtxPreferenceItem *, QString > 
ResourceMap
 
- Protected Types inherited from QtxPreferenceItem
typedef QList
< QtxPreferenceItem * > 
ItemList
 

Protected Member Functions

void resourceValues (QMap< int, QString > &) const
 Get all resources items values. More...
 
void resourceValues (ResourceMap &) const
 Get all resources items values. More...
 
void setResourceValues (QMap< int, QString > &) const
 Set all resources items values. More...
 
void setResourceValues (ResourceMap &) const
 Set all resources items values. More...
 
void differentValues (const QMap< int, QString > &, const QMap< int, QString > &, QMap< int, QString > &, const bool fromFirst=false) const
 Compare two maps of resources values to find differences. More...
 
void differentValues (const ResourceMap &, const ResourceMap &, ResourceMap &, const bool fromFirst=false) const
 Compare two maps of resources values to find differences. More...
 
virtual void changedResources (const ResourceMap &)
 Perform custom activity on resource changing. More...
 
- Protected Member Functions inherited from QtxPreferenceItem
int getInteger (const int=0) const
 Get integer resources value corresponding to the item. More...
 
double getDouble (const double=0.0) const
 Get double resources value corresponding to the item. More...
 
bool getBoolean (const bool=false) const
 Get boolean resources value corresponding to the item. More...
 
QColor getColor (const QColor &=QColor()) const
 Get color resources value corresponding to the item. More...
 
QFont getFont (const QFont &=QFont()) const
 Get font resources value corresponding to the item. More...
 
QString getString (const QString &=QString()) const
 Get string resources value corresponding to the item. More...
 
void setInteger (const int)
 Set integer resources value corresponding to the item. More...
 
void setDouble (const double)
 Set double resources value corresponding to the item. More...
 
void setBoolean (const bool)
 Set boolean resources value corresponding to the item. More...
 
void setColor (const QColor &)
 Set color resources value corresponding to the item. More...
 
void setFont (const QFont &)
 Set font resources value corresponding to the item. More...
 
void setString (const QString &)
 Set string resources value corresponding to the item. More...
 
virtual void itemAdded (QtxPreferenceItem *)
 Callback function which is called when the child preference item is added. More...
 
virtual void itemRemoved (QtxPreferenceItem *)
 Callback function which is called when the child preference item is removed. More...
 
virtual void itemChanged (QtxPreferenceItem *)
 Callback function which is called when the child preference item is modified. More...
 
virtual void ensureVisible (QtxPreferenceItem *)
 
void sendItemChanges ()
 Initiate item changing call back operation. More...
 
virtual void triggerUpdate ()
 Initiate item updating. More...
 
virtual QVariant optionValue (const QString &) const
 Get preference item option value. More...
 
virtual void setOptionValue (const QString &, const QVariant &)
 Set preference item option value. More...
 

Private Attributes

QtxResourceMgrmyResMgr
 
ResourceMap myBackup
 

Additional Inherited Members

- Static Public Member Functions inherited from QtxPreferenceItem
static int RTTI ()
 Specify unique item class identifier. More...
 

Member Typedef Documentation

typedef QMap<QtxPreferenceItem*, QString> QtxPreferenceMgr::ResourceMap
protected

Constructor & Destructor Documentation

QtxPreferenceMgr::QtxPreferenceMgr ( QtxResourceMgr mgr)
Parameters
mgrresources manager
QtxPreferenceMgr::~QtxPreferenceMgr ( )
virtual

Member Function Documentation

void QtxPreferenceMgr::changedResources ( const ResourceMap )
protectedvirtual

This method is called from store() and fromBackup() methods. Base implementation does nothing.

See Also
store(), fromBackup()

Reimplemented in LightApp_Preferences.

void QtxPreferenceMgr::differentValues ( const QMap< int, QString > &  map1,
const QMap< int, QString > &  map2,
QMap< int, QString > &  resMap,
const bool  fromFirst = false 
) const
protected
Parameters
map1first map
map2second map
resMapmap to be filled with different values
fromFirstif true, then resMap will be filled with the values from map1, otherwise - from map2
void QtxPreferenceMgr::differentValues ( const ResourceMap map1,
const ResourceMap map2,
ResourceMap resMap,
const bool  fromFirst = false 
) const
protected
Parameters
map1first map
map2second map
resMapmap to be filled with different values
fromFirstif true, then resMap will be filled with the values from map1, otherwise - from map2
void QtxPreferenceMgr::fromBackup ( )
virtual
QVariant QtxPreferenceMgr::option ( const int  id,
const QString &  propName 
) const
Parameters
idpreference item ID
propNameoption name
Returns
property value or null QVariant if option is not set
See Also
setOption()

References QtxPreferenceItem::findItem(), and QtxPreferenceItem::option().

QtxPreferenceMgr * QtxPreferenceMgr::preferenceMgr ( ) const
virtual
Returns
pointer to itself

Reimplemented from QtxPreferenceItem.

QtxResourceMgr * QtxPreferenceMgr::resourceMgr ( ) const
virtual
Returns
resource manager pointer or 0 if it is not defined

Reimplemented from QtxPreferenceItem.

References myResMgr.

void QtxPreferenceMgr::resourceValues ( QMap< int, QString > &  map) const
protected
void QtxPreferenceMgr::resourceValues ( ResourceMap map) const
protected
Parameters
mapused as container filled with the resources values (:

)

See Also
setResourceValues()

References QtxPreferenceItem::childItems(), QtxResourceMgr::hasValue(), QtxPreferenceItem::resource(), resourceMgr(), and QtxPreferenceItem::resourceValue().

void QtxPreferenceMgr::retrieve ( )
virtual
void QtxPreferenceMgr::setOption ( const int  id,
const QString &  propName,
const QVariant &  propValue 
)
Parameters
idpreference item ID
propNameoption name
propValuenew property value
See Also
option()

References QtxPreferenceItem::findItem(), and QtxPreferenceItem::setOption().

void QtxPreferenceMgr::setResourceValues ( QMap< int, QString > &  map) const
protected
Parameters
mapmap with resources values (<ID>:

)

See Also
resourceValues()

References QtxPreferenceItem::findItem(), and QtxPreferenceItem::setResourceValue().

void QtxPreferenceMgr::setResourceValues ( ResourceMap map) const
protected
Parameters
mapmap with resources values (:

)

See Also
resourceValues()
void QtxPreferenceMgr::store ( )
virtual
void QtxPreferenceMgr::toBackup ( )
virtual
See Also
fromBackup()

References myBackup, and resourceValues().

void QtxPreferenceMgr::update ( )
virtual

Base implementation does nothing.

Member Data Documentation

ResourceMap QtxPreferenceMgr::myBackup
private
QtxResourceMgr* QtxPreferenceMgr::myResMgr
private

The documentation for this class was generated from the following files: