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
CzFacebook.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_FACEBOOK_H_)
00015 #define _CZ_FACEBOOK_H_
00016 
00017 #include "IzPlatformFacebook.h"
00018 #include "CzUtil.h"
00019 #include "CzActions.h"
00020 #include "CzEvents.h"
00021 #include "CzScript.h"
00022 
00023 /**
00024  @class CzFacebook
00025 
00026  @brief A class that is used to interact with Facebook
00027 
00028  */
00029 
00030 class CzFacebook : public IzXomlResource
00031 {
00032 public:
00033     // Properties
00034 protected:
00035     CzEventManager*     EventsManager;          ///< List of events that the camera handles
00036     CzScriptCallback    ScriptCallback;         ///< Script call back
00037 public:
00038     CzEventManager*     getEventsManager()              { return EventsManager; }
00039     CzScriptCallback&   getScriptCallback()             { return ScriptCallback; }
00040     // Properties end
00041 protected:
00042     virtual void        ProcessEventActions(unsigned int event_name, IzXomlResource* parent);
00043 public:
00044     CzFacebook() : IzXomlResource()
00045     {
00046         setClassType("facebook");
00047         EventsManager = new CzEventManager();
00048     }
00049     virtual ~CzFacebook()
00050     {
00051         SAFE_DELETE(EventsManager);
00052     }
00053 
00054     bool                IsLoggedn() const;
00055     bool                Login(const char* permissions[]);
00056     bool                Logout();
00057     bool                InitRequest(const char* method_name, const char* http_method);
00058     bool                AddParamString(const char* parameter, const char* value);
00059     bool                AddParamNumber(const char* parameter, int64 value);
00060     bool                SendRequest();
00061 
00062     // Implementation of IzXomlClass interface
00063     int                 LoadFromXoml(IzXomlResource* parent, bool load_children, CzXmlNode* node);
00064 
00065     // Event handlers
00066     void                NotifyLoggedIn();
00067     void                NotifyLoginError();
00068     void                NotifyResponse();
00069     void                NotifyResponseError();
00070 
00071 };
00072 
00073 /**
00074  @class CzFacebookCreator
00075 
00076  @brief Creates an instance of a Facebook class
00077 
00078  */
00079 
00080 class CzFacebookCreator : public IzXomlClassCreator
00081 {
00082 public:
00083     CzFacebookCreator()
00084     {
00085         setClassName("facebook");
00086     }
00087     IzXomlResource* CreateInstance(IzXomlResource* parent)  { return new CzFacebook(); }
00088 };
00089 
00090 
00091 
00092 
00093 
00094 
00095 #endif // _CZ_FACEBOOK_H_