aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/cal-search-bar.h
blob: 5cc5d2fc49bd12097f4e21fb388296763257924e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/* Evolution calendar - Search bar widget for calendar views
 *
 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
 *
 * Author: Federico Mena-Quintero <federico@ximian.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifndef CAL_SEARCH_BAR_H
#define CAL_SEARCH_BAR_H

#include "misc/e-search-bar.h"
#include "misc/e-filter-bar.h"

G_BEGIN_DECLS



#define TYPE_CAL_SEARCH_BAR            (cal_search_bar_get_type ())
#define CAL_SEARCH_BAR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CAL_SEARCH_BAR, CalSearchBar))
#define CAL_SEARCH_BAR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CAL_SEARCH_BAR,  \
                    CalSearchBarClass))
#define IS_CAL_SEARCH_BAR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CAL_SEARCH_BAR))
#define IS_CAL_SEARCH_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CAL_SEARCH_BAR))

typedef struct CalSearchBarPrivate CalSearchBarPrivate;

enum {
    CAL_SEARCH_SUMMARY_CONTAINS      = (1 << 0),
    CAL_SEARCH_DESCRIPTION_CONTAINS  = (1 << 1),
    CAL_SEARCH_CATEGORY_IS           = (1 << 2),
    CAL_SEARCH_COMMENT_CONTAINS      = (1 << 3),
    CAL_SEARCH_LOCATION_CONTAINS     = (1 << 4),
    CAL_SEARCH_ANY_FIELD_CONTAINS    = (1 << 5)
};

#define CAL_SEARCH_ALL (0xff)
#define CAL_SEARCH_CALENDAR_DEFAULT (0x33)
#define CAL_SEARCH_TASKS_DEFAULT    (0xE3)
#define CAL_SEARCH_MEMOS_DEFAULT    (0x23)

typedef struct {
    EFilterBar  search_bar;

    /* Private data */
    CalSearchBarPrivate *priv;
} CalSearchBar;

typedef struct {
    EFilterBarClass parent_class;

    /* Notification signals */

    void (* sexp_changed) (CalSearchBar *cal_search, const char *sexp);
    void (* category_changed) (CalSearchBar *cal_search, const char *category);
} CalSearchBarClass;

GType cal_search_bar_get_type (void);

CalSearchBar *cal_search_bar_construct (CalSearchBar *cal_search, guint32 flags);

GtkWidget *cal_search_bar_new (guint32 flags);

void cal_search_bar_set_categories (CalSearchBar *cal_search, GPtrArray *categories);

const char *cal_search_bar_get_category (CalSearchBar *cal_search);

void cal_search_bar_get_time_range (CalSearchBar *cal_search, time_t *start, time_t *end);



G_END_DECLS

#endif