API Documentation
Loading...
Searching...
No Matches
WidgetOptions.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/ApplicationOptions.h>
4#include <NDEVR/Event.h>
5class QWidget;
6namespace NDEVR
7{
8 struct PopupInfo;
9 class Log;
10 /**--------------------------------------------------------------------------------------------------
11 struct: WidgetOptions
12
13 Stores the options, added to the user settings, that control Widgets and low level UI options in the
14 application. All options retained across application restart
15
16 Author: Tyler Parke
17
18 Date: 2023-01-16
19 *-----------------------------------------------------------------------------------------------**/
21 {
22 public:
24 {
25 e_desktop///UI layout, size, and workflow optimized for traditional desktop computers
26 , e_tablet//UI layout, size, and workflow optimized for tablets
27 , e_mobile///UI layout, size, and workflow optimized for mobile phones
29 };
30 //Returns whether or not the UI should be optimized for finger presses
31 static bool IsTouchOptimized();
32 //Returns whether or not the UI should be optimized for work in the field, based off of field_mode and the current widget_mode
33 static bool IsFieldMode();
34 //Sets whether or not the UI in the current widget_mode should be optimized for work in the field, based off of field_mode and the current widget_mode
35 static void SetFieldMode(bool field_mode);
36 //Based off of things like screen resolution or whether OS is in touch mode
37 static WidgetMode DefaultSystemWidgetMode();
38 //Grows or shrinks all UI components with the exception of font
40 //Grows or shrinks all font within the UI
42 //For animations, the speed multiplier for UI animaitions. 0 = no animations. Higher the number = slower animations
44 //For animations, the scale at which to render the animation 0.0-1.0. Lower = faster animations, Higher = crisper animations
46 //Allows the user to manually dock and undock widgets
48 //Whether or not to show the main window full screen (without close/window/minimize buttons) in "field mode". In android shows the top bar
50 //Allows user to window fullscreen views
52 //Whether or not each application mode should be in field mode
54 //The mode of the application
56
57 ///////////////////////////////////////////////////
58
59 //The default parent widget for all new dialogs
61 //The function to call when we want to show a widget (Used primarily via QTTools::showDialog)
62 static std::function<bool(QWidget* widget, const PopupInfo& start, const PopupInfo& end)> show_widget_function;
63 //The function to call when we want to hide a widget (Used primarily via QTTools::showDialog)
64 static std::function<void(QWidget* widget, const PopupInfo& info)> hide_widget_function;
65
66 static std::function<void(bool relaunch, const PopupInfo& info)> request_exit_function;
67 ///The key event sent when the OS sends a key not recognized by the software
69 ///The default log for all UI events
71 //Resets all Viewport Options to defaults
72 static void ResetOptionsToDefaults();
73 //The category in user settings for all of the above options
75 };
77}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
The default object to store data of any type that should persist through sessions of the application.
Definition Button.h:57
KEY
Definition Event.h:53
A core part of the engine, stores variables that can be listened to with ResourceListener.
Definition Toggle.h:41
Logic for reading or writing to a string or a user friendly, TranslatedString.
Definition StringStream.h:118
Any text displayed to the user should be defined as a TranslatedString which allows the.
Definition TranslatedString.h:13
Definition WidgetOptions.h:21
static ApplicationOption< WidgetMode > widget_mode
Definition WidgetOptions.h:55
static std::function< void(QWidget *widget, const PopupInfo &info)> hide_widget_function
Definition WidgetOptions.h:64
static std::function< bool(QWidget *widget, const PopupInfo &start, const PopupInfo &end)> show_widget_function
Definition WidgetOptions.h:62
static Resource< QWidget * > new_window_parent
Definition WidgetOptions.h:60
static Resource< ProgressInfo * > ui_log
The default log for all UI events.
Definition WidgetOptions.h:70
static ApplicationOption< bool > global_allow_docking
Definition WidgetOptions.h:47
static ApplicationOption< bool > field_mode_fullscreen
Definition WidgetOptions.h:49
static ApplicationOption< bool > allow_windowable_windows
Definition WidgetOptions.h:51
static ApplicationOption< fltp08 > ui_scale
Definition WidgetOptions.h:39
static ApplicationOption< fltp08 > font_scale
Definition WidgetOptions.h:41
static std::function< void(bool relaunch, const PopupInfo &info)> request_exit_function
Definition WidgetOptions.h:66
static Resource< fltp08 > animation_quality
Definition WidgetOptions.h:45
static ApplicationOption< fltp08 > animation_scale
Definition WidgetOptions.h:43
static TranslatedString options_label
Definition WidgetOptions.h:74
static KeyEvent::KEY unhandled_key
The key event sent when the OS sends a key not recognized by the software.
Definition WidgetOptions.h:68
static ApplicationOption< Vector< WidgetMode::e_size, bool > > field_mode
Definition WidgetOptions.h:53
WidgetMode
Definition WidgetOptions.h:24
Definition ACIColor.h:37
Definition PopupInfo.h:10