40 bool Save(std::string name, std::string tree);
47 const std::vector<LayoutPreset>&
All()
const {
return m_presets; }
57 const std::vector<std::pair<std::string, std::string>>&
FileTypes()
const {
return m_fileTypes; }
67 std::vector<LayoutPreset> m_presets;
68 std::vector<std::pair<std::string, std::string>> m_fileTypes;
The layouts a document can be given: the app's built-in ones, then the ones the user saved,...
Definition gui_layout_presets.h:33
void SetForFileType(std::string_view extension, std::string name)
Files of that type (".mat", any case) open with the layout of that name; an empty name stops them.
void AddBuiltIn(std::string name, std::string tree)
Adds one of the app's own layouts, after the other built-in ones; one of the same name is replaced.
std::string_view NameForFileType(std::string_view extension) const
The name of the layout files of that type open with; empty when none is set.
const LayoutPreset * ForFileType(std::string_view extension) const
The layout files of that type open with; null when none is set, or it's gone.
const LayoutPreset * Find(std::string_view name) const
The layout of that name; null when there's none.
std::string ToJson() const
The saved layouts and the file types as JSON text; the built-in ones aren't in it.
bool FromJson(std::string_view json)
Takes the saved layouts and the file types from ToJson's text, in place of the ones there are; the bu...
const std::vector< std::pair< std::string, std::string > > & FileTypes() const
Each file type with a layout, as (extension, layout name), in the order set.
Definition gui_layout_presets.h:57
const std::vector< LayoutPreset > & All() const
All of them: the built-in ones, then the saved ones, each in the order added.
Definition gui_layout_presets.h:47
bool Remove(std::string_view name)
Deletes a user layout, and the file types that opened with it.
bool Save(std::string name, std::string tree)
Saves a user layout, after the others; one of the same name is replaced.
Definition gui_logging.h:24
A named arrangement of a document's panels: a dock tree as GUIApplication::SaveDockLayout writes it.
Definition gui_layout_presets.h:16
std::string name
"Modeling"
Definition gui_layout_presets.h:17
bool builtIn
the app's own: not saved, not deleted or replaced
Definition gui_layout_presets.h:19
std::string tree
SaveDockLayout's text.
Definition gui_layout_presets.h:18