﻿GSlideAPI["Environment"]["OS"] # Holds info about the running OS.
GSlideAPI["Environment"]["CFVersion"] # Holds info about the installed CF version.
GSlideAPI["Environment"]["MortVersion"] # Holds the MortScript version number, is MortScript is installed.
GSlideAPI["Environment"]["Screen"] # Holds info on screen resolution.
GSlideAPI["Paths"]["GSlideStateFile"] # Path to the gslide.state.xml file
GSlideAPI["Paths"]["GSlideInstall"] # Path to the GSlide.exe
GSlideAPI["Paths"]["MortScriptInstall"] # Path to the MortScript.exe
GSlideAPI["Paths"]["ActionsDefault"] # Path to the default actions folder (mscr scripts).
GSlideAPI["Paths"]["Clipbook"] # Path to the clipbook.txt file
GSlideAPI["Paths"]["ActionsClipbook"] # Path to the Actions save file. Here actions store previous GSlide state for later use.
GSlideAPI["Paths"]["ActionsCallback"] # Path to the gslide.callback.xml file.
GSlideAPI["Paths"]["Registry"]["Shortcuts"]
GSlideAPI["Paths"]["Resources"]["Applications"]
GSlideAPI["Paths"]["Resources"]["Cache"] # Path to the default Cache directory. Use for caching of Context specific stuff like web feeds, images etc.

GSlideAPI["State"]["SelectedItem"]["Id"] # Holds the current selected items id
GSlideAPI["State"]["SelectedItem"]["FilePath"] # Holds the current selected items path
GSlideAPI["State"]["SelectedItem"]["FileName"] # Holds the current selected items file name
GSlideAPI["State"]["SelectedItem"]["Container"] # Holds true/false depending on if the current selected item is a folder or not.
GSlideAPI["State"]["SelectedItem"]["NameShort"] # Holds the current selected items file name wo extension.
GSlideAPI["State"]["SelectedItem"]["CurrentFolder"] # Holds the current active folder (if we are using the device file system as provider).
GSlideAPI["State"]["SelectedItem"]["TypeName"] # Holds the extension of the current item. If its a JSON item this can be set to anything.
GSlideAPI["State"]["VirtualRootPath"] # Holds the current Contexts root folder.
GSlideAPI["State"]["Context"] # Holds the name of the current Context.
GSlideAPI["State"]["CurrentFolder"] # Holds the current active folder (if we are using the device file system as provider).
GSlideAPI["State"]["ScreenX"] # Holds the number of pixels in the X axis of the screen.
GSlideAPI["State"]["ScreenY"] # Holds the number of pixels in the Y axis of the screen.
GSlideAPI["State"]["Filter"] # Holds the current file type filter (*.*, *.txt, or similar).
GSlideAPI["State"]["FolderHistory"] # Holds the folder navigation history separated by ;
GSlideAPI["State"]["FolderHistoryArray"] #  Holds the folder navigation history stored in an array.
GSlideAPI["State"]["CursorPosX"]  # Holds the X position which the user clicked last.
GSlideAPI["State"]["CursorPosY"] Holds the Y position which the user clicked last.
GSlideAPI["State"]["LatestActiveTouchFace"]  # Holds the most recently clicked TouchFace
Sub GSlideAPI.ReadState() # Reads and parses the gslide.state.xml file. All values from the file are placed in the GSlideAPI["State"] objects.
Sub GSlideAPI.CopyToClipbook() # Adds the selected item path to the Clipbook.txt file.
Sub GSlideAPI.MoveFromClipbook() # Shows a choice dialog and lets the user MOVE files added to the Clipbook.txt to either the current folder, or select a folder from a list.
Sub GSlideAPI.CopyFromClipbook() # Shows a choice dialog and lets the user COPY files added to the Clipbook.txt to either the current folder, or select a folder from a list.
Sub GSlideAPI.ClearClipbook() # Clears all values written to the Clipbook.txt file. This does not affect the actual files in any way.

GSlideAPI["Actions"]["Clipbook"] # This Array holds all the values from a copied (see GSlideAPI.Action.CopyStateToClipbook), previous GSlide state. This Array is filled by calling GSlideAPI.Action.ReadActionsClipbook().
GSlideAPI["Actions"]["Clipbook"]["SelectedItem"]["FilePath"] # Path to the file which was selected at the time.
GSlideAPI["Actions"]["Clipbook"]["SelectedItem"]["FileName"] # Name of the file which was selected at the time.
GSlideAPI["Actions"]["Clipbook"]["SelectedItem"]["Container"] # Was it a folder (true/false)
GSlideAPI["Actions"]["Clipbook"]["SelectedItem"]["CurrentFolder"] # Path to the folder which was selected at the time.
GSlideAPI["Actions"]["Clipbook"]["VirtualRootPath"] # Virtual root of the Context.
GSlideAPI["Actions"]["Clipbook"]["Context"] # Name of the Context.
GSlideAPI["Actions"]["Clipbook"]["Filter"] # File filter that was used.
GSlideAPI["Actions"]["Clipbook"]["FolderHistory"] # Navigation history separated by ;
GSlideAPI["Actions"]["Clipbook"]["FolderHistoryArray"] # Navigation history stored in an Array.

GSlideAPI["Actions"]["Callback"]["MethodCalls"] # Holds all MethodCall objects (nested Arrays). 
GSlideAPI["Actions"]["Callback"]["MethodCalls"][MethodName] # MethodName must correspond to method names published by the GSlide app. See CallbackMethods.
GSlideAPI["Actions"]["Callback"]["MethodCalls"][MethodName]["Params"] # The Params Array holds a nested Array with paired Param names/values.
GSlideAPI["Actions"]["Callback"]["MethodCalls"][MethodName]["Params"][ParameterName] # Array with paired Param names/values (GSlideAPI["Actions"]["Callback"]["MethodCalls"]["SomeMethod"]["Params"]["SomeParameter"] = "Some value")
Sub GSlideAPI.Action.WriteToCallback() # Saves all commands in the GSlideAPI["Actions"]["Callback"]["MethodCalls"] array to the gslide.callback.xml
Sub GSlideAPI.Action.CopyStateToClipbook() # Copies the current state to the Actions clipbook for later use.
Sub GSlideAPI.Action.CopyClipbookToState() # Saves the saved state back to the gslide.state.xml file, thus re-setting the state to a previous version.
Sub GSlideAPI.Action.ReadActionsCallback() # Reads all the info in the callback file.
Sub GSlideAPI.Action.ReadActionsClipbook() # Reads the Clipbook file.
Sub GSlideAPI.Action.SetFilter(String Filter) # Sets a new file type filter
Sub GSlideAPI.Action.SetListBackground(String ImageName)
Sub GSlideAPI.Action.SetContainerIcon(String ImageName)
Sub GSlideAPI.Action.SetItemIcon(String ImageName)
Sub GSlideAPI.Action.IncludeItemBody(String "true"/"false")
Sub GSlideAPI.Action.SetEventHandler(String ForEvent, String ScriptName)
Sub GSlideAPI.Action.ChangeDirectory(String path,)
Sub GSlideAPI.Action.ChangeContext(String ContextName, String Path, String ActAsRoot "true"/"false")
Sub GSlideAPI.Action.ViewItemAsText(String JSONString) # Loads one or more item and displays its body attribute. A typical use would be a text viewer. * Requires GSlideAPI.UI to be included. *
Sub GSlideAPI.Action.HideListIcons()
Sub GSlideAPI.Action.ShowListIcons()
Sub GSlideAPI.Action.HideItemName()
Sub GSlideAPI.Action.ShowItemName()
Sub GSlideAPI.Action.DoSingleCallback(String MethodName, Array Params)

GSlideAPI["Remote"]["ConnectionName"] # Must hold the name of data connection to use when connecting to the internet (defaults to "Internet"). 
GSlideAPI["Remote"]["ResultPath"] # Must hold the path to save any downloaded content to (rss, json, images etc)
GSlideAPI["Remote"]["RemoteService"]["HostAdress"] # IP number or URL.
GSlideAPI["Remote"]["RemoteService"]["QueryString"] # The query string to add to the address, if needed. 
Sub GSlideAPI.Remote.DownloadContent() # Executes the download and saves any result according to the GSlideAPI["Remote"]["ResultPath"] parameter.
Sub GSlideAPI.Remote.ImportResult() # Sends the most recent downloaded content to GSlide. This works only with JSON formated data, have a look at the GSlideAPI.JSON namespace for more info.
Function String JsonString = GSlideAPI.Remote.ReadResult() # Reads the most recent downloaded data.
Sub GSlideAPI.Remote.DeleteResult() # Deletes the most recent downloaded data.

Sub GSlideAPI.JSON.SendToGSlide(String JSONString) # Sends provided JSON data to GSlided.
Function String JSONString = GSlideAPI.JSON.XMLtoJSON(String ObjectRootElement, Array ElementList[]) # Formats single dimension XML data to JSON.

GSlideAPI["UI"]["Faces"] # Holds nested Arrays with all TouchFaces for any specific case.
GSlideAPI["UI"]["Faces"]["Face"] # Holds all values for a specific TouchFace.
GSlideAPI["UI"]["Faces"]["Face"]["Width"] # Width of the TouchFace.
GSlideAPI["UI"]["Faces"]["Face"]["Height"] # Height of the TouchFace.
GSlideAPI["UI"]["Faces"]["Face"]["Top"] # Top placement of the TouchFace.
GSlideAPI["UI"]["Faces"]["Face"]["Left"] # Left placement of the TouchFace.
GSlideAPI["UI"]["Faces"]["Face"]["Id"] # Unique id for the TouchFace.
GSlideAPI["UI"]["Faces"]["Face"]["Action"] # Script to be called if the TouchFace is clicked.

Sub GSlideAPI.UI.CloseMessage # Removes the overlay.
Sub GSlideAPI.UI.TogglePauseMode # Pauses the GSlide app (the same as sending the space key to the GSlide.exe).
Sub GSlideAPI.UI.CalculateTextBoxHeight(int StrLength) # Calculates how much height the provided string will demand with the current font size and available screen width.
Sub GSlideAPI.UI.Face.OnClick(Face[] Faces) # Checks if any of the TouchFaces was clicked.
Sub GSlideAPI.UI.HideItemName() # Hides name string of all items in the list
Sub GSlideAPI.UI.ShowItemName() # Shows name string of all items in the list if they where hidden before.
Sub GSlideAPI.UI.SetListBackground(string imagename) # Changes the background for the list. This image is tiled to fill the entire lis height.
Sub GSlideAPI.UI.SetContainerIcon(string imagename) # Change the icon image for containers (folders).
Sub GSlideAPI.UI.SetItemIcon(string imagename) # Change the icon image for items (files etc).
Sub GSlideAPI.UI.IncludeItemBody() # Includes the body text of an item (if a body attribute was sent with the item/items with the JSON string).
Sub Sub GSlideAPI.UI.ShowListIcons() # Shows icons for all list items.
Sub GSlideAPI.UI.HideListIcons() #  Hides the icons for all list items.
Sub GSlideAPI.UI.SetRowHeight(int pixels) # Changes the height of all rows in the list. Used with includeItemBody for example.

Key [Insert] # Makes GSlide read the ActionsCallback.xml file and run your commands.
Key [Space] # Locks the GSlide list so that the user can not do any funny stuff.
Key [Home] # Goes to the directory which is set as root for the current context.
Key [Backspace] # Goes back one step in the history list.

CallBack method "showmessage", Params: String Message, String Background image (if not supplied the default message background image spec. in the context.xml file will be used), Margin left (-1 centers), Margin top (-1 centers)
CallBack method "hidemessage"
CallBack method "setmessagetext", Params: String Message
CallBack method "setmessagebackgroundimage", Param: String Image name (which resides in the current contexts folder root)
CallBack method "changedirectory", Params: String Path (Any valid path)
CallBack method "changecontext", Params: String Context (simply the name of the Context folder which will be used), Start path (The start folder in a file system. Can be root if parameter 3 is set to true), Act as root (true/false), History array (This is a string which represents the navigation history. Very handy if you want to let the user go back to the previous position.)
CallBack method "minimize"
CallBack method "exit"
CallBack method "loadhistory", Params: String History JSON array
CallBack method "loadfromjson", Params: String JSON ({"items":[{"name":"Test item","path":"null","container":"false","id":"1","body":"Any text"},.....]})
CallBack method "setfilter", Params: String Filter (*.*, a*.*,*.txt etc)
CallBack method "deletecallback"
CallBack method "setbordercolor", Params: String Hex value ("#ffffff" etc)
CallBack method "setrowheight", Params: Int number of pixels.
CallBack method "setdisablescrolling", Params: Boolean string "true"/"false"
CallBack method "setdisableselection", Params: Boolean string "true"/"false"
CallBack method "setincludeitembody", Params: Boolean string "true"/"false"
CallBack method "sethideicons", Params: Boolean string "true"/"false"
CallBack method "seticonpath", Params: String Path (path to icons)
CallBack method "setdefaultcontainerimage", Params: String Image name (which resides in the current contexts folder root)
CallBack method "setdefaultitemimage", Params: String Image name (which resides in the current contexts folder root)
CallBack method "settopbartext", Params: String Message (any text message)
CallBack method "settopbarimage", Params: String Image name (which resides in the current contexts folder root)
CallBack method "setbackgroundimage", Params: String Image name (which resides in the current contexts folder root)
CallBack method "seticonpath", Params: String Path to icon folder (Will reskin GSlide without changing context. Makes it possible to have many Icon folders in the same context)
CallBack method "seteventhandler", Params: String Event (ondoubleclick (script to execute when you double click any item or folder), onsweepright (script to execute when you sweep right on any item or folder), onsweepleft (script to execute when you sweep left on any item or folder), onapplicationstart (script to execute when GSlide starts. Good for init stuff), onapplicationexit (script to execute when GSlide exits. Good for saving history or any state information), onactivate (script to execute when GSlide recieves focus), ondeactivate (script to execute when GSlide loses focus), ontopbarclick (script to execute when the top bar is double clicked), ontopbardoubleclick (script to execute when the top bar is double clicked), ontopbarsweepright (script to execute when you sweep the top bar right), ontopbarsweepleft (script to execute when you sweep the top bar left), onmessagedoubleclick (script to execute when you double click on a message), onmessageclick (script to execute when you click on a message)), String Event handler script (anyscript.mscr), String ScriptEngine (default is MortScript if you leave this "")

Sub GSlideAPI.UI.ShowMessage(String MessageString, String BackgroundImagePath, Int MarginLeft, Int MarginTop, String OnClickCallbackScript, String FaceFileName) # Its usually a bad idea to use both TouchFaces AND an OnClickCallbackScript since GSlide will process both event handlers and possibly make your app buggy.
Sub GSlideAPI.UI.LoadFaces(String FaceFileName) # Clears all current TouchFaces and loads all the ones specified in the ThouchFace file (all default faces are stored in Actions/Resources/UI/Faces/).

Sub GSlideAPI.ReadRegistryKey(String KeyName) # Reads a key from the GSlide registry (Actions/Resources/Registry/).
Sub GSlideAPI.AddRegistryKey(String KeyName,KeyValue) # Saves a key to the GSlide registry (Actions/Resources/Registry/).

MortXML["Document"]["Elements"]["Dictionary"] # If you know which element your looking for, the "Dictionary" collection holds a list of all unique tags. Each individual tag is then indexed from 1 to *
MortXML["Document"]["Elements"] # With the Elements collection you access elements at their level of depth in the document.  MortXML["Document"]["Elements"][1]["book"]
Sub MortXml.XmlDoc.ParseXMLDocument(String FilePath,String ElementFilter) # This reads and parses all elements that match the ElementFilter parameter ("*" reads all elements). The result of the parsing process is stored in the MortXML["Document"]["Elements"] /  MortXML["Document"]["Elements"]["Dictionary"] collections.
Sub MortXML.XmlDoc.GrabElement(string tagName [,int startSearchAt]) # Very usefull! First load the xml file then you can get the first occurance of a specific tag. Use the startSearchAt to get the next occurance. Returns: Array[1] = Tag contents, Array[2] = Next start position
Sub MortXml.XmlDoc.ReadXMLDocument(string FilePath) # Loads an xml file into the MortXML["Document"]["XML"] variable. No parsing is done.