00001
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #pragma once
00019
00020 #include "PFExport.h"
00021 #include "IPFAction.h"
00022
00023 PFExport Object* GetPFObject(Object* obj);
00024
00025 #define PFACTIONLIST_INTERFACE Interface_ID(0x74f93d04, 0x1eb34500)
00026 #define GetPFActionListInterface(obj) ((IPFActionList*)((GetPFObject(obj))->GetInterface(PFACTIONLIST_INTERFACE)))
00027
00028 class IPFActionList : public FPMixinInterface
00029 {
00030 public:
00031
00032 enum { kGetNumActions, kGetAction, kAppendAction,
00033 kInsertAction, kRemoveAction, kHasAction,
00034 kIsAction, kIsOperator, kIsTest,
00035 kIsActivated, kActivate, kIsActionActive,
00036 kActivateAction, kGetPViewLocation, kSetPViewLocation,
00037 kGetPViewZOrder, kSetPViewZOrder, kGetListWidth,
00038 kSetListWidth, kGetPViewRightBoundary,
00039 kIsCollapsed, kCollapse, kExpand,
00040 kHasUpStream, kGetSelected, kSetSelected,
00041 kAcceptFertile
00042 };
00043
00044
00045
00046 BEGIN_FUNCTION_MAP
00047
00048 FN_0( kGetNumActions, TYPE_INT, NumActions );
00049 FN_1( kGetAction, TYPE_INODE, GetAction, TYPE_INDEX);
00050 FN_1( kAppendAction, TYPE_bool, AppendAction, TYPE_INODE);
00051 FN_2( kInsertAction, TYPE_bool, InsertAction, TYPE_INODE, TYPE_INDEX);
00052 FN_1( kRemoveAction, TYPE_bool, RemoveAction, TYPE_INDEX);
00053 FN_2( kHasAction, TYPE_bool, HasAction, TYPE_INODE, TYPE_INDEX_BR);
00054 FN_1( kIsAction, TYPE_bool, IsAction, TYPE_INODE);
00055 FN_1( kIsOperator, TYPE_bool, IsOperator, TYPE_INODE);
00056 FN_1( kIsTest, TYPE_bool, IsTest, TYPE_INODE);
00057 FN_0( kIsActivated, TYPE_bool, IsActivated );
00058 VFN_1( kActivate, Activate, TYPE_bool);
00059 FN_1( kIsActionActive, TYPE_INT, IsActionActive, TYPE_INDEX);
00060 VFN_2( kActivateAction, ActivateAction, TYPE_INDEX, TYPE_INT);
00061 VFN_2( kGetPViewLocation, GetPViewLocation, TYPE_INT_BR, TYPE_INT_BR);
00062 VFN_2( kSetPViewLocation, SetPViewLocation, TYPE_INT, TYPE_INT);
00063 FN_0( kGetPViewZOrder, TYPE_INT, GetPViewZOrder );
00064 VFN_1( kSetPViewZOrder, SetPViewZOrder, TYPE_INT);
00065 FN_0( kGetListWidth, TYPE_INT, GetListWidth );
00066 VFN_1( kSetListWidth, SetListWidth, TYPE_INT);
00067 FN_0( kGetPViewRightBoundary, TYPE_INT, GetPViewRightBoundary );
00068 FN_0( kIsCollapsed, TYPE_bool, IsCollapsed );
00069 VFN_0( kCollapse, Collapse );
00070 VFN_0( kExpand, Expand );
00071 FN_0( kHasUpStream, TYPE_bool, HasUpStream );
00072 FN_0( kGetSelected, TYPE_INT, GetSelected );
00073 VFN_1( kSetSelected, SetSelected, TYPE_INT);
00074 FN_0( kAcceptFertile, TYPE_bool, AcceptFertile );
00075
00076 END_FUNCTION_MAP
00077
00085 FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONLIST_INTERFACE); }
00086
00087
00088
00092 virtual int NumActions() const = 0;
00093
00097 virtual INode* GetAction(int index) const = 0;
00098
00102 virtual bool AppendAction(INode* action) = 0;
00103
00107 virtual bool InsertAction(INode* action, int indexAt) = 0;
00108
00112 virtual bool RemoveAction(int index) = 0;
00113
00117 virtual bool HasAction(INode* action, int& index) const = 0;
00118
00122 PFExport static bool IsAction(INode* action);
00123
00127 PFExport static bool IsOperator(INode* action);
00128
00132 PFExport static bool IsTest(INode* action);
00133
00137 virtual bool IsActivated() const = 0;
00138
00142 virtual void Activate(bool active) = 0;
00143
00148 virtual int IsActionActive(int index) const = 0;
00149
00153 virtual void ActivateAction(int index, int active=1) = 0;
00154
00155
00156 enum { kListWidth=180 };
00157
00161 virtual void GetPViewLocation(int& x, int& y) = 0;
00162 #pragma warning(push)
00163 #pragma warning(disable:4100)
00164
00167 virtual void SetPViewLocation(int x, int y) { ; }
00168
00172 virtual int GetPViewZOrder() { return 0; }
00173
00177 virtual void SetPViewZOrder(int z) { ; }
00178
00182 virtual int GetListWidth() { return kListWidth; }
00183
00187 virtual void SetListWidth(int w) { ; }
00188
00192 PFExport int GetPViewRightBoundary();
00193
00197 virtual bool IsCollapsed() { return false; }
00198
00202 virtual void Collapse() { ; }
00203
00207 virtual void Expand() { ; }
00208
00213 virtual bool HasUpStream() { return false; }
00214
00220 virtual int GetSelected() const { return 0; }
00221
00225 virtual void SetSelected(int onOff) { ; }
00226 #pragma warning(pop)
00227
00233 virtual bool AcceptFertile() { return false; }
00234
00238 virtual void UpdateMaterial() { ; }
00239 };
00240
00244 PFExport IPFActionList* GetParentPFActionList(INode* actionNode);
00245
00246 inline IPFActionList* PFActionListInterface(Object* obj) {
00247 return ((obj == NULL) ? NULL : GetPFActionListInterface(obj));
00248 };
00249
00250 inline IPFActionList* PFActionListInterface(INode* node) {
00251 return ((node == NULL) ? NULL : PFActionListInterface(node->GetObjectRef()));
00252 };
00253
00254