AppEasy Core SDK  1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
CzStyles.h
Go to the documentation of this file.
00001 // 
00002 //
00003 // AppEasy SDK - Cross Platform Multi-purpose Game and App Engine
00004 //
00005 // Developed by Matthew Hopwood of Pocketeers Limited - www.pocketeers.co.uk
00006 //
00007 // For updates, tutorials and more details check out www.appeasymobile.com
00008 //
00009 // This code is provided free of charge and without any warranty whatsoever. You must ensure that this whole notice is present in all files and derivatives, so the reader knows its origin.
00010 // If you use this SDK in your product then please ensure that you credit AppEasy's usage appropriately. Please see www.appeasymobile.com for licensing details and support
00011 //
00012 //
00013 
00014 #if !defined(_CZ_STYLES_H_)
00015 #define _CZ_STYLES_H_
00016 
00017 #include "CzUtil.h"
00018 #include "CzXoml.h"
00019 
00020 //
00021 //
00022 //
00023 //
00024 //  CzStyleProperty - A style property
00025 //
00026 //
00027 //
00028 //
00029 struct CzStyleProperty
00030 {
00031 public:
00032     CzString    Name;                   // Name of property
00033     CzString    Value;                  // Value of the property
00034 
00035     CzStyleProperty() {}
00036     virtual ~CzStyleProperty() {}
00037 };
00038 
00039 //
00040 //
00041 //
00042 //
00043 //  CzStyle - A class that is used to style other classes
00044 //
00045 //
00046 //
00047 //
00048 class CzStyle : public IzXomlResource
00049 {
00050 public:
00051     // Public access to actor iteration
00052     typedef CzList<CzStyleProperty*>::iterator _Iterator;
00053     _Iterator                   begin() { return Properties.begin(); }
00054     _Iterator                   end() { return Properties.end(); }
00055 public:
00056     // Properties
00057 protected:
00058     CzList<CzStyleProperty*>    Properties;
00059 public:
00060     void                        addProperty(CzStyleProperty* prop);
00061     void                        addProperty(const char* property_name, const char* property_value);
00062     void                        clearProperties();
00063     // Properties end
00064 
00065 public:
00066     CzStyle() : IzXomlResource() { setClassType("style"); }
00067     virtual ~CzStyle()
00068     {
00069         clearProperties();
00070     }
00071 
00072     // Implementation of IzXomlClass interface
00073     int                 LoadFromXoml(IzXomlResource* parent, bool load_children, CzXmlNode* node);
00074 };
00075 
00076 //
00077 //
00078 //
00079 //
00080 //  CzStyleCreator - Creates an instance of a style
00081 //
00082 //
00083 //
00084 //
00085 class CzStyleCreator : public IzXomlClassCreator
00086 {
00087 public:
00088     CzStyleCreator()
00089     {
00090         setClassName("style");
00091     }
00092     IzXomlResource* CreateInstance(IzXomlResource* parent)  { return new CzStyle(); }
00093 };
00094 
00095 
00096 
00097 #endif // _CZ_STYLES_H_