IrrlichtEngine
IGUITreeView.h
Go to the documentation of this file.
00001 // This file is part of the "Irrlicht Engine".
00002 // written by Reinhard Ostermeier, reinhard@nospam.r-ostermeier.de
00003 
00004 #ifndef __I_GUI_TREE_VIEW_H_INCLUDED__
00005 #define __I_GUI_TREE_VIEW_H_INCLUDED__
00006 
00007 #include "IGUIElement.h"
00008 #include "IGUIImageList.h"
00009 #include "irrTypes.h"
00010 
00011 namespace irr
00012 {
00013 namespace gui
00014 {
00015         class IGUIFont;
00016         class IGUITreeView;
00017 
00018 
00020         class IGUITreeViewNode : public IReferenceCounted
00021         {
00022         public:
00024                 virtual IGUITreeView* getOwner() const = 0;
00025 
00027 
00028                 virtual IGUITreeViewNode* getParent() const = 0;
00029 
00031                 virtual const wchar_t* getText() const = 0;
00032 
00034                 virtual void setText( const wchar_t* text ) = 0;
00035 
00037                 virtual const wchar_t* getIcon() const = 0;
00038 
00040                 virtual void setIcon( const wchar_t* icon ) = 0;
00041 
00043                 virtual u32 getImageIndex() const = 0;
00044 
00046                 virtual void setImageIndex( u32 imageIndex ) = 0;
00047 
00049                 virtual u32 getSelectedImageIndex() const = 0;
00050 
00052                 virtual void setSelectedImageIndex( u32 imageIndex ) = 0;
00053 
00055                 virtual void* getData() const = 0;
00056 
00058                 virtual void setData( void* data ) = 0;
00059 
00061                 virtual IReferenceCounted* getData2() const = 0;
00062 
00064                 virtual void setData2( IReferenceCounted* data ) = 0;
00065 
00067                 virtual u32 getChildCount() const = 0;
00068 
00070                 virtual void clearChildren() = 0;
00071 
00073 
00075                 _IRR_DEPRECATED_ void clearChilds()
00076                 {
00077                         return clearChildren();
00078                 }
00079 
00081                 virtual bool hasChildren() const = 0;
00082 
00084 
00086                 _IRR_DEPRECATED_ bool hasChilds() const
00087                 {
00088                         return hasChildren();
00089                 }
00090 
00092 
00100                 virtual IGUITreeViewNode* addChildBack(
00101                                 const wchar_t* text, const wchar_t* icon = 0,
00102                                 s32 imageIndex=-1, s32 selectedImageIndex=-1,
00103                                 void* data=0, IReferenceCounted* data2=0) =0;
00104 
00106 
00114                 virtual IGUITreeViewNode* addChildFront(
00115                                 const wchar_t* text, const wchar_t* icon = 0,
00116                                 s32 imageIndex=-1, s32 selectedImageIndex=-1,
00117                                 void* data=0, IReferenceCounted* data2=0 ) =0;
00118 
00120 
00130                 virtual IGUITreeViewNode* insertChildAfter(
00131                                 IGUITreeViewNode* other,
00132                                 const wchar_t* text, const wchar_t* icon = 0,
00133                                 s32 imageIndex=-1, s32 selectedImageIndex=-1,
00134                                 void* data=0, IReferenceCounted* data2=0) =0;
00135 
00137 
00147                 virtual IGUITreeViewNode* insertChildBefore(
00148                                 IGUITreeViewNode* other,
00149                                 const wchar_t* text, const wchar_t* icon = 0,
00150                                 s32 imageIndex=-1, s32 selectedImageIndex=-1,
00151                                 void* data=0, IReferenceCounted* data2=0) = 0;
00152 
00154 
00155                 virtual IGUITreeViewNode* getFirstChild() const = 0;
00156 
00158 
00159                 virtual IGUITreeViewNode* getLastChild() const = 0;
00160 
00162 
00165                 virtual IGUITreeViewNode* getPrevSibling() const = 0;
00166 
00168 
00171                 virtual IGUITreeViewNode* getNextSibling() const = 0;
00172 
00174 
00176                 virtual IGUITreeViewNode* getNextVisible() const = 0;
00177 
00179 
00180                 virtual bool deleteChild( IGUITreeViewNode* child ) = 0;
00181 
00183 
00184                 virtual bool moveChildUp( IGUITreeViewNode* child ) = 0;
00185 
00187 
00188                 virtual bool moveChildDown( IGUITreeViewNode* child ) = 0;
00189 
00191                 virtual bool getExpanded() const = 0;
00192 
00194                 virtual void setExpanded( bool expanded ) = 0;
00195 
00197                 virtual bool getSelected() const = 0;
00198 
00200                 virtual void setSelected( bool selected ) = 0;
00201 
00203                 virtual bool isRoot() const = 0;
00204 
00206 
00207                 virtual s32 getLevel() const = 0;
00208 
00210                 virtual bool isVisible() const = 0;
00211         };
00212 
00213 
00215 
00218         class IGUITreeView : public IGUIElement
00219         {
00220         public:
00222                 IGUITreeView(IGUIEnvironment* environment, IGUIElement* parent,
00223                                 s32 id, core::rect<s32> rectangle)
00224                         : IGUIElement( EGUIET_TREE_VIEW, environment, parent, id, rectangle ) {}
00225 
00227                 virtual IGUITreeViewNode* getRoot() const = 0;
00228 
00230                 virtual IGUITreeViewNode* getSelected() const = 0;
00231 
00233                 virtual bool getLinesVisible() const = 0;
00234 
00236 
00237                 virtual void setLinesVisible( bool visible ) = 0;
00238 
00240 
00246                 virtual void setIconFont( IGUIFont* font ) = 0;
00247 
00249 
00250                 virtual void setImageList( IGUIImageList* imageList ) = 0;
00251 
00253                 virtual IGUIImageList* getImageList() const = 0;
00254 
00256                 virtual void setImageLeftOfIcon( bool bLeftOf ) = 0;
00257 
00259                 virtual bool getImageLeftOfIcon() const = 0;
00260 
00262 
00263                 virtual IGUITreeViewNode* getLastEventNode() const = 0;
00264         };
00265 
00266 
00267 } // end namespace gui
00268 } // end namespace irr
00269 
00270 #endif
00271