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
CzPlatform.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(_CCZ_PLATFORM_H_)
00015 #define _CCZ_PLATFORM_H_
00016 
00017 #include "CzTypes.h"
00018 #include "CzUtil.h"
00019 
00020 class IzPlatformAudio;
00021 class IzPlatformCam;
00022 class IzPlatformComms;
00023 class IzPlatformDisplay;
00024 class IzPlatformFacebook;
00025 class IzPlatformFont;
00026 class IzPlatformFile;
00027 class IzPlatformMarket;
00028 class IzPlatformImaging;
00029 class IzPlatformInput;
00030 class IzPlatformVideo;
00031 class IzPlatformOther;
00032 class IzPlatformRender;
00033 class IzPlatformSys;
00034 class IzPlatformUI;
00035 
00036 //
00037 // IzPlatform - Abstract interface that provides access to platform specific hardware
00038 //
00039 // To add a new platforn, derive your own class from IzPlatform and all other platfrom sub systems and implement all methods
00040 // 
00041 //
00042 // NOTES: The platform system will eventually abstract all Marmalade specific platform code into its own class / classes
00043 //
00044 // IzPlatformAudio -    Abstract interface to audio system
00045 // IzPlatformCam -      Abstract interface to Camera API
00046 // IzPlatformComms -    Abstract interface to communications system
00047 // IzPlatformDisplay -  Abstract interface to display system
00048 // IzPlatformFacebook - Abstract interface to Facebook API
00049 // IzPlatformFile -     Abstract interface to file system
00050 // IzPlatformFont -     Abstract interface to font system
00051 // IzPlatformMarket -   Abstract interface to In app purchasing API
00052 // IzPlatformImaging -  Abstract interface to imaging system
00053 // IzPlatformInput -    Abstract interface to input system
00054 // IzPlatformVideo -    Abstract interface to Video systems
00055 // IzPlatformOther -    Abstract interface to other systems not directly related to the above or utility functionality
00056 // IzPlatformRender -   Abstract interface to 2d rendering system
00057 // IzPlatformSys -      Abstract interface to main hardware systen
00058 // IzPlatformUI -       Abstract interface to UI systems
00059 // 
00060 
00061 class IzPlatform
00062 {
00063 public:
00064     virtual int     Init() = 0;
00065     virtual void    Release() = 0;
00066 
00067     // Query
00068     virtual const char* getName() const = 0;
00069 
00070 };
00071 
00072 #define PLATFORM            CzPlatform::getInstance()
00073 
00074 class CzPlatform
00075 {
00076 private:
00077     static CzPlatform* _instance;
00078     CzPlatform() :  Initialised(false), Sys(NULL), Display(NULL), Input(NULL), Audio(NULL), Comms(NULL), File(NULL), Font(NULL), Imaging(NULL), Video(NULL), Other(NULL), 
00079                     Render(NULL), UI(NULL), Platform(NULL), Cam(NULL), Market(NULL), Facebook(NULL)  {}
00080     virtual ~CzPlatform() {}
00081     CzPlatform(const CzPlatform &);
00082     CzPlatform& operator=(const CzPlatform &);
00083 public:
00084     static void Create();
00085     static void Destroy();
00086     static CzPlatform* getInstance();
00087 
00088     // Properties
00089 protected:
00090     bool                    Initialised;
00091     IzPlatform*             Platform;
00092 public:
00093     bool                    isInitialised() const   { return Initialised; }
00094     IzPlatform*             getPlatform()       { return Platform; }
00095     IzPlatformSys*          getSys()            { return Sys; }
00096     IzPlatformDisplay*      getDisplay()        { return Display; }
00097     IzPlatformInput*        getInput()          { return Input; }
00098     IzPlatformAudio*        getAudio()          { return Audio; }
00099     IzPlatformComms*        getComms()          { return Comms; }
00100     IzPlatformFont*         getFont()           { return Font; }
00101     IzPlatformFile*         getFile()           { return File; }
00102     IzPlatformImaging*      getImaging()        { return Imaging; }
00103     IzPlatformVideo*        getVideo()          { return Video; }
00104     IzPlatformOther*        getOther()          { return Other; }
00105     IzPlatformRender*       getRender()         { return Render; }
00106     IzPlatformUI*           getUI()             { return UI; }
00107     IzPlatformMarket*       getMarket()         { return Market; }
00108     IzPlatformCam*          getCam()            { return Cam; }
00109     IzPlatformFacebook*     getFacebook()       { return Facebook; }
00110     void setSys(IzPlatformSys* p)               { Sys = p; }
00111     void setDisplay(IzPlatformDisplay* p)       { Display = p; }
00112     void setInput(IzPlatformInput* p)           { Input = p; }
00113     void setAudio(IzPlatformAudio* p)           { Audio = p; }
00114     void setComms(IzPlatformComms* p)           { Comms = p; }
00115     void setFont(IzPlatformFont* p)             { Font = p; }
00116     void setFile(IzPlatformFile* p)             { File = p; }
00117     void setImaging(IzPlatformImaging* p)       { Imaging = p; }
00118     void setVideo(IzPlatformVideo* p)           { Video = p; }
00119     void setOther(IzPlatformOther* p)           { Other = p; }
00120     void setRender2d(IzPlatformRender* p)       { Render = p; }
00121     void setUI(IzPlatformUI* p)                 { UI = p; }
00122     void setMarket(IzPlatformMarket* p)         { Market = p; }
00123     void setCam(IzPlatformCam* p)               { Cam = p; }
00124     void setFacebook(IzPlatformFacebook* p)     { Facebook = p; }
00125     // Properties end
00126 
00127 protected:
00128     IzPlatformSys*      Sys;
00129     IzPlatformDisplay*  Display;
00130     IzPlatformInput*    Input;
00131     IzPlatformAudio*    Audio;
00132     IzPlatformComms*    Comms;
00133     IzPlatformFile*     File;
00134     IzPlatformFont*     Font;
00135     IzPlatformVideo*    Video;
00136     IzPlatformImaging*  Imaging;
00137     IzPlatformOther*    Other;
00138     IzPlatformRender*   Render;
00139     IzPlatformUI*       UI;
00140     IzPlatformCam*      Cam;
00141     IzPlatformMarket*   Market;
00142     IzPlatformFacebook* Facebook;
00143 
00144 public:
00145     virtual int     Init(IzPlatform* platform, bool comms, bool use_gl);
00146     virtual void    Release();
00147 
00148 };
00149 
00150 void    CzPlatform_Create();
00151 void    CzPlatform_Destroy();
00152 
00153 #endif  // _CCZ_PLATFORM_H_