1 | /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ |
---|
2 | |
---|
3 | /* nautilus-search-bar-criterion.h - Types that will |
---|
4 | bring up the various search criteria |
---|
5 | |
---|
6 | Copyright (C) 2000 Eazel, Inc. |
---|
7 | |
---|
8 | This program is free software; you can redistribute it and/or |
---|
9 | modify it under the terms of the GNU General Public License as |
---|
10 | published by the Free Software Foundation; either version 2 of the |
---|
11 | License, or (at your option) any later version. |
---|
12 | |
---|
13 | This program is distributed in the hope that it will be useful, |
---|
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 | General Public License for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU General Public |
---|
19 | License along with this program; see the file COPYING. If not, |
---|
20 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
21 | Boston, MA 02111-1307, USA. |
---|
22 | |
---|
23 | Author: Rebecca Schulman <rebecka@eazel.com> |
---|
24 | */ |
---|
25 | |
---|
26 | |
---|
27 | #ifndef NAUTILUS_SEARCH_BAR_CRITERION_H |
---|
28 | #define NAUTILUS_SEARCH_BAR_CRITERION_H |
---|
29 | |
---|
30 | #include "nautilus-complex-search-bar.h" |
---|
31 | #include <gtk/gtkeventbox.h> |
---|
32 | #include <libnautilus-private/nautilus-entry.h> |
---|
33 | |
---|
34 | |
---|
35 | typedef enum { |
---|
36 | NAUTILUS_FILE_NAME_SEARCH_CRITERION, |
---|
37 | NAUTILUS_CONTENT_SEARCH_CRITERION, |
---|
38 | NAUTILUS_FILE_TYPE_SEARCH_CRITERION, |
---|
39 | NAUTILUS_SIZE_SEARCH_CRITERION, |
---|
40 | NAUTILUS_EMBLEM_SEARCH_CRITERION, |
---|
41 | NAUTILUS_DATE_MODIFIED_SEARCH_CRITERION, |
---|
42 | NAUTILUS_OWNER_SEARCH_CRITERION, |
---|
43 | NAUTILUS_NUMBER_OF_SEARCH_CRITERIA |
---|
44 | } NautilusSearchBarCriterionType; |
---|
45 | |
---|
46 | |
---|
47 | #define NAUTILUS_TYPE_SEARCH_BAR_CRITERION \ |
---|
48 | (nautilus_search_bar_criterion_get_type ()) |
---|
49 | #define NAUTILUS_SEARCH_BAR_CRITERION(obj) \ |
---|
50 | (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_SEARCH_BAR_CRITERION, NautilusSearchBarCriterion)) |
---|
51 | #define NAUTILUS_SEARCH_BAR_CRITERION_CLASS(klass) \ |
---|
52 | (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_SEARCH_BAR_CRITERION, NautilusSearchBarCriterionClass)) |
---|
53 | #define NAUTILUS_IS_SEARCH_BAR_CRITERION(obj) \ |
---|
54 | (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_SEARCH_BAR_CRITERION)) |
---|
55 | #define NAUTILUS_IS_SEARCH_BAR_CRITERION_CLASS(klass) \ |
---|
56 | (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_SEARCH_BAR_CRITERION)) |
---|
57 | |
---|
58 | |
---|
59 | typedef struct NautilusSearchBarCriterionDetails NautilusSearchBarCriterionDetails; |
---|
60 | |
---|
61 | typedef struct NautilusSearchBarCriterion { |
---|
62 | GtkEventBox parent_slot; |
---|
63 | NautilusSearchBarCriterionDetails *details; |
---|
64 | } NautilusSearchBarCriterion; |
---|
65 | |
---|
66 | |
---|
67 | typedef struct { |
---|
68 | GtkEventBoxClass parent_slot; |
---|
69 | } NautilusSearchBarCriterionClass; |
---|
70 | |
---|
71 | |
---|
72 | typedef void (* NautilusSearchBarCriterionCallback) (NautilusSearchBarCriterion *old_criterion, |
---|
73 | gpointer data); |
---|
74 | |
---|
75 | GtkType nautilus_search_bar_criterion_get_type (void); |
---|
76 | |
---|
77 | /* Three new procedures, each with a separate purpose: |
---|
78 | create the initial search option with first_new, |
---|
79 | create a new subsequent one automatically with next_new, |
---|
80 | and change to a particular type at a user's request with new_with_type */ |
---|
81 | NautilusSearchBarCriterion * nautilus_search_bar_criterion_first_new (NautilusComplexSearchBar *bar); |
---|
82 | |
---|
83 | NautilusSearchBarCriterion * nautilus_search_bar_criterion_next_new (NautilusSearchBarCriterionType criterion_type, |
---|
84 | NautilusComplexSearchBar *bar); |
---|
85 | NautilusSearchBarCriterion * nautilus_search_bar_criterion_new_with_type (NautilusSearchBarCriterionType criteiron_type, |
---|
86 | NautilusComplexSearchBar *bar); |
---|
87 | |
---|
88 | |
---|
89 | char * nautilus_search_bar_criterion_get_location (NautilusSearchBarCriterion *criterion); |
---|
90 | |
---|
91 | void nautilus_search_bar_criterion_show (NautilusSearchBarCriterion *criterion); |
---|
92 | void nautilus_search_bar_criterion_hide (NautilusSearchBarCriterion *criterion); |
---|
93 | |
---|
94 | /* Run when a criteria changes so that we can be sure we give only valid criteria choices to the user, |
---|
95 | (like whether you can select name, type, etc. */ |
---|
96 | void nautilus_search_bar_criterion_update_valid_criteria_choices (NautilusSearchBarCriterion *criterion, |
---|
97 | GSList *current_criteria); |
---|
98 | |
---|
99 | |
---|
100 | /* Search URI utilities. Maybe these should go in a separate file? */ |
---|
101 | char * nautilus_search_bar_criterion_human_from_uri (const char *location_uri); |
---|
102 | |
---|
103 | char * nautilus_search_uri_get_first_criterion (const char *search_uri); |
---|
104 | |
---|
105 | #endif /* NAUTILUS_SEARCH_BAR_CRITERION_H */ |
---|