[nostalgia/studio] Add Copy/Paste hooks
This commit is contained in:
@@ -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);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user