aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/month-view.h
blob: 300c8c5607085a817385be44e83b9564a3106e67 (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
/* Month view display for gncal
 *
 * Copyright (C) 1998 Red Hat Software, Inc.
 *
 * Author: Federico Mena <federico@nuclecu.unam.mx>
 */

#ifndef MONTH_VIEW_H
#define MONTH_VIEW_H

#include <libgnome/gnome-defs.h>
#include "gnome-cal.h"
#include "gnome-month-item.h"


BEGIN_GNOME_DECLS


#define TYPE_MONTH_VIEW            (month_view_get_type ())
#define MONTH_VIEW(obj)            (GTK_CHECK_CAST ((obj), TYPE_MONTH_VIEW, MonthView))
#define MONTH_VIEW_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), TYPE_MONTH_VIEW, MonthViewClass))
#define IS_MONTH_VIEW(obj)         (GTK_CHECK_TYPE ((obj), TYPE_MONTH_VIEW))
#define IS_MONTH_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_MONTH_VIEW))


typedef struct _MonthView MonthView;
typedef struct _MonthViewClass MonthViewClass;

struct _MonthView {
    GnomeCanvas canvas;

    GnomeCalendar *calendar;    /* The calendar we are associated to */

    int year;           /* The year of the month we are displaying */
    int month;          /* The month we are displaying */
    int old_current_index;      /* The index of the day marked as current, or -1 if none */

    GList *children;        /* The list of children (events) we are carrying */
    int num_slots;          /* The number of slots we need to do the child layout (layout.h) */

    GnomeCanvasItem *title;     /* The title heading with the month/year */
    GnomeCanvasItem *mitem;     /* The canvas month item used by this month view */
};

struct _MonthViewClass {
    GnomeCanvasClass parent_class;
};


/* Standard Gtk function */
GtkType month_view_get_type (void);

/* Creates a new month view widget associated to the specified calendar */
GtkWidget *month_view_new (GnomeCalendar *calendar, time_t month);

/* Notifies the month view that a calendar object has changed */
void month_view_update (MonthView *mv, iCalObject *ico, int flags);

/* Notifies the month view about a change of date */
void month_view_set (MonthView *mv, time_t month);

/* Notifies the month view that the time format has changed */
void month_view_time_format_changed (MonthView *mv);

/* Notifies the month view that the colors have changed */
void month_view_colors_changed (MonthView *mv);


END_GNOME_DECLS

#endif