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

#include <SUIT_ResourceMgr.h>

Inheritance diagram for SUIT_ResourceMgr:
Inheritance graph

Public Member Functions

 SUIT_ResourceMgr (const QString &, const QString &=QString())
 
virtual ~SUIT_ResourceMgr ()
 
virtual QString version () const
 
void setVersion (const QString &)
 
QString loadDoc (const QString &, const QString &) const
 
- Public Member Functions inherited from QtxResourceMgr
 QtxResourceMgr (const QString &, const QString &=QString())
 Constructs the resource manager. More...
 
virtual ~QtxResourceMgr ()
 Destructor. More...
 
QString appName () const
 Get the application name. More...
 
QStringList dirList () const
 Get the resource directories list. More...
 
bool checkExisting () const
 Get the "check existance" flag. More...
 
virtual void setCheckExisting (const bool)
 Set the "check existance" flag. More...
 
bool isPixmapCached () const
 Get "cached pixmaps" option value. More...
 
void setIsPixmapCached (const bool)
 Switch "cached pixmaps" option on/off. More...
 
void clear ()
 Remove all resources from the resources manager. More...
 
WorkingMode workingMode () const
 Get current working mode. More...
 
WorkingMode setWorkingMode (WorkingMode)
 Set resource manager's working mode. More...
 
bool value (const QString &, const QString &, int &) const
 Get interger parameter value. More...
 
bool value (const QString &, const QString &, double &) const
 Get double parameter value. More...
 
bool value (const QString &, const QString &, bool &) const
 Get boolean parameter value. More...
 
bool value (const QString &, const QString &, QColor &) const
 Get color parameter value. More...
 
bool value (const QString &, const QString &, QFont &) const
 Get font parameter value. More...
 
bool value (const QString &, const QString &, QByteArray &) const
 Get byte array parameter value. More...
 
bool value (const QString &, const QString &, QLinearGradient &) const
 Get linear gradient parameter value. More...
 
bool value (const QString &, const QString &, QRadialGradient &) const
 Get radial gradient parameter value. More...
 
bool value (const QString &, const QString &, QConicalGradient &) const
 Get conical gradient parameter value. More...
 
bool value (const QString &, const QString &, Qtx::BackgroundData &) const
 Get background parameter value. More...
 
bool value (const QString &, const QString &, QString &, const bool=true) const
 Get string parameter value (native format). More...
 
int integerValue (const QString &, const QString &, const int=0) const
 Get interger parameter value. More...
 
double doubleValue (const QString &, const QString &, const double=0) const
 Get double parameter value. More...
 
bool booleanValue (const QString &, const QString &, const bool=false) const
 Get boolean parameter value. More...
 
QFont fontValue (const QString &, const QString &, const QFont &=QFont()) const
 Get font parameter value. More...
 
QColor colorValue (const QString &, const QString &, const QColor &=QColor()) const
 Get color parameter value. More...
 
QString stringValue (const QString &, const QString &, const QString &=QString(), const bool=true) const
 Get string parameter value. More...
 
QByteArray byteArrayValue (const QString &, const QString &, const QByteArray &=QByteArray()) const
 Get byte array parameter value. More...
 
QLinearGradient linearGradientValue (const QString &, const QString &, const QLinearGradient &=QLinearGradient()) const
 Get linear gradient parameter value. More...
 
QRadialGradient radialGradientValue (const QString &, const QString &, const QRadialGradient &=QRadialGradient()) const
 Get radial gradient parameter value. More...
 
QConicalGradient conicalGradientValue (const QString &, const QString &, const QConicalGradient &=QConicalGradient()) const
 Get conical gradient parameter value. More...
 
Qtx::BackgroundData backgroundValue (const QString &, const QString &, const Qtx::BackgroundData &=Qtx::BackgroundData()) const
 Get background parameter value. More...
 
bool hasSection (const QString &) const
 Check section existence. More...
 
bool hasValue (const QString &, const QString &) const
 Check parameter existence. More...
 
void setValue (const QString &, const QString &, const int)
 Set integer parameter value. More...
 
void setValue (const QString &, const QString &, const double)
 Set double parameter value. More...
 
void setValue (const QString &, const QString &, const bool)
 Set boolean parameter value. More...
 
void setValue (const QString &, const QString &, const QFont &)
 Set font parameter value. More...
 
void setValue (const QString &, const QString &, const QColor &)
 Set color parameter value. More...
 
void setValue (const QString &, const QString &, const QString &)
 Set string parameter value. More...
 
void setValue (const QString &, const QString &, const QByteArray &)
 Set byte array parameter value. More...
 
void setValue (const QString &, const QString &, const QLinearGradient &)
 Set linear gradient parameter value. More...
 
void setValue (const QString &, const QString &, const QRadialGradient &)
 Set radial gradient parameter value. More...
 
void setValue (const QString &, const QString &, const QConicalGradient &)
 Set conical gradient parameter value. More...
 
void setValue (const QString &, const QString &, const Qtx::BackgroundData &)
 Set background parameter value. More...
 
void remove (const QString &)
 Remove resources section. More...
 
void remove (const QString &, const QString &)
 Remove the specified parameter. More...
 
QString currentFormat () const
 Get current configuration files format. More...
 
void setCurrentFormat (const QString &)
 Set current configuration files format. More...
 
Formatformat (const QString &) const
 Get configuration files format by specified format name. More...
 
void installFormat (Format *)
 Install configuration files format. More...
 
void removeFormat (Format *)
 Remove configuration files format. More...
 
QStringList options () const
 Get resource format options names. More...
 
QString option (const QString &) const
 Get the string value of the specified resources format option. More...
 
void setOption (const QString &, const QString &)
 Set the string value of the specified resources format option. More...
 
QStringList constants () const
 Get names of all known constants. More...
 
QString constant (const QString &) const
 Get the value of the known constant. More...
 
void setConstant (const QString &, const QString &)
 Set the value of the constant. More...
 
QPixmap defaultPixmap () const
 Get default pixmap. More...
 
virtual void setDefaultPixmap (const QPixmap &)
 Set default pixmap. More...
 
QString resSection () const
 Get application resources section name. More...
 
QString langSection () const
 Get application language section name. More...
 
QString sectionsToken () const
 Get sections separator token. More...
 
QPixmap loadPixmap (const QString &, const QString &) const
 Load pixmap resource. More...
 
QPixmap loadPixmap (const QString &, const QString &, const bool) const
 Load pixmap resource.This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
QPixmap loadPixmap (const QString &, const QString &, const QPixmap &) const
 Load pixmap resource.This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void loadLanguage (const QString &=QString(), const QString &=QString())
 Load translation files according to the specified language. More...
 
void raiseTranslators (const QString &)
 Move all translators corresponding to the specified translation context to the top of translators stack (increase their priority). More...
 
void removeTranslators (const QString &)
 Remove all translators corresponding to the specified translation context. More...
 
void loadTranslator (const QString &, const QString &)
 Load translation file. More...
 
void loadTranslators (const QString &, const QStringList &)
 Load translation files for the specified translation context. More...
 
void addTranslator (const QString &, QTranslator *)
 Add custom translator. More...
 
QString path (const QString &, const QString &, const QString &) const
 Get absolute path to the file which name is defined by the parameter. More...
 
bool load ()
 Load all resources from all resource files (global and user). More...
 
bool import (const QString &)
 Import resources from specified resource file. More...
 
bool save ()
 Save all resources to the user resource files. More...
 
QStringList sections () const
 Get all sections names. More...
 
QStringList sections (const QRegExp &) const
 Get all sections names matching specified regular expression. More...
 
QStringList sections (const QStringList &) const
 Get all sections names with the prefix specified by passed list of parent sections names. More...
 
QStringList subSections (const QString &, const bool=true) const
 Get list of sub-sections names for the specified parent section name. More...
 
QStringList parameters (const QString &) const
 Get all parameters name in specified section. More...
 
QStringList parameters (const QStringList &) const
 Get all parameters name in specified list of sub-sections names. More...
 
void refresh ()
 Copy all parameters to the user resources in order to saved them lately in the user home folder. More...
 

Protected Member Functions

virtual QString userFileName (const QString &, const bool=true) const
 
virtual QString findAppropriateUserFile (const QString &) const
 
virtual long userFileId (const QString &) const
 
virtual QString defaultLanguage () const
 Specify default language for the application. More...
 
- Protected Member Functions inherited from QtxResourceMgr
virtual void setDirList (const QStringList &)
 Set the resource directories (where global confguration files are searched). More...
 
virtual void setResource (const QString &, const QString &, const QString &)
 Set parameter value. More...
 
virtual QString globalFileName (const QString &) const
 Get global configuration file name. More...
 
virtual void saved ()
 This function is called after user configuration file is saved. Can be redefined in the successor classes, default implementation does nothing. More...
 

Private Attributes

QString myVersion
 

Additional Inherited Members

- Public Types inherited from QtxResourceMgr
enum  WorkingMode { AllowUserValues, IgnoreUserValues }
 Working mode; defines a way how resource manager handles user preferences. More...
 
typedef IMap< QString, QString > Section
 resource section More...
 

Constructor & Destructor Documentation

SUIT_ResourceMgr::SUIT_ResourceMgr ( const QString &  app,
const QString &  resVarTemplate = QString() 
)

Constructor

SUIT_ResourceMgr::~SUIT_ResourceMgr ( )
virtual

Destructor

Member Function Documentation

QString SUIT_ResourceMgr::defaultLanguage ( ) const
protectedvirtual

Reimplemented from QtxResourceMgr.

References SUIT_Session::arguments(), rx, and SUIT_Session::session().

QString SUIT_ResourceMgr::findAppropriateUserFile ( const QString &  fname) const
protectedvirtual

Finds other the most appropriate user file instead missing one

References userFileId().

QString SUIT_ResourceMgr::loadDoc ( const QString &  prefix,
const QString &  id 
) const

Loads a doc page from 'prefix' resources and indetified by 'id'

References QtxResourceMgr::option(), and QtxResourceMgr::path().

void SUIT_ResourceMgr::setVersion ( const QString &  ver)

Sets the version of application

References myVersion.

long SUIT_ResourceMgr::userFileId ( const QString &  ) const
protectedvirtual

Calculates integer extended version number by user file name for comparing

Reimplemented in SALOME_ResourceMgr.

QString SUIT_ResourceMgr::userFileName ( const QString &  appName,
const bool  for_load = true 
) const
protectedvirtual

Returns the user file name for specified application

Reimplemented from QtxResourceMgr.

Reimplemented in SALOME_ResourceMgr.

References SUIT_Session::arguments(), findAppropriateUserFile(), rx, SUIT_Session::session(), QtxResourceMgr::userFileName(), and version().

QString SUIT_ResourceMgr::version ( ) const
virtual

Returns the version of application

Reimplemented in SALOME_ResourceMgr.

References myVersion.

Member Data Documentation

QString SUIT_ResourceMgr::myVersion
private

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