[nostalgia/studio] Add Copy/Paste hooks

This commit is contained in:
2020-10-19 19:36:23 -05:00
parent b6c82c42f0
commit fdda3bd82d
4 changed files with 88 additions and 4 deletions
+20 -2
View File
@@ -22,6 +22,8 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
QUndoStack m_cmdStack;
bool m_unsavedChanges = false;
bool m_exportable = false;
bool m_copyEnabled = false;
bool m_pasteEnabled = false;
public:
Editor(QWidget *parent);
@@ -33,6 +35,10 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
*/
virtual QString itemName() const = 0;
virtual void copy();
virtual void paste();
virtual void exportFile();
/**
@@ -51,11 +57,19 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
/**
* Returns the undo stack holding changes to the item being edited.
*/
QUndoStack *undoStack();
[[nodiscard]] QUndoStack *undoStack();
void setExportable(bool);
bool exportable() const;
[[nodiscard]] bool exportable() const;
void setCopyEnabled(bool);
[[nodiscard]] bool copyEnabled() const;
void setPasteEnabled(bool);
[[nodiscard]] bool pasteEnabled() const;
protected:
/**
@@ -68,6 +82,10 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
void exportableChanged(bool);
void copyEnabledChanged(bool);
void pasteEnabledChanged(bool);
};
}