Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials
IGUIEnvironment.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2010 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 
5 #ifndef __I_GUI_ENVIRONMENT_H_INCLUDED__
6 #define __I_GUI_ENVIRONMENT_H_INCLUDED__
7 
8 #include "IReferenceCounted.h"
9 #include "IGUISkin.h"
10 #include "rect.h"
11 #include "EMessageBoxFlags.h"
12 #include "IEventReceiver.h"
13 #include "IXMLReader.h"
14 #include "path.h"
15 
16 namespace irr
17 {
18  class IOSOperator;
19  class IEventReceiver;
20 
21  namespace io
22  {
23  class IXMLWriter;
24  class IReadFile;
25  class IWriteFile;
26  class IFileSystem;
27  } // end namespace io
28  namespace video
29  {
30  class IVideoDriver;
31  class ITexture;
32  } // end namespace video
33 
34 namespace gui
35 {
36 
37 class IGUIElement;
38 class IGUIFont;
39 class IGUISpriteBank;
40 class IGUIScrollBar;
41 class IGUIImage;
42 class IGUIMeshViewer;
43 class IGUICheckBox;
44 class IGUIListBox;
45 class IGUITreeView;
46 class IGUIImageList;
47 class IGUIFileOpenDialog;
48 class IGUIColorSelectDialog;
49 class IGUIInOutFader;
50 class IGUIStaticText;
51 class IGUIEditBox;
52 class IGUISpinBox;
53 class IGUITabControl;
54 class IGUITab;
55 class IGUITable;
56 class IGUIContextMenu;
57 class IGUIComboBox;
58 class IGUIToolBar;
59 class IGUIButton;
60 class IGUIWindow;
61 class IGUIElementFactory;
62 
64 class IGUIEnvironment : public virtual IReferenceCounted
65 {
66 public:
67 
69  virtual void drawAll() = 0;
70 
72 
77  virtual bool setFocus(IGUIElement* element) = 0;
78 
80 
81  virtual IGUIElement* getFocus() const = 0;
82 
84 
88  virtual bool removeFocus(IGUIElement* element) = 0;
89 
91 
93  virtual bool hasFocus(IGUIElement* element) const = 0;
94 
96 
97  virtual video::IVideoDriver* getVideoDriver() const = 0;
98 
100 
101  virtual io::IFileSystem* getFileSystem() const = 0;
102 
104 
105  virtual IOSOperator* getOSOperator() const = 0;
106 
108  virtual void clear() = 0;
109 
111 
115  virtual bool postEventFromUser(const SEvent& event) = 0;
116 
118 
121  virtual void setUserEventReceiver(IEventReceiver* evr) = 0;
122 
124 
125  virtual IGUISkin* getSkin() const = 0;
126 
128 
140  virtual void setSkin(IGUISkin* skin) = 0;
141 
143 
148  virtual IGUISkin* createSkin(EGUI_SKIN_TYPE type) = 0;
149 
150 
152 
158  virtual IGUIImageList* createImageList( video::ITexture* texture,
159  core::dimension2d<s32> imageSize, bool useAlphaChannel ) = 0;
160 
162 
167  virtual IGUIFont* getFont(const io::path& filename) = 0;
168 
170 
175  virtual IGUIFont* addFont(const io::path& name, IGUIFont* font) = 0;
176 
178 
181  virtual IGUIFont* getBuiltInFont() const = 0;
182 
184 
188  virtual IGUISpriteBank* getSpriteBank(const io::path& filename) = 0;
189 
191 
194  virtual IGUISpriteBank* addEmptySpriteBank(const io::path& name) = 0;
195 
197 
204  virtual IGUIElement* getRootGUIElement() = 0;
205 
207 
215  virtual IGUIButton* addButton(const core::rect<s32>& rectangle,
216  IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, const wchar_t* tooltiptext = 0) = 0;
217 
219 
229  virtual IGUIWindow* addWindow(const core::rect<s32>& rectangle, bool modal = false,
230  const wchar_t* text=0, IGUIElement* parent=0, s32 id=-1) = 0;
231 
233 
239  virtual IGUIElement* addModalScreen(IGUIElement* parent) = 0;
240 
242 
256  virtual IGUIWindow* addMessageBox(const wchar_t* caption, const wchar_t* text=0,
257  bool modal = true, s32 flags = EMBF_OK, IGUIElement* parent=0, s32 id=-1, video::ITexture* image=0) = 0;
258 
260 
268  virtual IGUIScrollBar* addScrollBar(bool horizontal, const core::rect<s32>& rectangle,
269  IGUIElement* parent=0, s32 id=-1) = 0;
270 
272 
283  virtual IGUIImage* addImage(video::ITexture* image, core::position2d<s32> pos,
284  bool useAlphaChannel=true, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
285 
287 
295  virtual IGUIImage* addImage(const core::rect<s32>& rectangle,
296  IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
297 
299 
307  virtual IGUICheckBox* addCheckBox(bool checked, const core::rect<s32>& rectangle,
308  IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
309 
311 
318  virtual IGUIListBox* addListBox(const core::rect<s32>& rectangle,
319  IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) = 0;
320 
322 
331  virtual IGUITreeView* addTreeView(const core::rect<s32>& rectangle,
332  IGUIElement* parent=0, s32 id=-1, bool drawBackground=false,
333  bool scrollBarVertical = true, bool scrollBarHorizontal = false) = 0;
334 
336 
343  virtual IGUIMeshViewer* addMeshViewer(const core::rect<s32>& rectangle,
344  IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
345 
347 
356  virtual IGUIFileOpenDialog* addFileOpenDialog(const wchar_t* title = 0,
357  bool modal=true, IGUIElement* parent=0, s32 id=-1) = 0;
358 
360 
369  virtual IGUIColorSelectDialog* addColorSelectDialog(const wchar_t* title = 0,
370  bool modal=true, IGUIElement* parent=0, s32 id=-1) = 0;
371 
373 
384  virtual IGUIStaticText* addStaticText(const wchar_t* text, const core::rect<s32>& rectangle,
385  bool border=false, bool wordWrap=true, IGUIElement* parent=0, s32 id=-1,
386  bool fillBackground = false) = 0;
387 
389 
403  virtual IGUIEditBox* addEditBox(const wchar_t* text, const core::rect<s32>& rectangle,
404  bool border=true, IGUIElement* parent=0, s32 id=-1) = 0;
405 
407 
417  virtual IGUISpinBox* addSpinBox(const wchar_t* text, const core::rect<s32>& rectangle,
418  bool border=true,IGUIElement* parent=0, s32 id=-1) = 0;
419 
421 
428  virtual IGUIInOutFader* addInOutFader(const core::rect<s32>* rectangle=0, IGUIElement* parent=0, s32 id=-1) = 0;
429 
431 
443  virtual IGUITabControl* addTabControl(const core::rect<s32>& rectangle,
444  IGUIElement* parent=0, bool fillbackground=false,
445  bool border=true, s32 id=-1) = 0;
446 
448 
458  virtual IGUITab* addTab(const core::rect<s32>& rectangle,
459  IGUIElement* parent=0, s32 id=-1) = 0;
460 
462 
470  virtual IGUIContextMenu* addContextMenu(const core::rect<s32>& rectangle,
471  IGUIElement* parent=0, s32 id=-1) = 0;
472 
474 
482  virtual IGUIContextMenu* addMenu(IGUIElement* parent=0, s32 id=-1) = 0;
483 
485 
493  virtual IGUIToolBar* addToolBar(IGUIElement* parent=0, s32 id=-1) = 0;
494 
496 
503  virtual IGUIComboBox* addComboBox(const core::rect<s32>& rectangle,
504  IGUIElement* parent=0, s32 id=-1) = 0;
505 
507 
515  virtual IGUITable* addTable(const core::rect<s32>& rectangle,
516  IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) =0;
517 
519 
522  virtual IGUIElementFactory* getDefaultGUIElementFactory() const = 0;
523 
525 
529  virtual void registerGUIElementFactory(IGUIElementFactory* factoryToAdd) = 0;
530 
532 
533  virtual u32 getRegisteredGUIElementFactoryCount() const = 0;
534 
536 
538  virtual IGUIElementFactory* getGUIElementFactory(u32 index) const = 0;
539 
541 
546  virtual IGUIElement* addGUIElement(const c8* elementName, IGUIElement* parent=0) = 0;
547 
549 
552  virtual bool saveGUI(const io::path& filename, IGUIElement* start=0) = 0;
553 
555 
558  virtual bool saveGUI(io::IWriteFile* file, IGUIElement* start=0) = 0;
559 
561 
564  virtual bool loadGUI(const io::path& filename, IGUIElement* parent=0) = 0;
565 
567 
570  virtual bool loadGUI(io::IReadFile* file, IGUIElement* parent=0) = 0;
571 
573  virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const =0;
574 
577 
579  virtual void writeGUIElement(io::IXMLWriter* writer, IGUIElement* node) =0;
580 
582  virtual void readGUIElement(io::IXMLReader* reader, IGUIElement* node) =0;
583 };
584 
585 
586 } // end namespace gui
587 } // end namespace irr
588 
589 #endif
590 

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Fri Mar 21 2014 04:40:16 by Doxygen (1.8.1.2)