IStyle



Describes style which could be applied to form and controls to change visual appearance without changing any source code. Option is just a storage for value of specified data type. For example, style can store border width for some control and when applied that control will retrieve the property and adjust its border widths accordingly.

You can find more information in comments below.

class IStyle
{
public:
    virtual String getClassName() = 0; // Return class name 
    virtual int getImageCount() = 0; // Return image count 
    virtual IStyleImage *getImage(const int index) = 0; // Return image by index 
    virtual IStyleImage *getImage(const String &name) = 0; // Return image by name 
    virtual int getSkinCount() = 0; // Return skin count 
    virtual IStyleSkin *getSkin(const int index) = 0; // Return skin by index 
    virtual IStyleSkin *getSkin(const String &name) = 0; // Return skin by name 
    virtual int getFontCount() = 0; // Return font count 
    virtual IStyleFont *getFont(const int index) = 0; // Return font by index 
    virtual IStyleFont *getFont(const String &name) = 0; // Return font by name 
    virtual int getOptionCount() = 0; // Return option count 

    // Find option by name and store in value if found. If not found, remain unchanged 
    virtual bool getOption(const String &name, String &value) = 0;
    virtual bool getOption(const String &name, int &value) = 0;
    virtual bool getOption(const String &name, float &value) = 0;
    virtual bool getOption(const String &name, bool &value) = 0;
    virtual bool getOption(const String &name, Rect &value) = 0;
    virtual bool getOption(const String &name, RectF &value) = 0;
    virtual bool getOption(const String &name, RectB &value) = 0;
    virtual bool getOption(const String &name, RectC &value) = 0;
    virtual bool getOption(const String &name, Color &value) = 0;
    virtual bool getOption(const String &name, Point &value) = 0;
    virtual bool getOption(const String &name, PointF &value) = 0;
    virtual bool getOption(const String &name, PointB &value) = 0;
    virtual bool getOption(const String &name, Gradient &value) = 0;
    // Since 5.0.0 
    virtual bool getOption(const String &name, unsigned int &value) = 0;

    virtual void Release() = 0; // Destroy instance. For internal usage only 
};
Namespace: nitisa
Include: Nitisa/Interfaces/IStyles.h