00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __OP_CommandManager__
00020 #define __OP_CommandManager__
00021
00022 #include "OP_API.h"
00023 #include <CH/CH_ChannelRef.h>
00024 #include <CMD/CMD_Manager.h>
00025
00026 class UT_WorkBuffer;
00027 class OP_Node;
00028 class PRM_Parm;
00029 class CH_Channel;
00030
00031
00032 class OP_API OP_CommandManager: public CMD_Manager
00033 {
00034 public:
00035 OP_CommandManager(const char *appname, int load_dsos = 1);
00036 virtual ~OP_CommandManager();
00037
00038
00039
00040
00041 virtual void getChRefData(const CH_ChannelRef &r,
00042 OP_Node **pnode, CH_Channel **pchp,
00043 PRM_Parm **ppparm, int *subindex) const;
00044
00045 virtual OP_Node *getChRefOpNode(const CH_ChannelRef &r) const;
00046
00047 virtual PRM_Parm *getChRefParm(const CH_ChannelRef &r,
00048 int *subindex ) const;
00049
00050 virtual PRM_Parm *getChRefFullParm(const CH_ChannelRef &r) const;
00051
00052 virtual CH_Channel *getChRefChannel(const CH_ChannelRef &r) const;
00053
00054 virtual bool isOwnerExposed(const CH_ChannelRef &r) const;
00055
00056
00057
00058
00059 bool match(const CH_ChannelRef &r, const char *patt) const;
00060
00061
00062
00063
00064
00065
00066 virtual bool buildChanRef(CH_ChannelRef &r,
00067 const CH_Channel *chp) const;
00068
00069 virtual bool buildChanRef(CH_ChannelRef &r,
00070 const OP_Node *node,
00071 const PRM_Parm *parm) const;
00072
00073 virtual bool buildChanRef(CH_ChannelRef &r,
00074 const OP_Node &node,
00075 const char *channel_name) const;
00076
00077 virtual bool buildChanRef(CH_ChannelRef &r,
00078 const OP_Node *node,
00079 const PRM_Parm *parm,
00080 int subindex) const;
00081 virtual bool buildChanRef(CH_ChannelRef &r,
00082 const char *path) const;
00083
00084
00085
00086 virtual int compareChanRefs(const CH_ChannelRef &r1,
00087 const CH_ChannelRef &r2) const;
00088
00089
00090 virtual void getChanRefPath(const CH_ChannelRef &r,
00091 UT_String &path,
00092 bool use_alias = false) const;
00093
00094
00095 void getChanRefsPythonListCode(
00096 const CH_ChannelRefList &chanrefs,
00097 UT_WorkBuffer &result);
00098
00099
00100 static void getChRefUniqueNodes(const CH_ChannelRefList &chanrefs,
00101 UT_PtrArray<OP_Node *> &nodes);
00102
00103
00104 bool inTrustedContextForNode(const OP_Node *node, int thread) const;
00105 bool inTrustedContextForNodeContents(
00106 const OP_Node *node, int thread) const;
00107
00108 virtual CH_ScriptAccessManager *getAccessManager(int thread);
00109 };
00110
00111 #endif