From c6ecbd6d125ae28e7d9fbcd9f148445a1f1d3afd Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 6 Dec 2019 23:46:12 -0600 Subject: [PATCH] [nostalgia/studio] Actually add studio::Editor... --- src/nostalgia/studio/lib/editor.cpp | 23 ++++++++++++++++ src/nostalgia/studio/lib/editor.hpp | 41 +++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 src/nostalgia/studio/lib/editor.cpp create mode 100644 src/nostalgia/studio/lib/editor.hpp diff --git a/src/nostalgia/studio/lib/editor.cpp b/src/nostalgia/studio/lib/editor.cpp new file mode 100644 index 00000000..fd42314b --- /dev/null +++ b/src/nostalgia/studio/lib/editor.cpp @@ -0,0 +1,23 @@ +/* + * Copyright 2016 - 2019 gtalent2@gmail.com + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "editor.hpp" + +namespace nostalgia::studio { + +Editor::Editor(QWidget *parent): QWidget(parent) { +} + +void Editor::save() { +} + +QUndoStack *Editor::undoStack() { + return nullptr; +} + +} diff --git a/src/nostalgia/studio/lib/editor.hpp b/src/nostalgia/studio/lib/editor.hpp new file mode 100644 index 00000000..afd17754 --- /dev/null +++ b/src/nostalgia/studio/lib/editor.hpp @@ -0,0 +1,41 @@ +/* + * Copyright 2016 - 2019 gtalent2@gmail.com + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include + +namespace nostalgia::studio { + +class Editor: public QWidget { + Q_OBJECT + + public: + Editor(QWidget *parent); + + virtual ~Editor() = default; + + /** + * Returns the name of item being edited. + */ + virtual QString itemName() = 0; + + /** + * Save changes to item being edited. + */ + virtual void save(); + + /** + * Returns the undo stack holding changes to the item being edited. + */ + virtual QUndoStack *undoStack(); + +}; + +}