Debian Codegraph @

include/ui/iusercontrol.h

raw
1 #pragma once
2
3 #include <memory>
4 #include <string>
5
6 class wxWindow;
7
8 namespace ui
9 {
10
11 /**
12 * @brief An object which can create dockable widgets of a specific type.
13 *
14 * Each IUserControlCreator instance is responsible for creating dockable widgets of a
15 * single type (e.g. ortho view, media browser etc), via its createWidget() method. The
16 * IUserInterfaceModule maintains a set of control creators, which can be populated
17 * dynamically via various UI modules and implementation code.
18 */
19 class IUserControlCreator
20 {
21 public:
22 virtual ~IUserControlCreator() {}
23
24 using Ptr = std::shared_ptr<IUserControlCreator>;
25
26 // Returns the name of this control. This is an identifier corresponding to the
27 // UserControl enumeration, like UserControl::Camera, or a plugin-defined identifier
28 // Whitespace and other non-alphanumeric characters are not allowed
29 virtual std::string getControlName() = 0;
30
31 // A visible, localised identifier used for tab captions and window titles
32 virtual std::string getDisplayName() = 0;
33
34 // Optional icon file name to use for tab captions, e.g. "icon_texture.png"
35 virtual std::string getIcon() { return {}; }
36
37 /**
38 * @brief Create a new wxWidget window for packing into a dialog or sizer.
39 *
40 * Widget ownership is transferred to the caller, IUserControlCreator implementations
41 * will not delete the returned window.
42 */
43 virtual wxWindow* createWidget(wxWindow* parent) = 0;
44 };
45
46 // The command used to toggle a control: bring it to front if hidden, or hide it if it's a visible floating window
47 constexpr const char* const TOGGLE_CONTROL_COMMAND = "ToggleControl";
48
49 // The command used to make a control the main control (replacing the resident ortho view)
50 constexpr const char* const TOGGLE_MAIN_CONTROL_COMMAND = "ToggleMainControl";
51
52 // The command name used to focus a control, brings it to front, creating it if necessary
53 constexpr const char* const FOCUS_CONTROL_COMMAND = "FocusControl";
54
55 // The command name used to create a new instance of a control
56 constexpr const char* const CREATE_CONTROL_COMMAND = "CreateControl";
57
58 // Prefix used to construct statements like "ToggleLightInspector"
59 constexpr const char* const TOGGLE_CONTROL_STATEMENT_PREFIX = "Toggle";
60
61 // Prefix for statements making a certain control the main control
62 constexpr const char* const TOGGLE_MAIN_CONTROL_STATEMENT_PREFIX = "ToggleMainControl_";
63
64 // Predefined known user control names
65 struct UserControl
66 {
67 constexpr static const char* Camera = "Camera";
68 constexpr static const char* Console = "Console";
69 constexpr static const char* FavouritesBrowser = "FavouritesBrowser";
70 constexpr static const char* EntityInspector = "EntityInspector";
71 constexpr static const char* EntityList = "EntityList";
72 constexpr static const char* MediaBrowser = "MediaBrowser";
73 constexpr static const char* OrthoView = "OrthoView";
74 constexpr static const char* TextureBrowser = "TextureBrowser";
75 constexpr static const char* SurfaceInspector = "SurfaceInspector";
76 constexpr static const char* PatchInspector = "PatchInspector";
77 constexpr static const char* FindAndReplaceMaterial = "FindAndReplaceMaterial";
78 constexpr static const char* LightInspector = "LightInspector";
79 constexpr static const char* LayerControlPanel = "LayerControlPanel";
80 constexpr static const char* TextureTool = "TextureTool";
81 constexpr static const char* TransformPanel = "TransformPanel";
82 constexpr static const char* MapMergePanel = "MapMergePanel";
83 constexpr static const char* AasVisualisationPanel = "AasVisualisationPanel";
84 constexpr static const char* OrthoBackgroundPanel = "OrthoBackgroundPanel";
85 };
86
87 }