summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/template-base.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/extension/internal/template-base.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/extension/internal/template-base.h b/src/extension/internal/template-base.h
new file mode 100644
index 0000000..02481d5
--- /dev/null
+++ b/src/extension/internal/template-base.h
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * A base template generator used by internal template types.
+ *
+ * Authors:
+ * Martin Owens <doctormo@geek-2.com>
+ *
+ * Copyright (C) 2022 Authors
+ *
+ * Released under GNU GPL v2+, read the file 'COPYING' for more information.
+ */
+
+#ifndef EXTENSION_INTERNAL_TEMPLATE_BASE_H
+#define EXTENSION_INTERNAL_TEMPLATE_BASE_H
+
+#include <glib.h>
+
+#include "2geom/point.h"
+#include "extension/extension.h"
+#include "extension/implementation/implementation.h"
+#include "extension/system.h"
+#include "extension/template.h"
+#include "util/units.h"
+
+class SPDocument;
+class SPPage;
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+
+class TemplateBase : public Inkscape::Extension::Implementation::Implementation
+{
+public:
+ bool check(Inkscape::Extension::Extension *module) override { return true; };
+
+ SPDocument *new_from_template(Inkscape::Extension::Template *tmod) override;
+ void resize_to_template(Inkscape::Extension::Template *tmod, SPDocument *doc, SPPage *page) override;
+ bool match_template_size(Inkscape::Extension::Template *tmod, double width, double height) override;
+
+protected:
+ virtual Geom::Point get_template_size(Inkscape::Extension::Template *tmod) const;
+ virtual Geom::Point get_template_size(Inkscape::Extension::Template *tmod, const Util::Unit *unit) const;
+ virtual const Util::Unit *get_template_unit(Inkscape::Extension::Template *tmod) const;
+
+private:
+};
+
+} // namespace Internal
+} // namespace Extension
+} // namespace Inkscape
+#endif /* EXTENSION_INTERNAL_TEMPLATE_BASE_H */