1 /** @file
2 * @brief Find dialog
3 */
4 /* Authors:
5 * Bryce W. Harrington <bryce@bryceharrington.org>
6 *
7 * Copyright (C) 2004, 2005 Authors
8 *
9 * Released under GNU GPL. Read the file 'COPYING' for more information.
10 */
12 #ifndef INKSCAPE_UI_DIALOG_FIND_H
13 #define INKSCAPE_UI_DIALOG_FIND_H
15 #include <glibmm/i18n.h>
17 #include "ui/widget/panel.h"
18 #include "ui/widget/button.h"
19 #include "ui/widget/entry.h"
20 #include <gtkmm/separator.h>
21 #include <glib.h>
23 class SPItem;
24 class SPObject;
26 namespace Inkscape {
27 class Selection;
29 namespace UI {
30 namespace Dialog {
32 class Find : public UI::Widget::Panel {
33 public:
34 Find();
35 virtual ~Find();
37 static Find &getInstance() { return *new Find(); }
39 protected:
40 // Widgets:
41 Inkscape::UI::Widget::Entry _entry_text;
42 Inkscape::UI::Widget::Entry _entry_id;
43 Inkscape::UI::Widget::Entry _entry_style;
44 Inkscape::UI::Widget::Entry _entry_attribute;
46 Inkscape::UI::Widget::CheckButton _check_search_selection;
47 Inkscape::UI::Widget::CheckButton _check_search_layer;
48 Inkscape::UI::Widget::CheckButton _check_include_hidden;
49 Inkscape::UI::Widget::CheckButton _check_include_locked;
51 // Type checkbutton widgets...
52 Inkscape::UI::Widget::CheckButton _check_all;
53 Inkscape::UI::Widget::CheckButton _check_all_shapes;
54 Inkscape::UI::Widget::CheckButton _check_rects;
55 Inkscape::UI::Widget::CheckButton _check_ellipses;
56 Inkscape::UI::Widget::CheckButton _check_stars;
57 Inkscape::UI::Widget::CheckButton _check_spirals;
58 Inkscape::UI::Widget::CheckButton _check_paths;
59 Inkscape::UI::Widget::CheckButton _check_texts;
60 Inkscape::UI::Widget::CheckButton _check_groups;
61 Inkscape::UI::Widget::CheckButton _check_clones;
62 Inkscape::UI::Widget::CheckButton _check_images;
63 Inkscape::UI::Widget::CheckButton _check_offsets;
65 // Button-click handlers
66 void onClear();
67 void onFind();
68 void onToggleAlltypes();
69 void onToggleShapes();
72 // onFind helper functions
73 bool item_id_match (SPItem *item, const gchar *id, bool exact);
74 bool item_text_match (SPItem *item, const gchar *text, bool exact);
75 bool item_style_match (SPItem *item, const gchar *text, bool exact);
76 bool item_attr_match (SPItem *item, const gchar *name, bool exact);
77 GSList * filter_fields (GSList *l, bool exact);
78 bool item_type_match (SPItem *item);
79 GSList * filter_types (GSList *l);
80 GSList * filter_list (GSList *l, bool exact);
81 GSList * all_items (SPObject *r, GSList *l, bool hidden, bool locked);
82 GSList * all_selection_items (Inkscape::Selection *s, GSList *l, SPObject *ancestor, bool hidden, bool locked);
84 void squeeze_window();
86 private:
87 Find(Find const &d);
88 Find& operator=(Find const &d);
90 Inkscape::UI::Widget::Button _button_clear;
91 Inkscape::UI::Widget::Button _button_find;
92 };
94 } // namespace Dialog
95 } // namespace UI
96 } // namespace Inkscape
98 #endif // INKSCAPE_UI_DIALOG_FIND_H
100 /*
101 Local Variables:
102 mode:c++
103 c-file-style:"stroustrup"
104 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
105 indent-tabs-mode:nil
106 fill-column:99
107 End:
108 */
109 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :