aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/itip-utils.h
blob: 3c84af929f8ff946b431a3af4fae405108eb9faf (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
/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) version 3.
 *
 * 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with the program; if not, see <http://www.gnu.org/licenses/>  
 *
 *
 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
 *
 */

#ifndef ITIP_UTILS_HEADER
#define ITIP_UTILS_HEADER

#include <libical/ical.h>
#include <string.h>
#include <glib.h>
#include <libecal/e-cal.h>
#include <libecal/e-cal-component.h>
#include <libedataserver/e-account-list.h>

typedef enum {
    E_CAL_COMPONENT_METHOD_PUBLISH,
    E_CAL_COMPONENT_METHOD_REQUEST,
    E_CAL_COMPONENT_METHOD_REPLY,
    E_CAL_COMPONENT_METHOD_ADD,
    E_CAL_COMPONENT_METHOD_CANCEL,
    E_CAL_COMPONENT_METHOD_REFRESH,
    E_CAL_COMPONENT_METHOD_COUNTER,
    E_CAL_COMPONENT_METHOD_DECLINECOUNTER
} ECalComponentItipMethod;

struct CalMimeAttach {
    char *filename;
    char *content_type;
    char *description;
    char *encoded_data;
    gboolean disposition;
    guint length;
};

EAccountList *itip_addresses_get (void);
EAccount *itip_addresses_get_default (void);

gboolean itip_organizer_is_user (ECalComponent *comp, ECal *client);
gboolean itip_sentby_is_user (ECalComponent *comp);

const gchar *itip_strip_mailto (const gchar *address);

char *itip_get_comp_attendee (ECalComponent *comp, ECal *client);

gboolean itip_send_comp (ECalComponentItipMethod method, ECalComponent *comp,
             ECal *client, icalcomponent *zones, GSList *attachments_list, GList *users, gboolean strip_alarms);

gboolean itip_publish_comp (ECal *client, gchar* uri, gchar* username,
                gchar* password, ECalComponent **pub_comp);

gboolean itip_publish_begin (ECalComponent *pub_comp, ECal *client,
                 gboolean cloned, ECalComponent **clone);

gboolean reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp,
                ECal *client, gboolean reply_all, icalcomponent *zones, GSList *attachments_list);

gboolean is_icalcomp_valid (icalcomponent *icalcomp);

#endif