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

SALOME style resources manager. More...

#include <Style_ResourceMgr.h>

Inheritance diagram for Style_ResourceMgr:
Inheritance graph

Public Types

enum  StyleType { Global, User, All }
 Style type. More...
 
- 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...
 

Public Member Functions

 Style_ResourceMgr ()
 Constructor. More...
 
 ~Style_ResourceMgr ()
 Destructor. More...
 
QStringList styles (StyleType=All, bool=true)
 Get list of avaiable SALOME themes. More...
 
- 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...
 

Additional Inherited Members

- Protected Member Functions inherited from QtxResourceMgr
virtual QString defaultLanguage () const
 Specify default language for the application. More...
 
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 userFileName (const QString &, const bool=true) const
 Get user configuration file name. 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...
 

Detailed Description

This class is used to manage the SALOME style themes throughout the application in the similar way as QtxResourceMgr does it with application preferences.

Standard SALOME themes are stored in the global application settings files (named as SalomeStyle.xml). User-defined themes are stored in user's home directory - in the file .SalomeStylerc.

The Style_ResourceMgr class is used by SALOME style preferences dialog box (Style_PrefDlg class).

Member Enumeration Documentation

Enumerator
Global 

Global styles.

User 

User styles.

All 

All style.

Constructor & Destructor Documentation

Style_ResourceMgr::~Style_ResourceMgr ( )

Member Function Documentation

QStringList Style_ResourceMgr::styles ( StyleType  type = All,
bool  sort = true 
)
Parameters
typethemes type
sortif true (default), returns a list of themes sorted by name
Returns
list of avaiable themes names

References All, QtxResourceMgr::AllowUserValues, Global, QtxResourceMgr::hasSection(), QtxResourceMgr::IgnoreUserValues, s, QtxResourceMgr::sections(), QtxResourceMgr::setWorkingMode(), User, and QtxResourceMgr::workingMode().


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