CGUIEditFactory.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #ifndef __C_GUIEDIT_FACTORY_H_INCLUDED__
  5. #define __C_GUIEDIT_FACTORY_H_INCLUDED__
  6. #include "IGUIElementFactory.h"
  7. namespace irr
  8. {
  9. namespace gui
  10. {
  11. class IGUIElement;
  12. class IGUIEnvironment;
  13. //! Interface making it possible to dynamically create gui elements
  14. class CGUIEditFactory : public IGUIElementFactory
  15. {
  16. public:
  17. CGUIEditFactory(IGUIEnvironment* env);
  18. ~CGUIEditFactory();
  19. //! adds a GUI element to the GUI Environment based on its type name
  20. /** \param typeName: Type name of the element to add.
  21. \param parent: Parent scene node of the new element, can be null to add it to the root.
  22. \return Returns pointer to the new element or null if not successful. */
  23. virtual IGUIElement* addGUIElement(const c8* typeName, IGUIElement* parent=0);
  24. //! returns amount of GUI element types this factory is able to create
  25. virtual s32 getCreatableGUIElementTypeCount() const;
  26. //! returns type name of a creatable GUI element type by index
  27. /** \param idx: Index of the type in this factory. Must be a value between 0 and
  28. getCreatableGUIElementTypeCount() */
  29. virtual const c8* getCreateableGUIElementTypeName(s32 idx) const;
  30. // not used:
  31. virtual const c8* getCreateableGUIElementTypeName(EGUI_ELEMENT_TYPE type) const {return 0;} ;
  32. virtual EGUI_ELEMENT_TYPE getCreateableGUIElementType(s32 idx) const { return EGUIET_ELEMENT;};
  33. virtual IGUIElement* addGUIElement(EGUI_ELEMENT_TYPE type, IGUIElement* parent=0) {return 0;};
  34. private:
  35. IGUIEnvironment* Environment;
  36. };
  37. } // end namespace scene
  38. } // end namespace irr
  39. #endif