Code

Dockable dialogs patch applied
[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 <glibmm/i18n.h>
17 #include "dialog.h"
18 #include "ui/widget/button.h"
19 #include "ui/widget/entry.h" 
20 #include <gtkmm/separator.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 "dialogs/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(Behavior::BehaviorFactory behavior_factory);
63     virtual ~Find();
65     static Find *create(Behavior::BehaviorFactory behavior_factory) 
66     { return new Find(behavior_factory); }
68 protected:
69     // Widgets:
70     Entry    _entry_text;
71     Entry    _entry_id;
72     Entry    _entry_style;
73     Entry    _entry_attribute;
75     CheckButton    _check_search_selection;
76     CheckButton    _check_search_layer;
77     CheckButton    _check_include_hidden;
78     CheckButton    _check_include_locked;
79     
80     // Type checkbutton widgets... 
81     CheckButton    _check_all;
82     CheckButton    _check_all_shapes;
83     CheckButton    _check_rects;
84     CheckButton    _check_ellipses;
85     CheckButton    _check_stars;
86     CheckButton    _check_spirals;
87     CheckButton    _check_paths;
88     CheckButton    _check_texts;
89     CheckButton    _check_groups;
90     CheckButton    _check_clones;
91     CheckButton    _check_images;
92     CheckButton    _check_offsets;  
93     
94     // Button-click handlers
95     void    onClear();
96     void    onFind();             
97     void    onToggleAlltypes();
98     void    onToggleShapes();    
101     // onFind helper functions
102     bool        item_id_match (SPItem *item, const gchar *id, bool exact);
103     bool        item_text_match (SPItem *item, const gchar *text, bool exact);
104     bool        item_style_match (SPItem *item, const gchar *text, bool exact);
105     bool        item_attr_match (SPItem *item, const gchar *name, bool exact);
106     GSList *    filter_fields (GSList *l, bool exact);
107     bool        item_type_match (SPItem *item);
108     GSList *    filter_types (GSList *l);
109     GSList *    filter_list (GSList *l, bool exact);
110     GSList *    all_items (SPObject *r, GSList *l, bool hidden, bool locked);
111     GSList *    all_selection_items (Inkscape::Selection *s, GSList *l, SPObject *ancestor, bool hidden, bool locked);
113     void        squeeze_window();
114     
115 private:
116     Find(Find const &d);
117     Find& operator=(Find const &d);
118     
119     Button    _button_clear;
120     Button    _button_find;
121 };
123 } // namespace Dialog
124 } // namespace UI
125 } // namespace Inkscape
127 #endif // INKSCAPE_UI_DIALOG_FIND_H
129 /*
130   Local Variables:
131   mode:c++
132   c-file-style:"stroustrup"
133   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
134   indent-tabs-mode:nil
135   fill-column:99
136   End:
137 */
138 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :