00001 #ifndef _element_hh_ 00002 #define _element_hh_ 00003 00004 #include "object.hh" 00005 #include "ability.hh" 00006 #include "shape.hh" 00007 #include "stringhash.hh" 00008 #include <vector> 00009 00010 namespace anoid { 00011 namespace base { 00012 00013 class Element: public Object { 00014 private: 00015 vector<Ability*> childrenA; 00016 protected: 00017 string_map<Ability*> abilities; 00018 Shape *theShape; 00019 public: 00024 virtual Object *add(Object *o); 00025 virtual Ability *lookupAbility(const char *name); 00026 virtual void redraw(); 00027 Shape *getShape() { return theShape; } 00028 virtual vector<Ability*>::iterator beginA() { return childrenA.begin(); } 00029 virtual vector<Ability*>::iterator endA() { return childrenA.end(); } 00030 friend class Ability; 00031 }; 00032 00033 }; 00034 }; 00035 00036 #endif