Sirikata
liboh/plugins/js/JSObjectStructs/JSCapabilitiesConsts.hpp
Go to the documentation of this file.
00001 
00002 #ifndef __JSCAPABILITIES_CONSTS_HPP__
00003 #define __JSCAPABILITIES_CONSTS_HPP__
00004 
00005 #include <sirikata/core/util/Platform.hpp>
00006 
00007 namespace Sirikata{
00008 namespace JS{
00009 
00010 class JSPresenceStruct;
00011 
00017 struct Capabilities
00018 {
00019     typedef int CapNum;
00020     
00021     enum Caps{
00022         SEND_MESSAGE    = 1,
00023         RECEIVE_MESSAGE = 2,
00024         IMPORT          = 4,
00025         CREATE_PRESENCE = 8,
00026         CREATE_ENTITY   = 16,
00027         EVAL            = 32,
00028         PROX_CALLBACKS  = 64,
00029         PROX_QUERIES    = 128,
00030         CREATE_SANDBOX  = 256,
00031         GUI             = 512,
00032         HTTP            = 1024,
00033         MOVEMENT        = 2048,
00034         MESH            = 4096
00035     };
00036     
00037     static CapNum getFullCapabilities();
00038 
00039 
00040 
00052     static bool givesCap(CapNum capabilitiesNum, Caps checkingCap,
00053         JSPresenceStruct* ctxPres=NULL, JSPresenceStruct* onPres=NULL);
00054 
00055 private:
00056     
00057     //there are several presence-specific capabilities.  Ie, you can perform all of
00058     //these actions on presences you create yourself, but cannot perform them on
00059     //the presence that was passed through to your sandbox.  If checkingCap is
00060     //one of these capabilities, returns true.  Otherwise, return false.
00061     static bool presenceSpecificCap(Caps checkingCap);
00062     
00063 };
00064 
00065 
00066 }//js
00067 }//sirikata
00068 
00069 #endif