Inkscape
Vector Graphics Editor
|
#include <template.h>
Public Member Functions | |
TemplatePreset (Template *mod, const Inkscape::XML::Node *repr, TemplatePrefs prefs={}, int priority=0) | |
Parse the inx xml node for preset information. | |
~TemplatePreset () | |
std::string const & | get_key () const |
std::string const & | get_icon () const |
std::string const & | get_category () const |
std::string const & | get_name () const |
std::string const & | get_label () const |
std::string const & | get_description () const |
int | get_sort_priority () const |
int | get_visibility () const |
bool | is_visible (TemplateShow mode) |
std::unique_ptr< SPDocument > | new_from_template (TemplatePrefs const &others={}) |
Generate a new document from this preset. | |
void | resize_to_template (SPDocument *doc, SPPage *page, const TemplatePrefs &others={}) |
Resize the given page to however the page format requires it to be. | |
bool | match_size (double width, double height, const TemplatePrefs &others={}) |
Reverse match for templates, allowing page duplication and labeling. | |
std::string | get_icon_path () const |
Protected Member Functions | |
std::string | _get_icon_path (std::string const &name) const |
bool | setup_prefs (const TemplatePrefs &others={}) |
Setup the preferences and ask the user to fill in the remaineder. | |
void | _add_prefs (const TemplatePrefs &prefs) |
Called by setup_prefs to save the given prefs into this extension. | |
Protected Attributes | |
std::string | _key |
std::string | _icon |
std::string | _name |
std::string | _label |
std::string | _desc |
std::string | _category |
int | _priority |
int | _visibility |
TemplatePrefs | _prefs |
Private Attributes | |
Template * | _mod |
Definition at line 48 of file template.h.
Inkscape::Extension::TemplatePreset::TemplatePreset | ( | Template * | mod, |
const Inkscape::XML::Node * | repr, | ||
TemplatePrefs | prefs = {} , |
||
int | priority = 0 |
||
) |
Parse the inx xml node for preset information.
Definition at line 35 of file template.cpp.
References _category, _desc, _icon, _key, _label, _name, _prefs, _priority, _visibility, Inkscape::XML::Node::attributeList(), and name.
|
inline |
Definition at line 52 of file template.h.
|
protected |
Called by setup_prefs to save the given prefs into this extension.
Definition at line 133 of file template.cpp.
References _mod, Inkscape::Extension::Extension::set_param_any(), and Inkscape::Extension::Extension::set_param_hidden().
Referenced by match_size(), and setup_prefs().
|
protected |
Definition at line 87 of file template.cpp.
References _mod, Inkscape::Extension::Extension::get_base_directory(), Inkscape::IO::Resource::get_filename(), name, and Inkscape::IO::Resource::TEMPLATES.
Referenced by get_icon_path().
|
inline |
Definition at line 56 of file template.h.
References _category.
|
inline |
Definition at line 59 of file template.h.
References _desc.
|
inline |
Definition at line 55 of file template.h.
References _icon.
std::string Inkscape::Extension::TemplatePreset::get_icon_path | ( | ) | const |
Definition at line 80 of file template.cpp.
References _get_icon_path(), and _icon.
|
inline |
Definition at line 54 of file template.h.
References _key.
|
inline |
Definition at line 58 of file template.h.
References _label.
|
inline |
Definition at line 57 of file template.h.
References _name.
|
inline |
Definition at line 60 of file template.h.
References _priority.
|
inline |
Definition at line 61 of file template.h.
References _visibility.
|
inline |
Definition at line 63 of file template.h.
References _visibility, mode, and Inkscape::Extension::TEMPLATE_ANY.
Referenced by match_size().
bool Inkscape::Extension::TemplatePreset::match_size | ( | double | width, |
double | height, | ||
const TemplatePrefs & | others = {} |
||
) |
Reverse match for templates, allowing page duplication and labeling.
Definition at line 171 of file template.cpp.
References _add_prefs(), _mod, _prefs, height, Inkscape::Extension::Extension::imp, is_visible(), Inkscape::Extension::TEMPLATE_SIZE_LIST, Inkscape::Extension::TEMPLATE_SIZE_SEARCH, and width.
std::unique_ptr< SPDocument > Inkscape::Extension::TemplatePreset::new_from_template | ( | TemplatePrefs const & | others = {} | ) |
Generate a new document from this preset.
Sets the preferences and then calls back to it's parent extension.
Definition at line 150 of file template.cpp.
References _mod, Inkscape::Extension::Template::new_from_template(), and setup_prefs().
void Inkscape::Extension::TemplatePreset::resize_to_template | ( | SPDocument * | doc, |
SPPage * | page, | ||
const TemplatePrefs & | others = {} |
||
) |
Resize the given page to however the page format requires it to be.
Definition at line 161 of file template.cpp.
References _mod, Inkscape::Extension::Template::can_resize(), page, Inkscape::Extension::Template::resize_to_template(), and setup_prefs().
|
protected |
Setup the preferences and ask the user to fill in the remaineder.
others | - populate with these prefs on top of internal prefs. |
Can cause a GUI popup.
Definition at line 114 of file template.cpp.
References _add_prefs(), _mod, _prefs, Inkscape::Extension::Extension::prefs(), and Inkscape::Extension::Extension::set_param_hidden().
Referenced by new_from_template(), and resize_to_template().
|
protected |
Definition at line 84 of file template.h.
Referenced by Inkscape::Extension::Internal::TemplatePresetFile::_load_data(), get_category(), and TemplatePreset().
|
protected |
Definition at line 83 of file template.h.
Referenced by Inkscape::Extension::Internal::TemplatePresetFile::_load_data(), get_description(), and TemplatePreset().
|
protected |
Definition at line 80 of file template.h.
Referenced by Inkscape::Extension::Internal::TemplatePresetFile::_load_data(), get_icon(), get_icon_path(), and TemplatePreset().
|
protected |
Definition at line 79 of file template.h.
Referenced by Inkscape::Extension::Internal::TemplatePresetFile::_load_data(), get_key(), TemplatePreset(), and Inkscape::Extension::Internal::TemplatePresetFile::TemplatePresetFile().
|
protected |
Definition at line 82 of file template.h.
Referenced by Inkscape::Extension::Internal::TemplatePresetFile::_load_data(), get_label(), and TemplatePreset().
|
private |
Definition at line 76 of file template.h.
Referenced by _add_prefs(), _get_icon_path(), match_size(), new_from_template(), resize_to_template(), and setup_prefs().
|
protected |
Definition at line 81 of file template.h.
Referenced by Inkscape::Extension::Internal::TemplatePresetFile::_load_data(), get_name(), TemplatePreset(), and Inkscape::Extension::Internal::TemplatePresetFile::TemplatePresetFile().
|
protected |
Definition at line 89 of file template.h.
Referenced by match_size(), setup_prefs(), TemplatePreset(), and Inkscape::Extension::Internal::TemplatePresetFile::TemplatePresetFile().
|
protected |
Definition at line 85 of file template.h.
Referenced by Inkscape::Extension::Internal::TemplatePresetFile::_load_data(), get_sort_priority(), and TemplatePreset().
|
protected |
Definition at line 86 of file template.h.
Referenced by get_visibility(), is_visible(), TemplatePreset(), and Inkscape::Extension::Internal::TemplatePresetFile::TemplatePresetFile().