34#include <NDEVR/DesignObjectDialog.h>
35#include <NDEVR/QCustomDockWidget.h>
36#include <NDEVR/PopupManager.h>
37#include <NDEVR/FileFormat.h>
57 typedef AlocatingAlignedBuffer<FactoryParameters, 64> FactoryParameterBuffer;
298 virtual void exit(
bool relaunch =
false,
const StringView& relaunch_options =
"--relaunch");
Shows information about the current software version.
Default dialog shown when the user exports an ascii-or custom column style file.
Dialog that allows user to choose import or export options while simultaneously automatically writing...
The equivelent of std::vector but with a bit more control.
Manages the creation and lookup of DesignObjectDialog instances for design objects.
A hash-based key-value store, useful for quick associative lookups.
Provides a way to optionally lazily initialize widgets when needed but still pass them to container d...
A dialog designed to allow the user to navigate a filesytem and select or create one or more files or...
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Shown after a new installation on a device, allowing the user to familiarize themselves with the envi...
A popup for showing a virtual keyboard or keypad.
A dialog which shows multiple log views, where each log is a tab.
A pointer to a DesignObject within a QTModelManager that receives and emits update signals based on t...
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
The main Settings dialog for the application.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
Stores a time span, or difference between two times, with an optional start time.
virtual void showMainScreen()
Shows the main screen and puts it in front of any windows.
DockWidget< AutoModelFileDialog > * m_import_dock
The import file dialog dock.
void onNewProjectSignal()
Signal emitted when a new project is created.
virtual InitialSetupDialog * initialSetupDialog()
Returns or creates the initial setup dialog.
virtual SettingsDialog * createSettingsDialog()
Creates and returns a new SettingsDialog instance.
virtual AboutDialog * createAboutDialog()
Creates and returns a new AboutDialog instance.
virtual void setMainWindowCallback(const std::function< void(QWidget *)> &main_window_callback)
Sets a callback invoked when the main window is created or changed.
virtual void updateFromWindowOptions()
Updates the window layout and behavior based on the current WindowOptions.
virtual void hideSplashScreen(const TimeSpan &delay_time, const TimeSpan &fade_time)
Hides the splash screen with the specified delay and fade animation.
virtual void showImportDialogIfNeeded(const Buffer< FileRequest > &file, PopupInfo popup_origin=PopupInfo())
Shows the import settings dialog if additional configuration is needed for the file requests.
virtual void userImportFile(PopupInfo popup_origin, const Buffer< FileFormat > &formats)
Called when the user has requested to import a file.
virtual SectionWidget * defaultDropReference(const QCustomDockWidget *dock_widget=nullptr) const
Returns the default section widget to drop relative to.
virtual AsciiModelFileDialog * createAsciiModelFileDialog(bool is_import)
Creates and returns a new AsciiModelFileDialog for import or export.
virtual void exportFiles(Buffer< UUID > model, const Buffer< FileRequest > &files, const PopupInfo &popup_origin)
Called when the user has selected a file format and default data to export.
virtual void importUserFiles(const Buffer< FileRequest > &files, PopupInfo popup_origin=PopupInfo())
Called when the user has requested to import and has selected a file.
virtual void addSettingsMenu(WidgetInit *menu, std::function< void()> reset_to_defaults)
Adds a dialog to the logic such that, should a settings dialog be created, the dialog will be added t...
virtual void saveProjectAs(const PopupInfo &popup_origin=PopupInfo())
Called when the user has selected the project to save and we want to allow them to rename the file Wi...
FileChooserDialog * m_file_chooser
The main file chooser dialog.
QTModelManager * m_model_manager
The model manager providing project data.
virtual FileChooserDialog * createFileChooserDialog()
Creates and returns a new FileChooserDialog instance.
virtual void exportFile(ExportRequest request)
Called when the user exports.
virtual void createNewProjectNow(bool show_settings, const PopupInfo &popup_origin=PopupInfo())
Creates a new project immediately without prompting to save.
virtual void removeSettingsMenu(WidgetInit *menu)
Removes a previously added settings menu from the settings dialog.
Buffer< DockInit * > m_custom_dock_widgets
Custom dock widgets registered by modules.
virtual DockWidget< AutoModelFileDialog > * importerWindow(const Buffer< FileRequest > &requests)
Returns the dialog adjusting the import settings of a given file request.
DockWidget< AsciiModelFileDialog > * m_ascii_import_dock
The ASCII import file dialog dock.
WindowManager(QTModelManager *manager)
Constructs a WindowManager with the given model manager.
void updateFileDialogToProject()
Updates the file dialog to default to the current project directory.
virtual void addProjectFolderToRecents()
Adds the current project folder to the recent directories list.
void initialSetupFinishedSlot()
Slot invoked when the initial setup process has completed.
virtual DockWidget< LogManagerDialog > * logView()
Returns the dialog for viewing all application logs related to the session and project.
void userDataAdded(Buffer< UUID > object)
Signal emitted when user data has been added to the project.
virtual void setupExporterWindow(AutoModelFileDialog *window, Buffer< UUID > model, const Buffer< FileRequest > &file)
Configures an exporter window with the given model objects and file requests.
virtual DockWidget< AsciiModelFileDialog > * asciiExporterWindow(Buffer< UUID > model, const Buffer< FileRequest > &file)
Returns the ASCII exporter dialog configured for the given model and file requests.
bool m_is_exiting
Whether the application is in the process of exiting.
virtual DockWidget< AboutDialog > * aboutDialog()
Returns the about dialog, which details information about the application, and instruction manuals,...
virtual DockWidget< AsciiModelFileDialog > * asciiImporterWindow(const Buffer< FileRequest > &requests)
Returns the ASCII importer dialog configured for the given file requests.
FactoryParameterBuffer convertRequest(const Buffer< FileRequest > &requests)
Converts file requests into a FactoryParameterBuffer for IO processing.
virtual DockWidget< AutoModelFileDialog > * exporterWindow(Buffer< UUID > model, const Buffer< FileRequest > &file)
Returns the dialog adjusting the export settings of a given file request.
FileChooserDialog * m_image_export
File chooser dialog for image export.
virtual void addCustomDockWidget(DockInit *widget)
Adds a widget to be docked in the default location when a project has been loaded.
virtual void userImportFile(PopupInfo popup_origin=PopupInfo())
Called when the user has requested to import a file.
virtual void openUserFiles(const Buffer< FileRequest > &files, PopupInfo popup_origin=PopupInfo())
Opens user-selected files as new projects or adds them to the current project.
virtual void layoutAll()
Performs a full layout pass, arranging all dock widgets and panels.
virtual void requestExitWithFunction(std::function< void()> exit_function, const PopupInfo &popup_origin=PopupInfo())
Prompts the user to confirm an exit and save changes if required.
DockWidget< AboutDialog > * m_about_dock
The about dialog dock.
virtual void onNewProjectSelected(const PopupInfo &popup_origin=PopupInfo())
Creates a new project and shows any relevant information based on WindowOptions.
virtual FileChooserDialog * fileChooser()
Returns the default file chooser dialog used for user selection of files for import or export.
virtual void removeCustomDockWidget(DockInit *widget)
Removes a widget that was added with addCustomDockWidget.
virtual void removeInitialSetupSettingsMenu(WidgetInit *menu)
Removes a previously added initial setup settings menu.
virtual void userOpenProject(PopupInfo popup_origin=PopupInfo())
Called when the user has requested to choose a project file to open.
virtual void exit(bool relaunch=false, const StringView &relaunch_options="--relaunch")
Saves user settings and exits the application, relaunching if requested.
String m_export_image_id
The identifier of the image being exported.
bool m_has_setup_keypad
Whether the on-screen keypad has been initialized.
std::function< void(QWidget *)> m_main_window_callback
Callback invoked when the main window is created.
QPointer< DockWidget< Keypad > > m_key_pad_dock
The docked keypad widget for touch input.
DockWidget< AsciiModelFileDialog > * m_ascii_export_dock
The ASCII export file dialog dock.
DockWidget< SettingsDialog > * m_settings_dock
The settings dialog dock.
virtual void closeAll(const PopupInfo &popup_origin=PopupInfo())
Prompts the user to save changes, if required, then closes everything returning to application initia...
void initKeypad()
Initializes the on-screen keypad for touch input.
virtual LogManagerDialog * createLogView()
Creates and returns a new LogManagerDialog instance.
void simulateKeyPress(int key)
Simulates a key press event as if the user pressed a key on the keyboard.
void lockScreenToWindowSize()
Locks the screen resolution to match the current window size.
virtual QWidget * mainWindow() const =0
Returns the primary window for the application.
Buffer< std::tuple< WidgetInit *, std::function< void()> > > m_settings_dialogs
Registered settings menus and their reset callbacks.
InitialSetupDialog * m_initial_setup_dialog
The initial setup dialog instance.
void createNewProject(bool show_settings, const PopupInfo &popup_origin=PopupInfo())
Creates a new project and shows any relevant information based on show_settings parameter.
virtual void saveImage(const StringView &image_id, const File &default_file, PopupInfo info)
Prompts the user to save an image to a file location.
virtual DockWidget< SettingsDialog > * settingsDialog()
Returns the settings dialog for allowing the user to adjust application specific objects.
virtual DockWidget< AsciiModelFileDialog > * asciiImporterWindow()
Returns the dialog adjusting used for adjust the import settings of a given ascii file request.
virtual void requestExit(QCloseEvent *event, const PopupInfo &popup_origin=PopupInfo())
Prompts the user to confirm an exit and save changes if required.
virtual void recoverLastData()
Attempts to recover data from the last session if it was not properly saved.
virtual void onNewProjectSelected(bool show_settings, const PopupInfo &popup_origin=PopupInfo())
Creates a new project and shows any relevant information based on show_settings parameter.
Buffer< std::tuple< WidgetInit *, bool > > m_initial_settings_dialogs
Registered initial setup menus and their always-show flags.
virtual DockWidget< AutoModelFileDialog > * importerWindow()
Returns the dialog adjusting used for adjust the import settings of a given file request.
virtual void clearAll()=0
Resets the entire display to original initial state, before a project was loaded.
virtual void addInitialSetupSettingsMenu(WidgetInit *menu, bool always_show=false)
Adds a menu to the initial setup dialog shown on first launch.
virtual void updateModified()=0
Called when application should check to see if the project has been modified since last save.
virtual void userDeleteObjects(const Buffer< UUID > &ids, PopupInfo info)
Called when the user deletes objects.
void initialSetupFinishedSignal()
Signal emitted when the initial setup process has completed.
virtual DropArea defaultDropArea(const QCustomDockWidget *dock_widget) const
Returns the default drop area for a given dock widget.
DockWidget< AutoModelFileDialog > * m_export_dock
The export file dialog dock.
virtual void showModelProperties(const ShowPropertiesSettings &settings)
Called when we want to show the dialog for editing a specific object using application default editin...
virtual AutoModelFileDialog * createAutoModelFileDialog(bool is_import)
Creates and returns a new AutoModelFileDialog for import or export.
Dictionary< UUID, QPointer< DockWidget< DesignObjectDialog > > > m_editor_docks
Map of object UUIDs to their editor dock widgets.
void updateFileDialog(const Buffer< UUID > &model, const Buffer< FileFormat > &formats, StringView extension, bool show_recents, bool save_dialog)
Updates the file chooser dialog with format filters and options.
virtual void requestExit(const PopupInfo &popup_origin=PopupInfo())
Prompts the user to confirm an exit and save changes if required.
DesignObjectDialogLookup * m_dialog_lookup
Lookup table for design object editing dialogs.
DockWidget< LogManagerDialog > * m_log_dock
The log manager dialog dock.
The primary namespace for the NDEVR SDK.
DropArea
relates where a widget should be dropped relative to another.
Stores information related to exporting specific data from the software.
A FileRequest bundles format data as well as a particular file.
Stores settings for setting up and displaying a DesignObjectDialog such as whether the dialog is part...