API Documentation
ComponentUtils.h
1 // ComponentUtils.h
3 //
5 
6 namespace nkWinUi
7 {
12  {
13  public :
14 
15  // Constructeur, destructeur
21  ComponentUtils () noexcept ;
27  virtual ~ComponentUtils () ;
28 
29  // Fonctions utilitaires à refaire pour automatiser au maximum dans la classe Component
30  // Dimensions
38  virtual nkMaths::Rectangle getComponentSize (const Component* component) = 0 ;
42  virtual nkMaths::Rectangle getScreenDimensions () = 0 ;
43 
44  // Conversions
55  virtual nkMaths::Point getComponentCoordFromScreenCoord (const Component* component, nkMaths::Point screenCoord) = 0 ;
66  virtual nkMaths::Point getScreenCoordFromComponentCoord (const Component* component, nkMaths::Point componentCoord) = 0 ;
67 
68  // Positioning
76  virtual nkMaths::Rectangle getComponentDimensions (const Component* component) = 0 ;
87  virtual void setComponentPosition (Component* component, float x, float y) = 0 ;
98  virtual void setComponentSize (Component* component, float width, float height) = 0 ;
111  virtual void setComponentDimensions (Component* component, float x, float y, float width, float height) = 0 ;
112 
113  // Visibility
121  virtual bool getComponentVisibility (const Component* component) = 0 ;
131  virtual void setComponentVisibility (Component* component, bool visibleOrNot) = 0 ;
132 
133  // Enabling
141  virtual bool isComponentEnabled (const Component* component) = 0 ;
151  virtual void setComponentEnabled (Component* component, bool enabledOrNot) = 0 ;
152 
153  // Focus
162  virtual void setComponentFocus (Component* component) = 0 ;
163 
164  // Hiérarchie
172  virtual bool isComponentInForeground (const Component* component) = 0 ;
181  virtual void setComponentInForeground (Component* component) = 0 ;
182 
183  // Label
193  virtual void setComponentLabel (Component* component, nkMemory::StringView label) = 0 ;
194 
195  // Update
204  virtual void updateComponent (Component* component) = 0 ;
213  virtual void freezeComponentPainting (Component* component, bool value) = 0 ;
214 
215  // Images
226  virtual nkImages::Image paintToImage (Component* component, bool withFrame) = 0 ;
227 
228  // Cursor
232  virtual nkMaths::Point getCursorPosition () = 0 ;
238  virtual void setCursorPosition (nkMaths::Point absPos) = 0 ;
239 
240  // Fonts
247  virtual nkMemory::BufferCast<nkMemory::String> getAvailableFontFaces () = 0 ;
256  virtual nkMemory::BufferCast<unsigned int> getCharactersWidth (nkMemory::BufferView<char> characters, Font* font) = 0 ;
257  } ;
258 }
nkWinUi::ComponentUtils::freezeComponentPainting
virtual void freezeComponentPainting(Component *component, bool value)=0
nkWinUi::ComponentUtils::setComponentPosition
virtual void setComponentPosition(Component *component, float x, float y)=0
nkWinUi::ComponentUtils::updateComponent
virtual void updateComponent(Component *component)=0
nkWinUi::Image
Abstracts an image to be used within the component.
Definition: Image.h:12
nkWinUi::ComponentUtils
Offers many utilities to deal with the components, specialized for its windowing system.
Definition: ComponentUtils.h:12
nkWinUi::ComponentUtils::setComponentVisibility
virtual void setComponentVisibility(Component *component, bool visibleOrNot)=0
nkMaths
Encompasses all API of component NilkinsMaths.
Definition: IntVector.h:7
nkWinUi::ComponentUtils::setComponentEnabled
virtual void setComponentEnabled(Component *component, bool enabledOrNot)=0
nkWinUi::ComponentUtils::setComponentSize
virtual void setComponentSize(Component *component, float width, float height)=0
nkWinUi::ComponentUtils::setCursorPosition
virtual void setCursorPosition(nkMaths::Point absPos)=0
nkWinUi::Font
Offers an interface to work with fonts.
Definition: Font.h:14
nkWinUi::ComponentUtils::setComponentFocus
virtual void setComponentFocus(Component *component)=0
nkWinUi::ComponentUtils::isComponentEnabled
virtual bool isComponentEnabled(const Component *component)=0
nkWinUi::ComponentUtils::setComponentDimensions
virtual void setComponentDimensions(Component *component, float x, float y, float width, float height)=0
nkWinUi::ComponentUtils::getScreenCoordFromComponentCoord
virtual nkMaths::Point getScreenCoordFromComponentCoord(const Component *component, nkMaths::Point componentCoord)=0
nkWinUi::ComponentUtils::setComponentLabel
virtual void setComponentLabel(Component *component, nkMemory::StringView label)=0
nkWinUi::Component
Base class for any graphical component.
Definition: Component.h:12
nkWinUi::ComponentUtils::ComponentUtils
ComponentUtils() noexcept
nkWinUi::ComponentUtils::getCharactersWidth
virtual nkMemory::BufferCast< unsigned int > getCharactersWidth(nkMemory::BufferView< char > characters, Font *font)=0
nkWinUi::ComponentUtils::isComponentInForeground
virtual bool isComponentInForeground(const Component *component)=0
nkImages
Encompasses all API of component NilkinsImages.
Definition: BmpEncoder.h:7
nkWinUi::ComponentUtils::getComponentCoordFromScreenCoord
virtual nkMaths::Point getComponentCoordFromScreenCoord(const Component *component, nkMaths::Point screenCoord)=0
nkWinUi::ComponentUtils::getAvailableFontFaces
virtual nkMemory::BufferCast< nkMemory::String > getAvailableFontFaces()=0
nkWinUi::ComponentUtils::getComponentSize
virtual nkMaths::Rectangle getComponentSize(const Component *component)=0
nkWinUi::ComponentUtils::paintToImage
virtual nkImages::Image paintToImage(Component *component, bool withFrame)=0
nkWinUi::ComponentUtils::getCursorPosition
virtual nkMaths::Point getCursorPosition()=0
nkWinUi::ComponentUtils::getScreenDimensions
virtual nkMaths::Rectangle getScreenDimensions()=0
nkWinUi
Encompasses all API of component NilkinsWinUi.
Definition: Clipboard.h:7
nkWinUi::ComponentUtils::getComponentDimensions
virtual nkMaths::Rectangle getComponentDimensions(const Component *component)=0
nkWinUi::ComponentUtils::getComponentVisibility
virtual bool getComponentVisibility(const Component *component)=0
nkWinUi::ComponentUtils::setComponentInForeground
virtual void setComponentInForeground(Component *component)=0
nkMemory
Encompasses all API of component NilkinsMemory.
Definition: Allocator.h:7