aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.h
blob: 0192efabe4d6ae64fca5f3a2413fccfdf2eb7f3d (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/* Evolution calendar - Main calendar view widget
 *
 * Copyright (C) 1998 The Free Software Foundation
 * Copyright (C) 2000 Helix Code, Inc.
 * Copyright (C) 2001 Ximian, Inc.
 *
 * Authors: Miguel de Icaza <miguel@ximian.com>
 *          Federico Mena-Quintero <federico@ximian.com>
 *          Seth Alves <alves@hungry.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef GNOME_CALENDAR_APP_H
#define GNOME_CALENDAR_APP_H

#include <time.h>
#include <libgnome/gnome-defs.h>
#include <gtk/gtkvbox.h>
#include <widgets/misc/e-calendar.h>
#include <cal-client/cal-client.h>

BEGIN_GNOME_DECLS



#define GNOME_TYPE_CALENDAR            (gnome_calendar_get_type ())
#define GNOME_CALENDAR(obj)            (GTK_CHECK_CAST ((obj), GNOME_TYPE_CALENDAR, GnomeCalendar))
#define GNOME_CALENDAR_CLASS(klass)    (GTK_CHECK_CAST_CLASS ((klass), GNOME_TYPE_CALENDAR, \
                    GnomeCalendarClass))
#define GNOME_IS_CALENDAR(obj)         (GTK_CHECK_TYPE ((obj), GNOME_TYPE_CALENDAR))
#define GNOME_IS_CALENDAR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_CALENDAR))

typedef struct _GnomeCalendar GnomeCalendar;
typedef struct _GnomeCalendarClass GnomeCalendarClass;
typedef struct _GnomeCalendarPrivate GnomeCalendarPrivate;

struct _GnomeCalendar {
    GtkVBox vbox;

    /* Private data */
    GnomeCalendarPrivate *priv;
};

struct _GnomeCalendarClass {
    GtkVBoxClass parent_class;
};


GtkType    gnome_calendar_get_type          (void);
GtkWidget *gnome_calendar_construct     (GnomeCalendar *gcal);

GtkWidget *gnome_calendar_new           (void);

CalClient *gnome_calendar_get_cal_client    (GnomeCalendar *gcal);

gboolean   gnome_calendar_open                  (GnomeCalendar *gcal, const char *str_uri);
/*
int    gnome_calendar_create        (GnomeCalendar *gcal,
                         char *file);
*/
void       gnome_calendar_next              (GnomeCalendar *gcal);
void       gnome_calendar_previous          (GnomeCalendar *gcal);
void       gnome_calendar_goto              (GnomeCalendar *gcal,
                         time_t new_time);
void       gnome_calendar_dayjump           (GnomeCalendar *gcal,
                         time_t time);
/* Jumps to the current day */
void       gnome_calendar_goto_today            (GnomeCalendar *gcal);
char      *gnome_calendar_get_current_view_name (GnomeCalendar *gcal);
void       gnome_calendar_set_view      (GnomeCalendar  *gcal,
                         char       *page_name,
                         gboolean    reset_range_shown,
                         gboolean    focus);

void       gnome_calendar_set_selected_time_range (GnomeCalendar *gcal,
                           time_t     start_time,
                           time_t     end_time);
void       gnome_calendar_get_selected_time_range (GnomeCalendar *gcal,
                           time_t    *start_time,
                           time_t    *end_time);

void       gnome_calendar_edit_object           (GnomeCalendar *gcal,
                         CalComponent  *comp);

void       gnome_calendar_new_appointment       (GnomeCalendar *gcal);
void       gnome_calendar_new_appointment_for   (GnomeCalendar *cal,
                         time_t dtstart, time_t dtend,
                         gboolean all_day);

/* Returns the selected time range for the current view. Note that this may be
   different from the fields in the GnomeCalendar, since the view may clip
   this or choose a more appropriate time. */
void       gnome_calendar_get_current_time_range (GnomeCalendar *gcal,
                          time_t     *start_time,
                          time_t     *end_time);

/* Tells the calendar to reload all config settings. initializing should be
   TRUE when we are setting the config settings for the first time. */
void       gnome_calendar_update_config_settings (GnomeCalendar *gcal,
                          gboolean   initializing);

void       gnome_calendar_set_view_buttons  (GnomeCalendar  *gcal,
                         GtkWidget  *day_button,
                         GtkWidget  *work_week_button,
                         GtkWidget  *week_button,
                         GtkWidget  *month_button);

/* This makes the appropriate radio button in the toolbar active.
   It sets the ignore_view_button_clicks flag so the "clicked" signal handlers
   just return without doing anything. */
void       gnome_calendar_update_view_buttons   (GnomeCalendar  *gcal);



END_GNOME_DECLS

#endif