Irrlicht 3D Engine: IGUITreeView.h Source File

| Irrlicht 3D Engine |

IGUITreeView.h
Go to the documentation of this file.

    00001 // written by Reinhard Ostermeier, reinhard@nospam.r-ostermeier.de
    00002 // This file is part of the "Irrlicht Engine".
    00003 // For conditions of distribution and use, see copyright notice in irrlicht.h
    00004
    00005 #ifndef __I_GUI_TREE_VIEW_H_INCLUDED__
    00006 #define __I_GUI_TREE_VIEW_H_INCLUDED__
    00007
    00008 #include "IGUIElement.h"
    00009 #include "IGUIImageList.h"
    00010 #include "irrTypes.h"
    00011
    00012 namespace irr
    00013 {
    00014 namespace gui
    00015 {
    00016     class IGUIFont;
    00017     class IGUITreeView;
    00018
    00019
    00021
    00027     class IGUITreeViewNode : public IReferenceCounted
    00028     {
    00029     public:
    00031         virtual IGUITreeView* getOwner() const = 0;
    00032
    00034
    00035         virtual IGUITreeViewNode* getParent() const = 0;
    00036
    00038         virtual const wchar_t* getText() const = 0;
    00039
    00041         virtual void setText( const wchar_t* text ) = 0;
    00042
    00044         virtual const wchar_t* getIcon() const = 0;
    00045
    00047         virtual void setIcon( const wchar_t* icon ) = 0;
    00048
    00050         virtual u32 getImageIndex() const = 0;
    00051
    00053         virtual void setImageIndex( u32 imageIndex ) = 0;
    00054
    00056         virtual u32 getSelectedImageIndex() const = 0;
    00057
    00059         virtual void setSelectedImageIndex( u32 imageIndex ) = 0;
    00060
    00062         virtual void* getData() const = 0;
    00063
    00065         virtual void setData( void* data ) = 0;
    00066
    00068         virtual IReferenceCounted* getData2() const = 0;
    00069
    00071         virtual void setData2( IReferenceCounted* data ) = 0;
    00072
    00074         virtual u32 getChildCount() const = 0;
    00075
    00077         virtual void clearChildren() = 0;
    00078
    00080
    00082         _IRR_DEPRECATED_ void clearChilds()
    00083         {
    00084             return clearChildren();
    00085         }
    00086
    00088         virtual bool hasChildren() const = 0;
    00089
    00091
    00093         _IRR_DEPRECATED_ bool hasChilds() const
    00094         {
    00095             return hasChildren();
    00096         }
    00097
    00099
    00107         virtual IGUITreeViewNode* addChildBack(
    00108                 const wchar_t* text, const wchar_t* icon = 0,
    00109                 s32 imageIndex=-1, s32 selectedImageIndex=-1,
    00110                 void* data=0, IReferenceCounted* data2=0) =0;
    00111
    00113
    00121         virtual IGUITreeViewNode* addChildFront(
    00122                 const wchar_t* text, const wchar_t* icon = 0,
    00123                 s32 imageIndex=-1, s32 selectedImageIndex=-1,
    00124                 void* data=0, IReferenceCounted* data2=0 ) =0;
    00125
    00127
    00137         virtual IGUITreeViewNode* insertChildAfter(
    00138                 IGUITreeViewNode* other,
    00139                 const wchar_t* text, const wchar_t* icon = 0,
    00140                 s32 imageIndex=-1, s32 selectedImageIndex=-1,
    00141                 void* data=0, IReferenceCounted* data2=0) =0;
    00142
    00144
    00154         virtual IGUITreeViewNode* insertChildBefore(
    00155                 IGUITreeViewNode* other,
    00156                 const wchar_t* text, const wchar_t* icon = 0,
    00157                 s32 imageIndex=-1, s32 selectedImageIndex=-1,
    00158                 void* data=0, IReferenceCounted* data2=0) = 0;
    00159
    00161
    00162         virtual IGUITreeViewNode* getFirstChild() const = 0;
    00163
    00165
    00166         virtual IGUITreeViewNode* getLastChild() const = 0;
    00167
    00169
    00172         virtual IGUITreeViewNode* getPrevSibling() const = 0;
    00173
    00175
    00178         virtual IGUITreeViewNode* getNextSibling() const = 0;
    00179
    00181
    00183         virtual IGUITreeViewNode* getNextVisible() const = 0;
    00184
    00186
    00187         virtual bool deleteChild( IGUITreeViewNode* child ) = 0;
    00188
    00190
    00191         virtual bool moveChildUp( IGUITreeViewNode* child ) = 0;
    00192
    00194
    00195         virtual bool moveChildDown( IGUITreeViewNode* child ) = 0;
    00196
    00198         virtual bool getExpanded() const = 0;
    00199
    00201         virtual void setExpanded( bool expanded ) = 0;
    00202
    00204         virtual bool getSelected() const = 0;
    00205
    00207         virtual void setSelected( bool selected ) = 0;
    00208
    00210         virtual bool isRoot() const = 0;
    00211
    00213
    00214         virtual s32 getLevel() const = 0;
    00215
    00217         virtual bool isVisible() const = 0;
    00218     };
    00219
    00220
    00222
    00225     class IGUITreeView : public IGUIElement
    00226     {
    00227     public:
    00229         IGUITreeView(IGUIEnvironment* environment, IGUIElement* parent,
    00230                 s32 id, core::rect<s32> rectangle)
    00231             : IGUIElement( EGUIET_TREE_VIEW, environment, parent, id, rectangle ) {}
    00232
    00234         virtual IGUITreeViewNode* getRoot() const = 0;
    00235
    00237         virtual IGUITreeViewNode* getSelected() const = 0;
    00238
    00240         virtual bool getLinesVisible() const = 0;
    00241
    00243
    00244         virtual void setLinesVisible( bool visible ) = 0;
    00245
    00247
    00253         virtual void setIconFont( IGUIFont* font ) = 0;
    00254
    00256
    00257         virtual void setImageList( IGUIImageList* imageList ) = 0;
    00258
    00260         virtual IGUIImageList* getImageList() const = 0;
    00261
    00263         virtual void setImageLeftOfIcon( bool bLeftOf ) = 0;
    00264
    00266         virtual bool getImageLeftOfIcon() const = 0;
    00267
    00269
    00270         virtual IGUITreeViewNode* getLastEventNode() const = 0;
    00271     };
    00272
    00273
    00274 } // end namespace gui
    00275 } // end namespace irr
    00276
    00277 #endif
    00278