NDEVR
API Documentation
PaperEditor.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2020, 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: PaperEditor
29Included in API: True
30Author(s): tyler.parke
31 *-----------------------------------------------------------------------------------------**/
32
33#pragma once
34#include <NDEVR/Editor.h>
35#include <QWidget>
36namespace Ui
37{
38 class PaperEditorUI;
39}
40namespace NDEVR
41{
46 class PaperEditor : public Editor
47 {
48 public:
53 PaperEditor(QWidget* parent = nullptr);
59 PaperEditor(const DynamicPointer<QTDesignObject>& object, QWidget* parent = nullptr);
61 virtual void updateValues();
62 virtual EditorShowMode showMode() const;
64 void writePDF();
71 void writeImage(std::function<void(const QImage& image)> callback);
72 protected slots:
79 private:
81 void init();
82 private:
83 Ui::PaperEditorUI* ui = nullptr;
84 };
85}
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
Editor(QWidget *parent=nullptr)
Constructs an Editor with no design object target.
void writePDF()
Exports the paper layout as a vector PDF file.
PaperEditor(QWidget *parent=nullptr)
Constructs a paper editor without a target object.
void updateSizeSlot()
Slot called when the paper size is changed by the user.
void writeImage(std::function< void(const QImage &image)> callback)
Renders the paper layout to an image and passes it to the callback.
virtual EditorShowMode showMode() const
Returns the preferred display mode for this editor.
PaperEditor(const DynamicPointer< QTDesignObject > &object, QWidget *parent=nullptr)
Constructs a paper editor for the given design object.
void updateDPISlot()
Slot called when the DPI value is changed by the user.
void writeImagePDF()
Exports the paper layout as a rasterized image embedded in a PDF file.
virtual void updateValues()
Updates the UI values from the current design object state.
void updateMarginSlot()
Slot called when the margin values are changed by the user.
The primary namespace for the NDEVR SDK.
EditorShowMode
Describes how an Editor should be displayed within the application UI.
Definition Editor.h:48