AppEasy Core SDK
1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
|
CzRemmoteReq - A remote request. More...
#include <CzRemoteReq.h>
Public Member Functions | |
void | setUrl (const char *url) |
const CzString & | getUrl () const |
CzEventManager * | getEventsManager () |
void | setPost (bool post) |
bool | isPost () const |
void | setVariable (const char *variable_name) |
void | setVariable (CzXomlVariable *var) |
CzXomlVariable * | getVariable () |
void | setData (const char *data) |
const CzString & | getData () const |
CzRemoteReq () | |
virtual | ~CzRemoteReq () |
virtual bool | setProperty (unsigned int property_name, const CzXomlProperty &data, bool delta) |
Sets the named property of the Remote Request. | |
bool | setProperty (const char *property_name, const CzString &data, bool delta) |
Sets the named property of the request. | |
virtual bool | setProperty (unsigned int property_name, const CzString &data, bool delta) |
Sets the named property of the request. | |
bool | getProperty (const char *property_name, CzXomlProperty &prop) |
Gets the named property of the request. | |
virtual bool | getProperty (unsigned int property_name, CzXomlProperty &prop) |
int | LoadFromXoml (IzXomlResource *parebt, bool load_children, CzXmlNode *node) |
void | MakeRequest () |
void | DataReceived () |
Static Public Member Functions | |
static void | InitClass () |
Initialises the class. | |
static void | ReleaseClass () |
static bool | _setName (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getName (IzXomlResource *target) |
static bool | _setTag (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static bool | _setURL (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getURL (IzXomlResource *target) |
static bool | _setData (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getData (IzXomlResource *target) |
static bool | _setOnResponse (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static bool | _setOnError (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static bool | _setPost (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getPost (IzXomlResource *target) |
static bool | _setVariable (IzXomlResource *target, const CzXomlProperty &prop, bool add) |
static CzXomlProperty | _getVariable (IzXomlResource *target) |
Protected Member Functions | |
void | ProcessEventActions (unsigned int event_name) |
Protected Attributes | |
CzEventManager * | EventsManager |
CzXomlVariable * | Variable |
CzHttpRequest | Request |
Static Protected Attributes | |
static CzXomlClassDef * | RemoteRequestClassDef = NULL |
CzRemmoteReq - A remote request.
XOML provides many ways of communicating with external data that is located on a web server / web site. Files, images, audio and fonts can for example reside outside the app on some web site and can be loaded on demand by the XOML app. This is a very easy to use automated system that provides very powerful control over what resources you ship with your apps and which you can host on a server and change at any time.
However, its often useful to be able to communicate with a web service or web service, such as send information about the user or the app. For example, your app may store its users data on the server in a database. XOML offers the ability to use both HTTP POST and GET to send and retrieve data to and from a web server.
Heres a short example:
This example creates a remote request definition that calls mywebservice.com and passes the data “name=Mat”. The inner header tag sets the Content-Type header. The server will later send a response which is written into the variable ReqVar1 and calls the GotData actions list allowing you to perform actions when the data I received. If an error occurs then Error actions list will be called instead.
Note that a RemoteReq is not automatically sent when it is created. You need to actually call the request from an action or program command, e.g.:
<Actions Name="GetData"> <Action Method="RemoteReq" P1="Request1" /> </Actions> <Program Name="Program1" AutoRun="true"> <Command Method="remote_req" P1="Request1" /> </Program>
A request will remain in memory for as long as the RemoteReq resource is available. A RemoteReq can be re-used.
CzRemoteReq::CzRemoteReq | ( | ) | [inline] |
CzRemoteReq::~CzRemoteReq | ( | ) | [virtual] |
CzXomlProperty CzRemoteReq::_getData | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzRemoteReq::_getName | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzRemoteReq::_getPost | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzRemoteReq::_getURL | ( | IzXomlResource * | target | ) | [static] |
CzXomlProperty CzRemoteReq::_getVariable | ( | IzXomlResource * | target | ) | [static] |
bool CzRemoteReq::_setData | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzRemoteReq::_setName | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzRemoteReq::_setOnError | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzRemoteReq::_setOnResponse | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzRemoteReq::_setPost | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzRemoteReq::_setTag | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzRemoteReq::_setURL | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
bool CzRemoteReq::_setVariable | ( | IzXomlResource * | target, |
const CzXomlProperty & | prop, | ||
bool | add | ||
) | [static] |
void CzRemoteReq::DataReceived | ( | ) |
const CzString& CzRemoteReq::getData | ( | ) | const [inline] |
CzEventManager* CzRemoteReq::getEventsManager | ( | ) | [inline] |
bool CzRemoteReq::getProperty | ( | const char * | property_name, |
CzXomlProperty & | prop | ||
) |
Gets the named property of the request.
Returns the named property of the request. The properties value is returned in a CzXomlProperty which is a structure that contains a union of all possible property types.
property_name | Name of the property. | |
[out] | prop | The property data. |
bool CzRemoteReq::getProperty | ( | unsigned int | property_name, |
CzXomlProperty & | prop | ||
) | [virtual] |
Returns the named property of the request. The properties value is returned in a CzXomlProperty which is a structure that contains a union of all possible property types.
property_name | Name of the property as a string hash (faster searching). | |
[in,out] | prop | The property. |
const CzString& CzRemoteReq::getUrl | ( | ) | const [inline] |
CzXomlVariable* CzRemoteReq::getVariable | ( | ) | [inline] |
void CzRemoteReq::InitClass | ( | ) | [static] |
Initialises the class.
Sets up the classes avaiiable properties. Used by the XOML system to find, set amd get class properties.
bool CzRemoteReq::isPost | ( | ) | const [inline] |
int CzRemoteReq::LoadFromXoml | ( | IzXomlResource * | parebt, |
bool | load_children, | ||
CzXmlNode * | node | ||
) | [virtual] |
Implements IzXomlResource.
void CzRemoteReq::MakeRequest | ( | ) |
void CzRemoteReq::ProcessEventActions | ( | unsigned int | event_name | ) | [protected] |
void CzRemoteReq::ReleaseClass | ( | ) | [static] |
void CzRemoteReq::setData | ( | const char * | data | ) | [inline] |
void CzRemoteReq::setPost | ( | bool | post | ) | [inline] |
bool CzRemoteReq::setProperty | ( | unsigned int | property_name, |
const CzXomlProperty & | data, | ||
bool | delta | ||
) | [virtual] |
Sets the named property of the Remote Request.
Sets the named property of this Remote Request. The properties value supplied will be converted. If delta is set to true then the existing value of the property will be added to instead of replaced.
property_name | Name of the property as a string hash (faster searching). | |
[in] | data | The property data. |
delta | true if property should be added to instead of replaced. |
bool CzRemoteReq::setProperty | ( | const char * | property_name, |
const CzString & | data, | ||
bool | delta | ||
) |
Sets the named property of the request.
Sets the named property of this request. The properties value (data) is supplied as a string and will be converted. If delta is set to true then the existing value of the property will be added to instead of replaced.
property_name | Name of the property. | |
[in] | data | The property data. |
delta | true if property should be added to instead of replaced. |
bool CzRemoteReq::setProperty | ( | unsigned int | property_name, |
const CzString & | data, | ||
bool | delta | ||
) | [virtual] |
Sets the named property of the request.
Sets the named property of this request. The properties value (data) is supplied as a string and will be converted. If delta is set to true then the existing value of the property will be added to instead of replaced.
property_name | Name of the property as a string hash (faster searching). | |
[in] | data | The property data. |
delta | true if property should be added to instead of replaced. |
void CzRemoteReq::setUrl | ( | const char * | url | ) | [inline] |
void CzRemoteReq::setVariable | ( | const char * | variable_name | ) |
void CzRemoteReq::setVariable | ( | CzXomlVariable * | var | ) | [inline] |
CzEventManager* CzRemoteReq::EventsManager [protected] |
CzXomlClassDef * CzRemoteReq::RemoteRequestClassDef = NULL [static, protected] |
CzHttpRequest CzRemoteReq::Request [protected] |
CzXomlVariable* CzRemoteReq::Variable [protected] |