VSTGUI 4.5 Graphical User Interface Framework not only for VST plugins

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
UIDescription Class Reference
Version 4.0

XML description parser and view creator. More...

Inheritance diagram for UIDescription:

## Classes
struct | Impl

## Public Types
enum | SaveFlags { kWriteWindowsResourceFile = 1 << 0, kWriteImagesIntoXMLFile = 1 << 1 }
using | FocusDrawing = FocusDrawingSettings

## Public Member Functions
| UIDescription (const CResourceDescription &xmlFile, IViewFactory *viewFactory=nullptr)
| UIDescription (Xml::IContentProvider *xmlContentProvider, IViewFactory *viewFactory=nullptr)
| ~UIDescription () noexceptoverride
virtual bool | parse ()
virtual bool | save (UTF8StringPtr filename, int32_t flags=kWriteWindowsResourceFile)
virtual bool | saveWindowsRCFile (UTF8StringPtr filename)
bool | storeViews (const std::list< CView * > &views, OutputStream &stream, UIAttributes *customData=nullptr) const
bool | restoreViews (InputStream &stream, std::list< SharedPointer< CView > > &views, UIAttributes **customData=nullptr)
UTF8StringPtr | getFilePath () const
void | setFilePath (UTF8StringPtr path)
void | setSharedResources (const SharedPointer< UIDescription > &resources)
const SharedPointer < UIDescription > & | getSharedResources () const
const UIAttributes * | getViewAttributes (UTF8StringPtr name) const
void | setController (IController *controller) const
CView * | createView (UTF8StringPtr name, IController *controller) const override
CBitmap * | getBitmap (UTF8StringPtr name) const override
CFontRef | getFont (UTF8StringPtr name) const override
bool | getColor (UTF8StringPtr name, CColor &color) const override
CGradient * | getGradient (UTF8StringPtr name) const override
int32_t | getTagForName (UTF8StringPtr name) const override
IControlListener * | getControlListener (UTF8StringPtr name) const override
IController * | getController () const override
const IViewFactory * | getViewFactory () const override
UTF8StringPtr | lookupColorName (const CColor &color) const override
UTF8StringPtr | lookupFontName (const CFontRef font) const override
UTF8StringPtr | lookupBitmapName (const CBitmap *bitmap) const override
UTF8StringPtr | lookupGradientName (const CGradient *gradient) const override
UTF8StringPtr | lookupControlTagName (const int32_t tag) const override
bool | getVariable (UTF8StringPtr name, double &value) const override
bool | getVariable (UTF8StringPtr name, std::string &value) const override
void | collectTemplateViewNames (std::list< const std::string * > &names) const override
void | collectColorNames (std::list< const std::string * > &names) const override
void | collectFontNames (std::list< const std::string * > &names) const override
void | collectBitmapNames (std::list< const std::string * > &names) const override
void | collectGradientNames (std::list< const std::string * > &names) const override
void | collectControlTagNames (std::list< const std::string * > &names) const override
void | changeColorName (UTF8StringPtr oldName, UTF8StringPtr newName)
void | changeTagName (UTF8StringPtr oldName, UTF8StringPtr newName)
void | changeFontName (UTF8StringPtr oldName, UTF8StringPtr newName)
void | changeBitmapName (UTF8StringPtr oldName, UTF8StringPtr newName)
void | changeGradientName (UTF8StringPtr oldName, UTF8StringPtr newName)
void | changeColor (UTF8StringPtr name, const CColor &newColor)
void | changeFont (UTF8StringPtr name, CFontRef newFont)
void | changeGradient (UTF8StringPtr name, CGradient *newGradient)
void | changeBitmap (UTF8StringPtr name, UTF8StringPtr newName, const CRect *nineparttiledOffset=nullptr)
void | changeBitmapFilters (UTF8StringPtr bitmapName, const std::list< SharedPointer< UIAttributes > > &filters)
void | collectBitmapFilters (UTF8StringPtr bitmapName, std::list< SharedPointer< UIAttributes > > &filters) const
void | removeColor (UTF8StringPtr name)
void | removeTag (UTF8StringPtr name)
void | removeFont (UTF8StringPtr name)
void | removeBitmap (UTF8StringPtr name)
void | removeGradient (UTF8StringPtr name)
void | changeAlternativeFontNames (UTF8StringPtr name, UTF8StringPtr alternativeFonts)
bool | getAlternativeFontNames (UTF8StringPtr name, std::string &alternativeFonts) const
bool | hasColorName (UTF8StringPtr name) const
bool | hasTagName (UTF8StringPtr name) const
bool | hasFontName (UTF8StringPtr name) const
bool | hasBitmapName (UTF8StringPtr name) const
bool | hasGradientName (UTF8StringPtr name) const
void | updateViewDescription (UTF8StringPtr name, CView *view)
bool | getTemplateNameFromView (CView *view, std::string &templateName) const
bool | addNewTemplate (UTF8StringPtr name, const SharedPointer< UIAttributes > &attr)
bool | removeTemplate (UTF8StringPtr name)
bool | changeTemplateName (UTF8StringPtr name, UTF8StringPtr newName)
bool | duplicateTemplate (UTF8StringPtr name, UTF8StringPtr duplicateName)
bool | setCustomAttributes (UTF8StringPtr name, const SharedPointer< UIAttributes > &attr)
SharedPointer< UIAttributes > | getCustomAttributes (UTF8StringPtr name) const
SharedPointer< UIAttributes > | getCustomAttributes (UTF8StringPtr name, bool create)
bool | getControlTagString (UTF8StringPtr tagName, std::string &tagString) const
bool | changeControlTagString (UTF8StringPtr tagName, const std::string &newTagString, bool create=false)
bool | calculateStringValue (UTF8StringPtr str, double &result) const
void | registerListener (UIDescriptionListener *listener)
void | unregisterListener (UIDescriptionListener *listener)
void | setBitmapCreator (IBitmapCreator *bitmapCreator)
FocusDrawing | getFocusDrawingSettings () const
void | setFocusDrawingSettings (const FocusDrawing &fd)
void | freePlatformResources ()
Public Member Functions inherited from ReferenceCounted< T >
| ReferenceCounted ()=default
virtual | ~ReferenceCounted () noexcept=default
| ReferenceCounted (const ReferenceCounted &)
ReferenceCounted & | operator= (const ReferenceCounted &)
void | forget () override
| decrease refcount and delete object if refcount == 0 More...
void | remember () override
| increase refcount More...
virtual int32_t | getNbReference () const
| get refcount More...
virtual void | beforeDelete ()
Public Member Functions inherited from IUIDescription
virtual | ~IUIDescription () noexcept=default

## Static Public Member Functions
static bool | parseColor (const std::string &colorString, CColor &color)

## Static Public Attributes
static CViewAttributeID | kTemplateNameAttributeID = 'uitl'
Static Public Attributes inherited from IUIDescription
static IdStringPtr | kCustomViewName = "custom-view-name"

## Protected Member Functions
void | addDefaultNodes ()
bool | saveToStream (OutputStream &stream, int32_t flags)
bool | parsed () const
void | setXmlContentProvider (Xml::IContentProvider *provider)
const CResourceDescription & | getXmlFile () const

## Detailed Description

XML description parser and view creator.

## Member Typedef Documentation

using FocusDrawing = FocusDrawingSettings

## Member Enumeration Documentation

enum SaveFlags

Enumerator
kWriteWindowsResourceFile |
kWriteImagesIntoXMLFile |

## Constructor & Destructor Documentation

UIDescription | ( | const CResourceDescription & | xmlFile,
|  | IViewFactory * | viewFactory = `nullptr`
| ) |  |

UIDescription | ( | Xml::IContentProvider * | xmlContentProvider,
|  | IViewFactory * | viewFactory = `nullptr`
| ) |  |

~UIDescription | ( |  | ) |
| override noexcept

## Member Function Documentation

void addDefaultNodes | ( |  | ) |
| protected

bool addNewTemplate | ( | UTF8StringPtr | name,
|  | const SharedPointer< UIAttributes > & | attr
| ) |  |

bool calculateStringValue | ( | UTF8StringPtr | str,
|  | double & | result
| ) |  | const

void changeAlternativeFontNames | ( | UTF8StringPtr | name,
|  | UTF8StringPtr | alternativeFonts
| ) |  |

void changeBitmap | ( | UTF8StringPtr | name,
|  | UTF8StringPtr | newName,
|  | const CRect * | nineparttiledOffset = `nullptr`
| ) |  |

void changeBitmapFilters | ( | UTF8StringPtr | bitmapName,
|  | const std::list< SharedPointer< UIAttributes > > & | filters
| ) |  |

void changeBitmapName | ( | UTF8StringPtr | oldName,
|  | UTF8StringPtr | newName
| ) |  |

void changeColor | ( | UTF8StringPtr | name,
|  | const CColor & | newColor
| ) |  |

void changeColorName | ( | UTF8StringPtr | oldName,
|  | UTF8StringPtr | newName
| ) |  |

bool changeControlTagString | ( | UTF8StringPtr | tagName,
|  | const std::string & | newTagString,
|  | bool | create = `false`
| ) |  |

void changeFont | ( | UTF8StringPtr | name,
|  | CFontRef | newFont
| ) |  |

void changeFontName | ( | UTF8StringPtr | oldName,
|  | UTF8StringPtr | newName
| ) |  |

void changeGradient | ( | UTF8StringPtr | name,
|  | CGradient * | newGradient
| ) |  |

void changeGradientName | ( | UTF8StringPtr | oldName,
|  | UTF8StringPtr | newName
| ) |  |

void changeTagName | ( | UTF8StringPtr | oldName,
|  | UTF8StringPtr | newName
| ) |  |

bool changeTemplateName | ( | UTF8StringPtr | name,
|  | UTF8StringPtr | newName
| ) |  |

void collectBitmapFilters | ( | UTF8StringPtr | bitmapName,
|  | std::list< SharedPointer< UIAttributes > > & | filters
| ) |  | const

void collectBitmapNames | ( | std::list< const std::string * > & | names | ) | const
| override virtual

Implements IUIDescription.

void collectColorNames | ( | std::list< const std::string * > & | names | ) | const
| override virtual

Implements IUIDescription.

void collectControlTagNames | ( | std::list< const std::string * > & | names | ) | const
| override virtual

Implements IUIDescription.

void collectFontNames | ( | std::list< const std::string * > & | names | ) | const
| override virtual

Implements IUIDescription.

void collectGradientNames | ( | std::list< const std::string * > & | names | ) | const
| override virtual

Implements IUIDescription.

void collectTemplateViewNames | ( | std::list< const std::string * > & | names | ) | const
| override virtual

Implements IUIDescription.

CView * createView | ( | UTF8StringPtr | name,
|  | IController * | controller
| ) |  | const
| override virtual

Implements IUIDescription.

bool duplicateTemplate | ( | UTF8StringPtr | name,
|  | UTF8StringPtr | duplicateName
| ) |  |

void freePlatformResources | ( |  | ) |

bool getAlternativeFontNames | ( | UTF8StringPtr | name,
|  | std::string & | alternativeFonts
| ) |  | const

CBitmap * getBitmap | ( | UTF8StringPtr | name | ) | const
| override virtual

Implements IUIDescription.

bool getColor | ( | UTF8StringPtr | name,
|  | CColor & | color
| ) |  | const
| override virtual

Implements IUIDescription.

IController * getController | ( |  | ) | const
| override virtual

Implements IUIDescription.

IControlListener * getControlListener | ( | UTF8StringPtr | name | ) | const
| override virtual

Implements IUIDescription.

bool getControlTagString | ( | UTF8StringPtr | tagName,
|  | std::string & | tagString
| ) |  | const

SharedPointer< UIAttributes > getCustomAttributes | ( | UTF8StringPtr | name | ) | const

SharedPointer< UIAttributes > getCustomAttributes | ( | UTF8StringPtr | name,
|  | bool | create
| ) |  |

UTF8StringPtr getFilePath | ( |  | ) | const

UIDescription::FocusDrawing getFocusDrawingSettings | ( |  | ) | const

CFontRef getFont | ( | UTF8StringPtr | name | ) | const
| override virtual

Implements IUIDescription.

CGradient * getGradient | ( | UTF8StringPtr | name | ) | const
| override virtual

Implements IUIDescription.

const SharedPointer< UIDescription > & getSharedResources | ( |  | ) | const

int32_t getTagForName | ( | UTF8StringPtr | name | ) | const
| override virtual

Implements IUIDescription.

bool getTemplateNameFromView | ( | CView * | view,
|  | std::string & | templateName
| ) |  | const

bool getVariable | ( | UTF8StringPtr | name,
|  | double & | value
| ) |  | const
| override virtual

Implements IUIDescription.

bool getVariable | ( | UTF8StringPtr | name,
|  | std::string & | value
| ) |  | const
| override virtual

Implements IUIDescription.

const UIAttributes * getViewAttributes | ( | UTF8StringPtr | name | ) | const

const IViewFactory * getViewFactory | ( |  | ) | const
| override virtual

Implements IUIDescription.

const CResourceDescription & getXmlFile | ( |  | ) | const
| protected

bool hasBitmapName | ( | UTF8StringPtr | name | ) | const

bool hasColorName | ( | UTF8StringPtr | name | ) | const

bool hasFontName | ( | UTF8StringPtr | name | ) | const

bool hasGradientName | ( | UTF8StringPtr | name | ) | const

bool hasTagName | ( | UTF8StringPtr | name | ) | const

UTF8StringPtr lookupBitmapName | ( | const CBitmap * | bitmap | ) | const
| override virtual

Implements IUIDescription.

UTF8StringPtr lookupColorName | ( | const CColor & | color | ) | const
| override virtual

Implements IUIDescription.

UTF8StringPtr lookupControlTagName | ( | const int32_t | tag | ) | const
| override virtual

Implements IUIDescription.

UTF8StringPtr lookupFontName | ( | const CFontRef | font | ) | const
| override virtual

Implements IUIDescription.

UTF8StringPtr lookupGradientName | ( | const CGradient * | gradient | ) | const
| override virtual

Implements IUIDescription.

bool parse | ( |  | ) |
| virtual

Reimplemented in CompressedUIDescription.

bool parseColor | ( | const std::string & | colorString,
|  | CColor & | color
| ) |  |
| static

bool parsed | ( |  | ) | const
| protected

void registerListener | ( | UIDescriptionListener * | listener | ) |

void removeBitmap | ( | UTF8StringPtr | name | ) |

void removeColor | ( | UTF8StringPtr | name | ) |

void removeFont | ( | UTF8StringPtr | name | ) |

void removeGradient | ( | UTF8StringPtr | name | ) |

void removeTag | ( | UTF8StringPtr | name | ) |

bool removeTemplate | ( | UTF8StringPtr | name | ) |

bool restoreViews | ( | InputStream & | stream,
|  | std::list< SharedPointer< CView > > & | views,
|  | UIAttributes ** | customData = `nullptr`
| ) |  |

bool save | ( | UTF8StringPtr | filename,
|  | int32_t | flags = `kWriteWindowsResourceFile`
| ) |  |
| virtual

Reimplemented in CompressedUIDescription.

bool saveToStream | ( | OutputStream & | stream,
|  | int32_t | flags
| ) |  |
| protected

bool saveWindowsRCFile | ( | UTF8StringPtr | filename | ) |
| virtual

void setBitmapCreator | ( | IBitmapCreator * | bitmapCreator | ) |

void setController | ( | IController * | controller | ) | const

bool setCustomAttributes | ( | UTF8StringPtr | name,
|  | const SharedPointer< UIAttributes > & | attr
| ) |  |

void setFilePath | ( | UTF8StringPtr | path | ) |

void setFocusDrawingSettings | ( | const FocusDrawing & | fd | ) |

void setSharedResources | ( | const SharedPointer< UIDescription > & | resources | ) |

void setXmlContentProvider | ( | Xml::IContentProvider * | provider | ) |
| protected

bool storeViews | ( | const std::list< CView * > & | views,
|  | OutputStream & | stream,
|  | UIAttributes * | customData = `nullptr`
| ) |  | const

void unregisterListener | ( | UIDescriptionListener * | listener | ) |

void updateViewDescription | ( | UTF8StringPtr | name,
|  | CView * | view
| ) |  |

## Member Data Documentation

CViewAttributeID kTemplateNameAttributeID = 'uitl'
| static

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

- uidescription.h
- uidescription.cpp