
Public Types | |
| enum | WorkingMode { AllowUserValues, IgnoreUserValues } |
Working mode; defines a way how resource manager handles user preferences. More... | |
| typedef IMap< QString, QString > | Section |
| resource section | |
Public Member Functions | |
| SALOME_ResourceMgr (const QString &app, const QString &resVarTemplate) | |
| QString | version () const |
| void | setVersion (const QString &) |
| QString | loadDoc (const QString &, const QString &) const |
| QString | appName () const |
| Get the application name. | |
| QStringList | dirList () const |
| Get the resource directories list. | |
| bool | checkExisting () const |
| Get the "check existance" flag. | |
| virtual void | setCheckExisting (const bool) |
| Set the "check existance" flag. | |
| bool | isPixmapCached () const |
| Get "cached pixmaps" option value. | |
| void | setIsPixmapCached (const bool) |
| Switch "cached pixmaps" option on/off. | |
| void | clear () |
| Remove all resources from the resources manager. | |
| WorkingMode | workingMode () const |
| Get current working mode. | |
| void | setWorkingMode (WorkingMode) |
| Set resource manager's working mode. | |
| bool | value (const QString &, const QString &, int &) const |
| Get interger parameter value. | |
| bool | value (const QString &, const QString &, double &) const |
| Get double parameter value. | |
| bool | value (const QString &, const QString &, bool &) const |
| Get boolean parameter value. | |
| bool | value (const QString &, const QString &, QColor &) const |
| Get color parameter value. | |
| bool | value (const QString &, const QString &, QFont &) const |
| Get font parameter value. | |
| bool | value (const QString &, const QString &, QByteArray &) const |
| Get byte array parameter value. | |
| bool | value (const QString &, const QString &, QLinearGradient &) const |
| Get linear gradient parameter value. | |
| bool | value (const QString &, const QString &, QRadialGradient &) const |
| Get radial gradient parameter value. | |
| bool | value (const QString &, const QString &, QConicalGradient &) const |
| Get conical gradient parameter value. | |
| bool | value (const QString &, const QString &, QString &, const bool=true) const |
| Get string parameter value (native format). | |
| int | integerValue (const QString &, const QString &, const int=0) const |
| Get interger parameter value. | |
| double | doubleValue (const QString &, const QString &, const double=0) const |
| Get double parameter value. | |
| bool | booleanValue (const QString &, const QString &, const bool=false) const |
| Get boolean parameter value. | |
| QFont | fontValue (const QString &, const QString &, const QFont &=QFont()) const |
| Get font parameter value. | |
| QColor | colorValue (const QString &, const QString &, const QColor &=QColor()) const |
| Get color parameter value. | |
| QString | stringValue (const QString &, const QString &, const QString &=QString()) const |
| Get string parameter value. | |
| QByteArray | byteArrayValue (const QString &, const QString &, const QByteArray &=QByteArray()) const |
| Get byte array parameter value. | |
| QLinearGradient | linearGradientValue (const QString &, const QString &, const QLinearGradient &=QLinearGradient()) const |
| Get linear gradient parameter value. | |
| QRadialGradient | radialGradientValue (const QString &, const QString &, const QRadialGradient &=QRadialGradient()) const |
| Get radial gradient parameter value. | |
| QConicalGradient | conicalGradientValue (const QString &, const QString &, const QConicalGradient &=QConicalGradient()) const |
| Get conical gradient parameter value. | |
| bool | hasSection (const QString &) const |
| Check section existence. | |
| bool | hasValue (const QString &, const QString &) const |
| Check parameter existence. | |
| void | setValue (const QString &, const QString &, const int) |
| Set integer parameter value. | |
| void | setValue (const QString &, const QString &, const double) |
| Set double parameter value. | |
| void | setValue (const QString &, const QString &, const bool) |
| Set boolean parameter value. | |
| void | setValue (const QString &, const QString &, const QFont &) |
| Set font parameter value. | |
| void | setValue (const QString &, const QString &, const QColor &) |
| Set color parameter value. | |
| void | setValue (const QString &, const QString &, const QString &) |
| Set string parameter value. | |
| void | setValue (const QString &, const QString &, const QByteArray &) |
| Set byte array parameter value. | |
| void | setValue (const QString &, const QString &, const QLinearGradient &) |
| Set linear gradient parameter value. | |
| void | setValue (const QString &, const QString &, const QRadialGradient &) |
| Set radial gradient parameter value. | |
| void | setValue (const QString &, const QString &, const QConicalGradient &) |
| Set conical gradient parameter value. | |
| void | remove (const QString &) |
| Remove resources section. | |
| void | remove (const QString &, const QString &) |
| Remove the specified parameter. | |
| QString | currentFormat () const |
| Get current configuration files format. | |
| void | setCurrentFormat (const QString &) |
| Set current configuration files format. | |
| Format * | format (const QString &) const |
| Get configuration files format by specified format name. | |
| void | installFormat (Format *) |
| Install configuration files format. | |
| void | removeFormat (Format *) |
| Remove configuration files format. | |
| QStringList | options () const |
| Get resource format options names. | |
| QString | option (const QString &) const |
| Get the string value of the specified resources format option. | |
| void | setOption (const QString &, const QString &) |
| Set the string value of the specified resources format option. | |
| QPixmap | defaultPixmap () const |
| Get default pixmap. | |
| virtual void | setDefaultPixmap (const QPixmap &) |
| Set default pixmap. | |
| QString | resSection () const |
| Get application resources section name. | |
| QString | langSection () const |
| Get application language section name. | |
| QString | sectionsToken () const |
| Get sections separator token. | |
| QPixmap | loadPixmap (const QString &, const QString &) const |
| Load pixmap resource. | |
| 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. | |
| 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. | |
| void | loadLanguage (const QString &=QString(), const QString &=QString()) |
| Load translation files according to the specified language. | |
| void | raiseTranslators (const QString &) |
| Move all translators corresponding to the specified translation context to the top of translators stack (increase their priority). | |
| void | removeTranslators (const QString &) |
| Remove all translators corresponding to the specified translation context. | |
| void | loadTranslator (const QString &, const QString &) |
| Load translation file. | |
| void | loadTranslators (const QString &, const QStringList &) |
| Load translation files for the specified translation context. | |
| QString | path (const QString &, const QString &, const QString &) const |
| Get absolute path to the file which name is defined by the parameter. | |
| bool | load () |
| Load all resources from all resource files (global and user). | |
| bool | import (const QString &) |
| Import resources from specified resource file. | |
| bool | save () |
| Save all resources to the user resource files. | |
| QStringList | sections () const |
| Get all sections names. | |
| QStringList | sections (const QRegExp &) const |
| Get all sections names matching specified regular expression. | |
| QStringList | sections (const QStringList &) const |
| Get all sections names with the prefix specified by passed list of parent sections names. | |
| QStringList | subSections (const QString &, const bool=true) const |
| Get list of sub-sections names for the specified parent section name. | |
| QStringList | parameters (const QString &) const |
| Get all parameters name in specified section. | |
| QStringList | parameters (const QStringList &) const |
| Get all parameters name in specified list of sub-sections names. | |
| void | refresh () |
| Copy all parameters to the user resources in order to saved them lately in the user home folder. | |
Static Public Member Functions | |
| static void | initResourceMgr () |
Static Public Attributes | |
| static QString | myExtAppName = QString() |
| static QString | myExtAppVersion = QString() |
Protected Member Functions | |
| QString | userFileName (const QString &appName, const bool for_load) const |
| virtual int | userFileId (const QString &_fname) const |
| virtual QString | findAppropriateUserFile (const QString &) const |
| virtual void | setDirList (const QStringList &) |
| Set the resource directories (where global confguration files are searched). | |
| virtual void | setResource (const QString &, const QString &, const QString &) |
| Set parameter value. | |
| virtual QString | globalFileName (const QString &) const |
| Get global configuration file name. | |
Friends | |
| class | QtxResourceMgr::Format |
typedef IMap<QString, QString> QtxResourceMgr.Section [inherited] |
enum QtxResourceMgr::WorkingMode [inherited] |
| SALOME_ResourceMgr.SALOME_ResourceMgr | ( | const QString & | app, |
| const QString & | resVarTemplate | ||
| ) |
| static void SALOME_ResourceMgr.initResourceMgr | ( | ) | [static] |
References QtxResourceMgr.loadLanguage(), myExtAppName, myExtAppVersion, and salomeVersion().
| QString SALOME_ResourceMgr.version | ( | ) | const [virtual] |
Reimplemented from SUIT_ResourceMgr.
References myExtAppVersion.
| QString SALOME_ResourceMgr.userFileName | ( | const QString & | appName, |
| const bool | for_load | ||
| ) | const [protected, virtual] |
Reimplemented from SUIT_ResourceMgr.
References myExtAppName, and version().
| virtual int SALOME_ResourceMgr.userFileId | ( | const QString & | _fname | ) | const [protected, virtual] |
Reimplemented from SUIT_ResourceMgr.
References myExtAppName.
| void SUIT_ResourceMgr::setVersion | ( | const QString & | ver | ) | [inherited] |
Sets the version of application
References SUIT_ResourceMgr.myVersion.
| QString SUIT_ResourceMgr::loadDoc | ( | const QString & | prefix, |
| const QString & | id | ||
| ) | const [inherited] |
Loads a doc page from 'prefix' resources and indetified by 'id'
References QtxResourceMgr.option(), and QtxResourceMgr.path().
| QString SUIT_ResourceMgr::findAppropriateUserFile | ( | const QString & | fname | ) | const [protected, virtual, inherited] |
Finds other the most appropriate user file instead missing one
References test_table.l, and SUIT_ResourceMgr.userFileId().
| QString QtxResourceMgr::appName | ( | ) | const [inherited] |
References QtxResourceMgr.myAppName.
| QStringList QtxResourceMgr::dirList | ( | ) | const [inherited] |
Home user directory (where the user application configuration file is situated) is not included. This is that directories list defined by the application resources environment variable.
References QtxResourceMgr.myDirList.
| bool QtxResourceMgr::checkExisting | ( | ) | const [inherited] |
If this flag is true then preference can be set (with setValue() method) only if it doesn't exist or if the value is changed.
true if "check existance" flag is set References QtxResourceMgr.myCheckExist.
| void QtxResourceMgr::setCheckExisting | ( | const bool | on | ) | [virtual, inherited] |
| on | new flag value |
References QtxResourceMgr.myCheckExist.
| bool QtxResourceMgr::isPixmapCached | ( | ) | const [inherited] |
Resources manager allows possibility to cache loaded pixmaps that allow to improve application performance. This feature is turned on by default - all loaded pixmaps are stored in the internal map. Switching of this feature on/off can be done by setIsPixmapCached() method.
true if pixmap cache is turned on References QtxResourceMgr.myIsPixmapCached.
| void QtxResourceMgr::setIsPixmapCached | ( | const bool | on | ) | [inherited] |
| on | enable pixmap cache if true and disable it if false |
References QtxResourceMgr.myIsPixmapCached.
| void QtxResourceMgr::clear | ( | ) | [inherited] |
References QtxResourceMgr.myResources.
| QtxResourceMgr::WorkingMode QtxResourceMgr::workingMode | ( | ) | const [inherited] |
References QtxResourceMgr.myWorkingMode.
| void QtxResourceMgr::setWorkingMode | ( | WorkingMode | mode | ) | [inherited] |
The resource manager can operate in the following working modes: AllowUserValues : methods values(), hasValue(), hasSection() take into account user values (default) IgnoreUserValues : methods values(), hasValue(), hasSection() do not take into account user values
Note, that setValue() method always put the value to the user settings file.
| mode | new working mode |
References QtxResourceMgr.myWorkingMode.
| bool QtxResourceMgr::value | ( | const QString & | sect, |
| const QString & | name, | ||
| int & | iVal | ||
| ) | const [inherited] |
| sect | section name |
| name | parameter name |
| iVal | parameter to return resulting integer value |
true if parameter is found and false if parameter is not found (in this case iVal value is undefined) | bool QtxResourceMgr::value | ( | const QString & | sect, |
| const QString & | name, | ||
| double & | dVal | ||
| ) | const [inherited] |
| sect | section name |
| name | parameter name |
| dVal | parameter to return resulting double value |
true if parameter is found and false if parameter is not found (in this case dVal value is undefined) References QtxResourceMgr.value().
| bool QtxResourceMgr::value | ( | const QString & | sect, |
| const QString & | name, | ||
| bool & | bVal | ||
| ) | const [inherited] |
| sect | section name |
| name | parameter name |
| bVal | parameter to return resulting boolean value |
true if parameter is found and false if parameter is not found (in this case bVal value is undefined) References QtxResourceMgr.value().
| bool QtxResourceMgr::value | ( | const QString & | sect, |
| const QString & | name, | ||
| QColor & | cVal | ||
| ) | const [inherited] |
| sect | section name |
| name | parameter name |
| cVal | parameter to return resulting color value |
true if parameter is found and false if parameter is not found (in this case cVal value is undefined) References Qtx.stringToColor(), and QtxResourceMgr.value().
| bool QtxResourceMgr::value | ( | const QString & | sect, |
| const QString & | name, | ||
| QFont & | fVal | ||
| ) | const [inherited] |
| sect | section name |
| name | parameter name |
| fVal | parameter to return resulting font value |
true if parameter is found and false if parameter is not found (in this case fVal value is undefined) References QtxResourceMgr.value().
| bool QtxResourceMgr::value | ( | const QString & | sect, |
| const QString & | name, | ||
| QByteArray & | baVal | ||
| ) | const [inherited] |
| sect | section name |
| name | parameter name |
| baVal | parameter to return resulting byte array value |
true if parameter is found and false if parameter is not found (in this case baVal value is undefined) References QtxResourceMgr.value().
| bool QtxResourceMgr::value | ( | const QString & | sect, |
| const QString & | name, | ||
| QLinearGradient & | gVal | ||
| ) | const [inherited] |
| sect | section name |
| name | parameter name |
| gVal | parameter to return resulting linear gradient value value |
true if parameter is found and false if parameter is not found (in this case gVal value is undefined) References Qtx.stringToLinearGradient(), and QtxResourceMgr.value().
| bool QtxResourceMgr::value | ( | const QString & | sect, |
| const QString & | name, | ||
| QRadialGradient & | gVal | ||
| ) | const [inherited] |
| sect | section name |
| name | parameter name |
| gVal | parameter to return resulting radial gradient value value |
true if parameter is found and false if parameter is not found (in this case gVal value is undefined) References Qtx.stringToRadialGradient(), and QtxResourceMgr.value().
| bool QtxResourceMgr::value | ( | const QString & | sect, |
| const QString & | name, | ||
| QConicalGradient & | gVal | ||
| ) | const [inherited] |
| sect | section name |
| name | parameter name |
| gVal | parameter to return resulting conical gradient value value |
true if parameter is found and false if parameter is not found (in this case gVal value is undefined) References Qtx.stringToConicalGradient(), and QtxResourceMgr.value().
| bool QtxResourceMgr::value | ( | const QString & | sect, |
| const QString & | name, | ||
| QString & | val, | ||
| const bool | subst = true |
||
| ) | const [inherited] |
| sect | section name |
| name | parameter name |
| val | parameter to return resulting byte array value |
| subst | if true perform environment variables substitution |
true if parameter is found and false if parameter is not found (in this case val value is undefined) References QtxResourceMgr.IgnoreUserValues, QtxResourceMgr.initialize(), QtxResourceMgr.myHasUserValues, QtxResourceMgr.myResources, and QtxResourceMgr.workingMode().
| int QtxResourceMgr::integerValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const int | def = 0 |
||
| ) | const [inherited] |
If the specified parameter is not found or can not be converted to the integer value, the specified default value is returned instead.
| sect | section name |
| name | parameter name |
| def | default value |
References QtxResourceMgr.value().
| double QtxResourceMgr::doubleValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const double | def = 0 |
||
| ) | const [inherited] |
If the specified parameter is not found or can not be converted to the double value, the specified default value is returned instead.
| sect | section name |
| name | parameter name |
| def | default value |
References QtxResourceMgr.value().
| bool QtxResourceMgr::booleanValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const bool | def = false |
||
| ) | const [inherited] |
If the specified parameter is not found or can not be converted to the boolean value, the specified default value is returned instead.
| sect | section name |
| name | parameter name |
| def | default value |
References QtxResourceMgr.value().
| QFont QtxResourceMgr::fontValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QFont & | def = QFont() |
||
| ) | const [inherited] |
If the specified parameter is not found or can not be converted to the font value, the specified default value is returned instead.
| sect | section name |
| name | parameter name |
| def | default value |
References QtxResourceMgr.value().
| QColor QtxResourceMgr::colorValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QColor & | def = QColor() |
||
| ) | const [inherited] |
If the specified parameter is not found or can not be converted to the color value, the specified default value is returned instead.
| sect | section name |
| name | parameter name |
| def | default value |
References QtxResourceMgr.value().
| QString QtxResourceMgr::stringValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QString & | def = QString() |
||
| ) | const [inherited] |
If the specified parameter is not found, the specified default value is returned instead.
| sect | section name |
| name | parameter name |
| def | default value |
References QtxResourceMgr.value().
| QByteArray QtxResourceMgr::byteArrayValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QByteArray & | def = QByteArray() |
||
| ) | const [inherited] |
If the specified parameter is not found, the specified default value is returned instead.
| sect | section name |
| name | parameter name |
| def | default value |
References QtxResourceMgr.value().
| QLinearGradient QtxResourceMgr::linearGradientValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QLinearGradient & | def = QLinearGradient() |
||
| ) | const [inherited] |
If the specified parameter is not found, the specified default value is returned instead.
| sect | section name |
| name | parameter name |
| def | default value |
References QtxResourceMgr.value().
| QRadialGradient QtxResourceMgr::radialGradientValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QRadialGradient & | def = QRadialGradient() |
||
| ) | const [inherited] |
If the specified parameter is not found, the specified default value is returned instead.
| sect | section name |
| name | parameter name |
| def | default value |
References QtxResourceMgr.value().
| QConicalGradient QtxResourceMgr::conicalGradientValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QConicalGradient & | def = QConicalGradient() |
||
| ) | const [inherited] |
If the specified parameter is not found, the specified default value is returned instead.
| sect | section name |
| name | parameter name |
| def | default value |
References QtxResourceMgr.value().
| bool QtxResourceMgr::hasSection | ( | const QString & | sect | ) | const [inherited] |
| sect | section name |
true if section exists References QtxResourceMgr.IgnoreUserValues, QtxResourceMgr.initialize(), QtxResourceMgr.myHasUserValues, QtxResourceMgr.myResources, and QtxResourceMgr.workingMode().
| bool QtxResourceMgr::hasValue | ( | const QString & | sect, |
| const QString & | name | ||
| ) | const [inherited] |
| sect | section name |
| name | parameter name |
true if parameter exists in specified section References QtxResourceMgr.IgnoreUserValues, QtxResourceMgr.initialize(), QtxResourceMgr.myHasUserValues, QtxResourceMgr.myResources, and QtxResourceMgr.workingMode().
| void QtxResourceMgr::setValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const int | val | ||
| ) | [inherited] |
| sect | section name |
| name | parameter name |
| val | parameter value |
References QtxResourceMgr.checkExisting(), QtxResourceMgr.setResource(), and QtxResourceMgr.value().
| void QtxResourceMgr::setValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const double | val | ||
| ) | [inherited] |
| sect | section name |
| name | parameter name |
| val | parameter value |
References QtxResourceMgr.checkExisting(), QtxResourceMgr.setResource(), and QtxResourceMgr.value().
| void QtxResourceMgr::setValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const bool | val | ||
| ) | [inherited] |
| sect | section name |
| name | parameter name |
| val | parameter value |
References QtxResourceMgr.checkExisting(), QtxResourceMgr.setResource(), and QtxResourceMgr.value().
| void QtxResourceMgr::setValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QFont & | val | ||
| ) | [inherited] |
| sect | section name |
| name | parameter name |
| val | parameter value |
References QtxResourceMgr.checkExisting(), QtxResourceMgr.setResource(), and QtxResourceMgr.value().
| void QtxResourceMgr::setValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QColor & | val | ||
| ) | [inherited] |
| sect | section name |
| name | parameter name |
| val | parameter value |
References QtxResourceMgr.checkExisting(), Qtx.colorToString(), QtxResourceMgr.setResource(), and QtxResourceMgr.value().
| void QtxResourceMgr::setValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QString & | val | ||
| ) | [inherited] |
| sect | section name |
| name | parameter name |
| val | parameter value |
References QtxResourceMgr.checkExisting(), QtxResourceMgr.setResource(), and QtxResourceMgr.value().
| void QtxResourceMgr::setValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QByteArray & | val | ||
| ) | [inherited] |
| sect | section name |
| name | parameter name |
| val | parameter value |
References QtxResourceMgr.checkExisting(), QtxResourceMgr.setResource(), and QtxResourceMgr.value().
| void QtxResourceMgr::setValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QLinearGradient & | val | ||
| ) | [inherited] |
| sect | section name |
| name | parameter name |
| val | parameter value |
References QtxResourceMgr.checkExisting(), Qtx.gradientToString(), QtxResourceMgr.setResource(), and QtxResourceMgr.value().
| void QtxResourceMgr::setValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QRadialGradient & | val | ||
| ) | [inherited] |
| sect | section name |
| name | parameter name |
| val | parameter value |
References QtxResourceMgr.checkExisting(), Qtx.gradientToString(), QtxResourceMgr.setResource(), and QtxResourceMgr.value().
| void QtxResourceMgr::setValue | ( | const QString & | sect, |
| const QString & | name, | ||
| const QConicalGradient & | val | ||
| ) | [inherited] |
| sect | section name |
| name | parameter name |
| val | parameter value |
References QtxResourceMgr.checkExisting(), Qtx.gradientToString(), QtxResourceMgr.setResource(), and QtxResourceMgr.value().
| void QtxResourceMgr::remove | ( | const QString & | sect | ) | [inherited] |
| sect | section name |
References QtxResourceMgr.initialize(), and QtxResourceMgr.myResources.
| void QtxResourceMgr::remove | ( | const QString & | sect, |
| const QString & | name | ||
| ) | [inherited] |
| sect | section name |
| name | parameter name |
References QtxResourceMgr.initialize(), and QtxResourceMgr.myResources.
| QString QtxResourceMgr::currentFormat | ( | ) | const [inherited] |
References QtxResourceMgr.format(), and QtxResourceMgr.myFormats.
| void QtxResourceMgr::setCurrentFormat | ( | const QString & | fmt | ) | [inherited] |
| fmt | configuration files format name |
References Qtx.addSlash(), QtxResourceMgr.appName(), QtxResourceMgr.format(), QtxResourceMgr.globalFileName(), QtxResourceMgr.myDirList, QtxResourceMgr.myFormats, QtxResourceMgr.myResources, and QtxResourceMgr.userFileName().
| QtxResourceMgr::Format * QtxResourceMgr::format | ( | const QString & | fmt | ) | const [inherited] |
| fmt | configuration files format name |
References QtxResourceMgr.myFormats.
| void QtxResourceMgr::installFormat | ( | QtxResourceMgr::Format * | form | ) | [inherited] |
Added format becomes current.
| form | format object to be installed |
References QtxResourceMgr.myFormats.
| void QtxResourceMgr::removeFormat | ( | QtxResourceMgr::Format * | form | ) | [inherited] |
| form | format object to be uninstalled |
References QtxResourceMgr.myFormats.
| QStringList QtxResourceMgr::options | ( | ) | const [inherited] |
References QtxResourceMgr.myOptions.
| QString QtxResourceMgr::option | ( | const QString & | opt | ) | const [inherited] |
If option does not exist, null QString is returned.
| opt | option name |
References QtxResourceMgr.myOptions.
| void QtxResourceMgr::setOption | ( | const QString & | opt, |
| const QString & | val | ||
| ) | [inherited] |
| opt | option name |
| val | option value |
References QtxResourceMgr.myOptions.
| QPixmap QtxResourceMgr::defaultPixmap | ( | ) | const [inherited] |
Default pixmap is used when requested pixmap resource is not found.
References QtxResourceMgr.myDefaultPix.
| void QtxResourceMgr::setDefaultPixmap | ( | const QPixmap & | pix | ) | [virtual, inherited] |
Default pixmap is used when requested pixmap resource is not found.
| pix | default pixmap |
References QtxResourceMgr.myDefaultPix.
| QString QtxResourceMgr::resSection | ( | ) | const [inherited] |
By default, application resources section name is "resources" but it can be changed by setting the "res_section_name" resources manager option.
References QtxResourceMgr.option().
| QString QtxResourceMgr::langSection | ( | ) | const [inherited] |
By default, application language section name is "language" but it can be changed by setting the "lang_section_name" resources manager option.
References QtxResourceMgr.option().
| QString QtxResourceMgr::sectionsToken | ( | ) | const [inherited] |
By default, sections separator token is colon symbol ":" but it can be changed by setting the "section_token" resources manager option.
References QtxResourceMgr.option().
| QPixmap QtxResourceMgr::loadPixmap | ( | const QString & | prefix, |
| const QString & | name | ||
| ) | const [inherited] |
| prefix | parameter which refers to the resources directory (directories) |
| name | pixmap file name |
| QPixmap QtxResourceMgr::loadPixmap | ( | const QString & | prefix, |
| const QString & | name, | ||
| const bool | useDef | ||
| ) | const [inherited] |
| prefix | parameter which refers to the resources directory (directories) |
| name | pixmap file name |
| useDef | if false, default pixmap is not returned if resource is not found, in this case null pixmap is returned instead |
References QtxResourceMgr.defaultPixmap(), and QtxResourceMgr.loadPixmap().
| QPixmap QtxResourceMgr::loadPixmap | ( | const QString & | prefix, |
| const QString & | name, | ||
| const QPixmap & | defPix | ||
| ) | const [inherited] |
| prefix | parameter which refers to the resources directory (directories) |
| name | pixmap file name |
| defPix | default which should be used if the resource file doesn't exist |
References QtxResourceMgr.IgnoreUserValues, QtxResourceMgr.initialize(), QtxResourceMgr.myHasUserValues, QtxResourceMgr.myResources, QtxResourceMgr.resSection(), and QtxResourceMgr.workingMode().
| void QtxResourceMgr::loadLanguage | ( | const QString & | pref = QString(), |
| const QString & | l = QString() |
||
| ) | [inherited] |
Names of the translation files are calculated according to the pattern specified by the "translators" option (this option is read from the section "language" of resources files). By default, "%P_msg_%L.qm" pattern is used. Keywords %A, %P, %L in the pattern are substituted by the application name, prefix and language name correspondingly. For example, for prefix "SUIT" and language "en", all translation files "SUIT_msg_en.qm" are searched and loaded.
If prefix is empty or null string, all translation files specified in the "resources" section of resources files are loaded (actually, the section is retrieved from resSection() method). If language is not specified, it is retrieved from the langSection() method, and if the latest is also empty, by default "en" (English) language is used. By default, settings from the user preferences file are also loaded (if user resource file is valid, see userFileName()). To avoid loading user settings, pass false as first parameter.
| pref | parameter which defines translation context (for example, package name) |
| l | language name |
References QtxResourceMgr.appName(), QtxResourceMgr.initialize(), test_table.l, QtxResourceMgr.langSection(), QtxResourceMgr.loadTranslators(), QtxResourceMgr.option(), QtxResourceMgr.parameters(), QtxResourceMgr.resSection(), QtxResourceMgr.setOption(), QtxResourceMgr.substMacro(), and QtxResourceMgr.value().
| void QtxResourceMgr::raiseTranslators | ( | const QString & | prefix | ) | [inherited] |
| prefix | parameter which defines translation context (for example, package name) |
References QtxResourceMgr.myTranslator.
| void QtxResourceMgr::removeTranslators | ( | const QString & | prefix | ) | [inherited] |
| prefix | parameter which defines translation context (for example, package name) |
References QtxResourceMgr.myTranslator.
| void QtxResourceMgr::loadTranslator | ( | const QString & | prefix, |
| const QString & | name | ||
| ) | [inherited] |
| prefix | parameter which defines translation context (for example, package name) |
| name | translator file name |
References QtxResourceMgr.IgnoreUserValues, QtxResourceMgr.initialize(), QtxResourceMgr.Resources.loadTranslator(), QtxResourceMgr.myResources, QtxResourceMgr.myTranslator, QtxResourceMgr.resSection(), and QtxResourceMgr.workingMode().
| void QtxResourceMgr::loadTranslators | ( | const QString & | prefix, |
| const QStringList & | translators | ||
| ) | [inherited] |
| prefix | parameter which defines translation context (for example, package name) |
| translators | list of translation files |
References QtxResourceMgr.IgnoreUserValues, QtxResourceMgr.initialize(), QtxResourceMgr.myHasUserValues, QtxResourceMgr.myResources, QtxResourceMgr.myTranslator, QtxResourceMgr.resSection(), and QtxResourceMgr.workingMode().
| QString QtxResourceMgr::path | ( | const QString & | sect, |
| const QString & | prefix, | ||
| const QString & | name | ||
| ) | const [inherited] |
The file name is defined by name argument, while directory name is retrieved from resources parameter prefix of section sec. Both directory and file name can be relative. If the directory is relative, it is calculated from the initial resources file name. Directory parameter can contain environment variables, which are substituted automatically.
| sec | section name |
| prefix | parameter containing directory name |
| name | file name |
References QtxResourceMgr.IgnoreUserValues, QtxResourceMgr.myHasUserValues, QtxResourceMgr.myResources, and QtxResourceMgr.workingMode().
| bool QtxResourceMgr::load | ( | ) | [inherited] |
true on success and false on error References QtxResourceMgr.currentFormat(), QtxResourceMgr.format(), QtxResourceMgr.initialize(), QtxResourceMgr.Format.load(), and QtxResourceMgr.myResources.
| bool QtxResourceMgr::import | ( | const QString & | fname | ) | [inherited] |
| fname | resources file name |
true on success and false on error References QtxResourceMgr.currentFormat(), QtxResourceMgr.Resources.file(), QtxResourceMgr.format(), QtxResourceMgr.Format.load(), QtxResourceMgr.myHasUserValues, QtxResourceMgr.myResources, and QtxResourceMgr.Resources.setFile().
| bool QtxResourceMgr::save | ( | ) | [inherited] |
true on success and false on error References QtxResourceMgr.currentFormat(), QtxResourceMgr.format(), QtxResourceMgr.initialize(), QtxResourceMgr.myHasUserValues, QtxResourceMgr.myResources, and QtxResourceMgr.Format.save().
| QStringList QtxResourceMgr::sections | ( | ) | const [inherited] |
References QtxResourceMgr.IgnoreUserValues, QtxResourceMgr.initialize(), QtxResourceMgr.myHasUserValues, QtxResourceMgr.myResources, and QtxResourceMgr.workingMode().
| QStringList QtxResourceMgr::sections | ( | const QRegExp & | re | ) | const [inherited] |
| re | searched regular expression |
References QtxResourceMgr.sections().
| QStringList QtxResourceMgr::sections | ( | const QStringList & | names | ) | const [inherited] |
Sub-sections are separated inside the section name by the sections separator token, for example "splash:color:label".
| names | parent sub-sections names |
References QtxResourceMgr.sections(), and QtxResourceMgr.sectionsToken().
| QStringList QtxResourceMgr::subSections | ( | const QString & | section, |
| const bool | full = true |
||
| ) | const [inherited] |
Sub-sections are separated inside the section name by the sections separator token, for example "splash:color:label".
| section | parent sub-section name |
| full | if true return full names of child sub-sections, if false, return only top-level sub-sections names |
References QtxResourceMgr.sections(), and QtxResourceMgr.sectionsToken().
| QStringList QtxResourceMgr::parameters | ( | const QString & | sec | ) | const [inherited] |
| sec | section name |
References QtxResourceMgr.IgnoreUserValues, QtxResourceMgr.initialize(), QtxResourceMgr.myResources, QtxResourceMgr.Resources.parameters(), and QtxResourceMgr.workingMode().
| QStringList QtxResourceMgr::parameters | ( | const QStringList & | names | ) | const [inherited] |
Sub-sections are separated inside the section name by the sections separator token, for example "splash:color:label".
| names | parent sub-sections names |
References QtxResourceMgr.parameters(), and QtxResourceMgr.sectionsToken().
| void QtxResourceMgr::refresh | ( | ) | [inherited] |
| void QtxResourceMgr::setDirList | ( | const QStringList & | dl | ) | [protected, virtual, inherited] |
This function also clears all currently set resources.
| dl | directories list |
References QtxResourceMgr.myDirList, and QtxResourceMgr.myResources.
| void QtxResourceMgr::setResource | ( | const QString & | sect, |
| const QString & | name, | ||
| const QString & | val | ||
| ) | [protected, virtual, inherited] |
| sect | section name |
| name | parameter name |
| val | parameter value |
References QtxResourceMgr.initialize(), QtxResourceMgr.myHasUserValues, and QtxResourceMgr.myResources.
| QString QtxResourceMgr::globalFileName | ( | const QString & | appName | ) | const [protected, virtual, inherited] |
This method can be redefined in the successor class to customize the global configuration file name. Global configuration files are searched in the directories specified by the application resources environment variable (e.g. MyAppResources). By default <appName>.<format> file name is used (e.g. MyApp.xml).
| appName | application name |
References QtxResourceMgr.currentFormat().
friend class QtxResourceMgr::Format [friend, inherited] |
QString SALOME_ResourceMgr::myExtAppName = QString() [static] |
QString SALOME_ResourceMgr::myExtAppVersion = QString() [static] |