// SPDX-License-Identifier: GPL-2.0-or-later /** @file * @brief A dialog for CSS selectors */ /* Authors: * Kamalpreet Kaur Grewal * Tavmjong Bah * * Copyright (C) Kamalpreet Kaur Grewal 2016 * Copyright (C) Tavmjong Bah 2017 * * Released under GNU GPL v2+, read the file 'COPYING' for more information. */ #ifndef STYLEDIALOG_H #define STYLEDIALOG_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "style-enums.h" #include "ui/dialog/dialog-base.h" #include "xml/helper-observer.h" namespace Inkscape { XML::Node *get_first_style_text_node(XML::Node *root, bool create_if_missing); namespace UI { namespace Dialog { /** * @brief The StyleDialog class * A list of CSS selectors will show up in this dialog. This dialog allows one to * add and delete selectors. Elements can be added to and removed from the selectors * in the dialog. Selection of any selector row selects the matching objects in * the drawing and vice-versa. (Only simple selectors supported for now.) * * This class must keep two things in sync: * 1. The text node of the style element. * 2. The Gtk::TreeModel. */ class StyleDialog : public DialogBase { public: // No default constructor, noncopyable, nonassignable StyleDialog(); ~StyleDialog() override; StyleDialog(StyleDialog const &d) = delete; StyleDialog operator=(StyleDialog const &d) = delete; void documentReplaced() override; void selectionChanged(Selection *selection) override; static StyleDialog &getInstance() { return *new StyleDialog(); } void setCurrentSelector(Glib::ustring current_selector); Gtk::TreeView *_current_css_tree; Gtk::TreeViewColumn *_current_value_col; Gtk::TreeModel::Path _current_path; bool _deletion; Glib::ustring fixCSSSelectors(Glib::ustring selector); void readStyleElement(); private: // Monitor