NDEVR
API Documentation
Editor.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVR
28File: Editor
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/QTDesignObject.h>
35#include <NDEVR/Pointer.h>
36#include <NDEVR/Buffer.h>
37#include <QWidget>
38namespace NDEVR
39{
40 class Log;
41 class QTModelManager;
54
57 class NDEVR_API Editor : public QWidget
58 {
59 Q_OBJECT
60 public:
65 Editor(QWidget* parent = nullptr);
71 Editor(const DynamicPointer<QTDesignObject>& object, QWidget* parent = nullptr);
75 virtual void updateValues() = 0;
85 virtual StringView customDialogIcon() const { return StringView(); };
95 virtual Buffer<QWidget*> printableWidgets() { return { this }; }
105 virtual Buffer<QWidget*> bottomOptions() { return {}; }
110 virtual void setReadOnly(bool read_only);
121#if NDEVR_VIEWPORT
125 virtual void moveTargetWithMouse();
126#endif
131 virtual void setTarget(const DynamicPointer<QTDesignObject>& object);
136 virtual void setHorizontal(bool horizontal);
141 virtual bool isHorizontal() const;
146 virtual void requestScrollEnabled(bool enabled);
162 virtual bool isBusy() const { return false; }
167 virtual bool disableExport() const { return false; }
172 virtual EditorShowMode showMode() const;
173 protected slots:
182 signals:
191 protected:
194 bool m_is_read_only = false;
195 };
196}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
A popup dialog for showing options or information to the user for a particular DesignObject.
A low-level database object that can be used to access general stored properties within the NDEVR Mod...
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
virtual void setTarget(const DynamicPointer< QTDesignObject > &object)
Sets the design object target for this editor.
virtual Buffer< QWidget * > bottomOptions()
Returns widgets to be placed at the bottom of the editor layout.
Definition Editor.h:105
Editor(QWidget *parent=nullptr)
Constructs an Editor with no design object target.
Editor(const DynamicPointer< QTDesignObject > &object, QWidget *parent=nullptr)
Constructs an Editor targeting the given design object.
InterfaceOrientationController * m_orientation_controller
The orientation controller for this editor.
Definition Editor.h:192
virtual void setup(DesignObjectDialog *, const ShowPropertiesSettings &)
Sets up the editor with a parent dialog and property display settings.
Definition Editor.h:157
DesignObject getObject() const
Returns the target design object.
virtual InterfaceOrientationController * orientationController() const
Returns the orientation controller associated with this editor.
void onDesignObjectUpdateSlot()
Slot called when the target design object is updated.
bool m_is_read_only
Whether the editor is in read-only mode.
Definition Editor.h:194
virtual StringView customDialogIcon() const
Returns a custom icon name for the editor dialog, or an empty string if none.
Definition Editor.h:85
virtual void setHorizontal(bool horizontal)
Sets whether the editor layout is horizontal.
Model getModel() const
Returns the target design object as a Model.
const DynamicPointer< QTDesignObject > & target() const
Returns the current design object target.
Definition Editor.h:151
virtual EditorShowMode showMode() const
Returns the preferred display mode for this editor.
void objectUpdatedSignal()
Emitted when the target object has been updated.
virtual Buffer< QWidget * > printableWidgets()
Returns the widgets that can be printed from this editor.
Definition Editor.h:95
void onDesignObjectDeletedSlot()
Slot called when the target design object is deleted.
virtual void updateValues()=0
Updates the displayed values to reflect the current state of the target object.
virtual void requestScrollEnabled(bool enabled)
Requests enabling or disabling scrolling within the editor.
virtual void moveTargetWithMouse()
Initiates interactive mouse-based movement of the target object in the viewport.
virtual void setReadOnly(bool read_only)
Sets whether the editor is in read-only mode.
virtual Buffer< QWidget * > printableWidgetOptions()
Returns option widgets to configure printing for this editor.
Definition Editor.h:100
virtual bool disableExport() const
Returns whether exporting should be disabled for this editor.
Definition Editor.h:167
virtual TranslatedString customDialogTitle() const
Returns a custom title for the editor dialog, or an empty string if none.
Definition Editor.h:80
virtual bool isHorizontal() const
Returns whether the editor layout is horizontal.
virtual bool isBusy() const
Returns whether the editor is currently busy performing an operation.
Definition Editor.h:162
DynamicPointer< QTDesignObject > m_design_object
The design object being edited.
Definition Editor.h:193
void isBusyStatusChanged()
Emitted when the busy status of the editor changes.
This class is responsible for notifying and providing default layout logic when the orientation of th...
Serves as the primary program interface for processes to report issues and allows any number of LogSt...
Definition Log.h:50
A core class that represents a node on model hierarchy.
Definition Model.h:292
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
The core String View class for the NDEVR API.
Definition StringView.h:58
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
The primary namespace for the NDEVR SDK.
EditorShowMode
Describes how an Editor should be displayed within the application UI.
Definition Editor.h:48
@ e_side_panel
The editor is shown as a side panel.
Definition Editor.h:50
@ e_popup
The editor is shown as a popup dialog.
Definition Editor.h:51
@ e_fullscreen
The editor is shown in fullscreen mode.
Definition Editor.h:52
@ e_flexible
The editor can be shown in any mode depending on context.
Definition Editor.h:49
Stores settings for setting up and displaying a DesignObjectDialog such as whether the dialog is part...