11#ifndef INKSCAPE_EXTENSION_TEMPLATE_H__
12#define INKSCAPE_EXTENSION_TEMPLATE_H__
17#include <giomm/file.h>
18#include <glibmm/refptr.h>
19#include <glibmm/ustring.h>
102 const
char *
what() const noexcept
override {
return "Create was cancelled"; }
108 bool check()
override;
122 std::shared_ptr<TemplatePreset>
get_preset(
const std::string &
key);
The object that is the basis for the Extension system.
Util::HybridPointer< Implementation::Implementation > ImplementationHolder
std::string const & get_category() const
int get_visibility() const
void _add_prefs(const TemplatePrefs &prefs)
Called by setup_prefs to save the given prefs into this extension.
std::string _get_icon_path(std::string const &name) const
std::string const & get_name() const
std::string const & get_key() const
bool setup_prefs(const TemplatePrefs &others={})
Setup the preferences and ask the user to fill in the remaineder.
int get_sort_priority() const
std::string const & get_description() const
std::unique_ptr< SPDocument > new_from_template(TemplatePrefs const &others={})
Generate a new document from this preset.
std::string const & get_label() const
std::string get_icon_path() const
void resize_to_template(SPDocument *doc, SPPage *page, const TemplatePrefs &others={})
Resize the given page to however the page format requires it to be.
std::string const & get_icon() const
bool match_size(double width, double height, const TemplatePrefs &others={})
Reverse match for templates, allowing page duplication and labeling.
bool is_visible(TemplateShow mode)
std::string get_icon() const
~Template() override=default
static std::shared_ptr< TemplatePreset > get_any_preset(const std::string &key)
Return the template preset based on the key from any template class (static method).
void resize_to_template(SPDocument *doc, SPPage *page)
Takes an existing page and resizes it to the required dimentions.
Glib::RefPtr< Gio::File > get_template_filename() const
Get the template filename, or return the default template.
std::string get_category() const
std::string get_description() const
bool check() override
Validate this extension.
std::unique_ptr< SPDocument > new_from_template()
This function creates a document from a template.
std::shared_ptr< TemplatePreset > get_preset(const std::string &key)
Return the template preset based on the key from this template class.
static int parse_visibility(const std::string &value)
Parse the expected value for the visibility value, turn into enum.
int get_visibility() const
std::unique_ptr< SPDocument > get_template_document() const
Get the raw document svg for this template (pre-processing).
TemplatePresets get_presets(TemplateShow visibility=TEMPLATE_ANY) const
Return a list of all template presets.
Interface for refcounted XML nodes.
Typed SVG document implementation.
Inkscape::Extension::Extension: Frontend to certain, possibly pluggable, actions.
std::map< std::string, std::string > TemplatePrefs
std::vector< std::shared_ptr< TemplatePreset > > TemplatePresets
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key
~create_cancelled() noexcept override=default
const char * what() const noexcept override