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
CzActionsSys.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_ACTIONS_SYS_H_)
00015 #define _CZ_ACTIONS_SYS_H_
00016 
00017 #include "CzActions.h"
00018 #include "CzXoml.h"
00019 
00020 /**
00021  @addtogroup Actions
00022  @{
00023  */
00024  
00025 /**
00026  @class CzXomlActions_Sys
00027 
00028  @brief Implements actions that are system related
00029 
00030  The CzXomlActions_Sys class holds Actions (IzXomlAction) that deal with system related functionality such as LoadXOML
00031  
00032  The following actions are supported:
00033  - LoadXOML     
00034  - FromTemplate 
00035  - Launch       
00036  - SetBGColour  
00037  - EnterValue   
00038  - Exit         
00039  - DebugText    
00040  - LoadFile     
00041  - PauseTime 
00042 
00043  The above actions have the following XOML prototypes:
00044  - LoadXOML(file-name, scene-name)
00045    - file-name - Name of XOML file to load
00046    - scene-name - Name of scene to load XOML data into, if not supplied then XOML is loaded globally (default)
00047  - FromTemplate(template-name, template-parameters, scene-name)
00048    - template-name - Name of template to instantiate
00049    - template-parameters - Parameters to pass to the template (p1=val1:p2=val2:p3=val3 etc)
00050    - scene-name - Scene where template should be instantiated (optional)
00051  - Launch(url)
00052    - url - URL to launch. The system interprets what should be ran from the protocol name and file name extension. For example passing “mailto:” will send an email, whilst passing “http:” will launch a web page etc..
00053  - SetBGColour(colour)
00054    - colour - Background colour in r, g, b, a format
00055  - EnterValue(message, target-variable, default-text)
00056    - message - Message to show to the user
00057    - target-variable- Variable to place entered text into
00058    - default-text - Default text, if you want to replace the variables value as the default text that is shown to the user
00059  - Exit()
00060  - DebugText(text, variable-name)
00061    - text - Text to output
00062    - variable-name - Variable value to output
00063  - LoadFile(file-resource-name, blocking, new-filename, scene-name)
00064    - file-resource-name - Name of file resource
00065    - blocking - If true then execution will pause until file is loaded
00066    - new-filename - New file name (optional). If new file name is supplied then the new file will be loaded into the file resource
00067    - scene-name - Scene in which file resource lives (optional)
00068  - PauseTime(pause-state)
00069    - pause-state - Pause or un-pause apps time progression
00070 
00071  */
00072 class CzXomlActions_Sys : public IzXomlAction
00073 {
00074 public:
00075     enum eActionType
00076     {
00077         Action_LoadXOML         = 0, 
00078         Action_FromTemplate     = 1, 
00079         Action_Launch           = 2, 
00080         Action_SetBGColour      = 3, 
00081         Action_EnterValue       = 4, 
00082         Action_Exit             = 5, 
00083         Action_DebugText        = 6, 
00084         Action_LoadFile         = 7, 
00085         Action_PauseTime        = 8, 
00086         Action_Max              = 9, 
00087     };
00088 protected:
00089     eActionType Type;
00090     CzXomlActions_Sys() {}
00091 public:
00092     CzXomlActions_Sys(eActionType type)
00093     {
00094         Type = type;
00095         switch (Type)
00096         {
00097         case Action_LoadXOML:
00098             setActionName("loadxoml");
00099             break;
00100         case Action_FromTemplate:
00101             setActionName("fromtemplate");
00102             break;
00103         case Action_Launch:
00104             setActionName("launch");
00105             break;
00106         case Action_SetBGColour:
00107             setActionName("setbgcolour");
00108             break;
00109         case Action_EnterValue:
00110             setActionName("entervalue");
00111             break;
00112         case Action_Exit:
00113             setActionName("exit");
00114             break;
00115         case Action_DebugText:
00116             setActionName("debugtext");
00117             break;
00118         case Action_LoadFile:
00119             setActionName("loadfile");
00120             break;
00121         case Action_PauseTime:
00122             setActionName("pausetime");
00123             break;
00124         }
00125     }
00126     void Execute(IzXomlResource* source, CzAction* action);
00127 };
00128 
00129 /// @}
00130 
00131 #endif // _CZ_ACTIONS_SYS_H_