26#ifndef TGUI_BACKEND_HPP
27#define TGUI_BACKEND_HPP
29#include <TGUI/Font.hpp>
30#include <TGUI/Event.hpp>
31#include <TGUI/Cursor.hpp>
41 class BackendFontBase;
42 class BackendTextBase;
43 class BackendTextureBase;
64 TGUI_API
void setBackend(std::shared_ptr<BackendBase> backend);
243 bool m_destroyOnLastGuiDetatch =
false;
244 String m_clipboardContents;
Base class for the backend.
Definition Backend.hpp:83
virtual void setClipboard(const String &contents)
Changes the contents of the clipboard.
virtual std::shared_ptr< BackendTextBase > createText()=0
Creates a new text object.
virtual void resetMouseCursorStyle(Cursor::Type type)=0
Changes the look of a certain mouse cursor back to the system theme.
virtual Font createDefaultFont()=0
Creates and returns the default font for all widgets.
virtual String getClipboard() const
Returns the contents of the clipboard.
virtual ~BackendBase()=default
Virtual destructor.
virtual std::shared_ptr< BackendTextureBase > createTexture()=0
Creates a new texture object.
virtual void attachGui(GuiBase *gui)=0
Informs the backend that a new gui object has been created.
virtual std::shared_ptr< BackendFontBase > createFont()=0
Creates a new font object.
virtual bool isKeyboardModifierPressed(Event::KeyModifier modifierKey)=0
Checks the state for one of the modifier keys.
virtual void detatchGui(GuiBase *gui)=0
Informs the backend that a gui object is being destroyed.
virtual void closeVirtualKeyboard()=0
Closes the virtual keyboard on Android and iOS.
virtual std::unique_ptr< std::uint8_t[]> readFileFromAndroidAssets(const String &filename, std::size_t &fileSize) const
Uses the AssetManager on Android to read a file and return its contents.
virtual void openVirtualKeyboard(const FloatRect &inputRect)=0
Opens the virtual keyboard on Android and iOS.
void setDestroyOnLastGuiDetatch(bool destroyOnDetatch)
Informs the backend whether it should destroy itself when the last Gui is detached from it.
virtual void setMouseCursor(GuiBase *gui, Cursor::Type type)=0
Changes the mouse cursor when the mouse is on top of the window to which the gui is attached.
virtual void setMouseCursorStyle(Cursor::Type type, const std::uint8_t *pixels, Vector2u size, Vector2u hotspot)=0
Changes the look of a certain mouse cursor by using a bitmap.
BackendBase()=default
Default constructor.
Type
List of available cursors.
Definition Cursor.hpp:48
Base class for the Gui.
Definition GuiBase.hpp:45
Wrapper class to store strings.
Definition String.hpp:79
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:36
TGUI_API std::shared_ptr< BackendBase > getBackend()
Returns the global backend.
TGUI_API void setBackend(std::shared_ptr< BackendBase > backend)
Changes the global backend.
TGUI_API bool isBackendSet()
Checks whether the backend differs from a nullptr.
KeyModifier
Modifiers keys.
Definition Event.hpp:156