Code

d969236b8f0a079146fa26df76f328faa10ea2ef
[inkscape.git] / src / ui / dialog / find.h
1 /**
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 <gtkmm/notebook.h>
16 #include <glibmm/i18n.h>
18 #include "dialog.h"
19 #include "ui/widget/button.h"
20 #include "ui/widget/entry.h" 
22 #include "message-stack.h"
23 #include "helper/window.h"
24 #include "macros.h"
25 #include "inkscape.h"
26 #include "document.h"
27 #include "desktop.h"
28 #include "selection.h"
29 #include "desktop-handles.h" 
31 #include "dialog-events.h"
32 #include "../prefs-utils.h"
33 #include "../verbs.h"
34 #include "../interface.h"
35 #include "../sp-text.h"
36 #include "../sp-flowtext.h"
37 #include "../text-editing.h"
38 #include "../sp-tspan.h"
39 #include "../selection-chemistry.h"
40 #include "../sp-defs.h"
41 #include "../sp-rect.h"
42 #include "../sp-ellipse.h"
43 #include "../sp-star.h"
44 #include "../sp-spiral.h"
45 #include "../sp-path.h"
46 #include "../sp-line.h"
47 #include "../sp-polyline.h"
48 #include "../sp-item-group.h"
49 #include "../sp-use.h"
50 #include "../sp-image.h"
51 #include "../sp-offset.h"
52 #include <xml/repr.h>
54 using namespace Inkscape::UI::Widget;
56 namespace Inkscape {
57 namespace UI {
58 namespace Dialog {
60 class Find : public Dialog {
61 public:
62     Find();
63     virtual ~Find();
65     static Find *create() { return new Find(); }
67 protected:
68     // Widgets:
69     Entry    _entry_text;
70     Entry    _entry_id;
71     Entry    _entry_style;
72     Entry    _entry_attribute;
74     CheckButton    _check_search_selection;
75     CheckButton    _check_search_layer;
76     CheckButton    _check_include_hidden;
77     CheckButton    _check_include_locked;
78     
79     // Type checkbutton widgets... 
80     CheckButton    _check_all;
81     CheckButton    _check_all_shapes;
82     CheckButton    _check_rects;
83     CheckButton    _check_ellipses;
84     CheckButton    _check_stars;
85     CheckButton    _check_spirals;
86     CheckButton    _check_paths;
87     CheckButton    _check_texts;
88     CheckButton    _check_groups;
89     CheckButton    _check_clones;
90     CheckButton    _check_images;
91     CheckButton    _check_offsets;
92     
93     // Button-click handlers
94     void    onClear();
95     void    onFind();
98     // onFind helper functions
99     bool        item_id_match (SPItem *item, const gchar *id, bool exact);
100     bool        item_text_match (SPItem *item, const gchar *text, bool exact);
101     bool        item_style_match (SPItem *item, const gchar *text, bool exact);
102     bool        item_attr_match (SPItem *item, const gchar *name, bool exact);
103     GSList *    filter_fields (GSList *l, bool exact);
104     bool        item_type_match (SPItem *item);
105     GSList *    filter_types (GSList *l);
106     GSList *    filter_list (GSList *l, bool exact);
107     GSList *    all_items (SPObject *r, GSList *l, bool hidden, bool locked);
108     GSList *    all_selection_items (Inkscape::Selection *s, GSList *l, SPObject *ancestor, bool hidden, bool locked);
109     
110     
111 private:
112     Find(Find const &d);
113     Find& operator=(Find const &d);
114     
115     Button    _button_clear;
116     Button    _button_find;
117 };
119 } // namespace Dialog
120 } // namespace UI
121 } // namespace Inkscape
123 #endif // INKSCAPE_UI_DIALOG_FIND_H
125 /*
126   Local Variables:
127   mode:c++
128   c-file-style:"stroustrup"
129   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
130   indent-tabs-mode:nil
131   fill-column:99
132   End:
133 */
134 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :