00001
00009 #pragma once
00010 #include "ManagedObjectTypes.h"
00011 #include "IObjectManager.h"
00012 #include "IManagedObject.h"
00013 #include "IObjectEventHandler.h"
00014
00023 class ManagedObject: public IManagedObject
00024 {
00025 private:
00026 IObjectManager *mManager;
00027 IObjectEventHandler *mEventHandler;
00028 void *mObject;
00030 public:
00031 ManagedObject();
00032 ~ManagedObject();
00033
00039 WDError initRef(void *inNode, IObjectManager *inManager, IObjectEventHandler *inEventHandler);
00040
00046 WDError initRef(IManagedObject *inParent, int inIndex, IObjectEventHandler *inEventHandler);
00047
00053 WDError initNew(const char *inType, IManagedObject *inParent, IObjectEventHandler *inEventHandler);
00054
00055 protected:
00056 IObjectEventHandler* getEventHandler();
00058
00059 public:
00060 void* getNode();
00061 void* getChild(int inIndex);
00062 void getChildType(int inIndex, char *outType, int inMaxLength);
00063 IObjectManager* getManager();
00064 void getType(char *outType, int inMaxLength);
00065
00066 WDError setAttribute(const char *inAttribute, const char *inValue);
00067 WDError getAttribute(const char *inAttribute, char *outValue, int inMaxLength);
00068 int getChildCount();
00069 WDError setName(const char *inName);
00070 WDError getName(char *outName, int inMaxLength);
00071 void* getParentNode();
00072 int getIndex();
00073
00074
00075 public:
00076 void changed(IManagedObject *inTarget);
00077 void childChanged(IManagedObject *inTarget, void *inChild);
00078 void childAdded(IManagedObject *inTarget, void *inChild);
00079
00080 };