aboutsummaryrefslogtreecommitdiffstats
path: root/libical/src/libical/icalvalueimpl.h
blob: 8d39e6ca7f4ba39f7f9be33b5f702255e0403673 (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
/* -*- Mode: C -*- */
/*======================================================================
  FILE: icalvalue.c
  CREATOR: eric 02 May 1999
  
  $Id$


 (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org

 This program is free software; you can redistribute it and/or modify
 it under the terms of either: 

    The LGPL as published by the Free Software Foundation, version
    2.1, available at: http://www.fsf.org/copyleft/lesser.html

  Or:

    The Mozilla Public License Version 1.0. You may obtain a copy of
    the License at http://www.mozilla.org/MPL/

  The original code is icalvalue.c

  Contributions from:
     Graham Davison (g.m.davison@computer.org)


======================================================================*/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#ifndef ICALVALUEIMPL_H
#define ICALVALUEIMPL_H

#include "icalenums.h"
#include "icalderivedvalue.h"
#include "icalderivedproperty.h"

/* Private structure for ATTACH values */
struct icalattach_impl {
    /* Reference count */
    int refcount;

    union {
        /* URL attachment data */
        struct {
            char *url;
        } url;

        /* Inline data */
        struct {
            unsigned char *data;
            icalattach_free_fn_t free_fn;
            void *free_fn_data;
        } data;
    } u;

    /* TRUE if URL, FALSE if inline data */
    unsigned int is_url : 1;
};

struct icalvalue_impl {
    icalvalue_kind kind; /*this is the kind that is visible from the outside*/

    char id[5];
    int size;
    icalproperty* parent;
    const char* x_value;

    union data {
    icalattach *v_attach;
    /* void *v_binary; */ /* use v_attach */
    const char *v_string;
    /*char *v_text;*/
    /*char *v_caladdress;*/
    /*char *v_uri;*/
    float v_float;
    int v_int;
    /*int v_boolean;*/
    /*int v_integer;*/
    struct icaldurationtype v_duration;
    /*int v_utcoffset;*/
    
    struct icalperiodtype v_period;
    /*struct icalperiodtype v_datetimeperiod;*/
    struct icalgeotype v_geo;
    /*time_t v_time;*/
    struct icaltimetype v_time;
    /*struct icaltimetype v_date;*/
    /*struct icaltimetype v_datetime;*/
    /*struct icaltimetype v_datetimedate;*/
    
    /* struct icalrecurrencetype was once included
       directly ( not referenced ) in this union, but it
       contributes 2000 bytes to every value, so now it is
       a reference*/
    
    struct icalrecurrencetype *v_recur;
    struct icaltriggertype v_trigger;

        int v_enum;
        /* v_enum takes care of several enumerated types including: 
    icalproperty_method v_method;
    icalproperty_status v_status;
        icalproperty_action v_action;
        icalproperty_class v_class;
    icalproperty_transp v_transp;
        */

    } data;
};

struct icalvalue_impl *icalvalue_new_impl(icalvalue_kind kind);

#endif