Code

search button and description label add to import from ocal dialog
[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();
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();             
96     void    onToggleAlltypes();
97     void    onToggleShapes();    
100     // onFind helper functions
101     bool        item_id_match (SPItem *item, const gchar *id, bool exact);
102     bool        item_text_match (SPItem *item, const gchar *text, bool exact);
103     bool        item_style_match (SPItem *item, const gchar *text, bool exact);
104     bool        item_attr_match (SPItem *item, const gchar *name, bool exact);
105     GSList *    filter_fields (GSList *l, bool exact);
106     bool        item_type_match (SPItem *item);
107     GSList *    filter_types (GSList *l);
108     GSList *    filter_list (GSList *l, bool exact);
109     GSList *    all_items (SPObject *r, GSList *l, bool hidden, bool locked);
110     GSList *    all_selection_items (Inkscape::Selection *s, GSList *l, SPObject *ancestor, bool hidden, bool locked);
112     void        squeeze_window();
113     
114 private:
115     Find(Find const &d);
116     Find& operator=(Find const &d);
117     
118     Button    _button_clear;
119     Button    _button_find;
120 };
122 } // namespace Dialog
123 } // namespace UI
124 } // namespace Inkscape
126 #endif // INKSCAPE_UI_DIALOG_FIND_H
128 /*
129   Local Variables:
130   mode:c++
131   c-file-style:"stroustrup"
132   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
133   indent-tabs-mode:nil
134   fill-column:99
135   End:
136 */
137 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :