Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions
VFreeBusy Class Reference

#include <vcomponent.h>

Inheritance diagram for VFreeBusy:
Inheritance graph
[legend]
Collaboration diagram for VFreeBusy:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 VFreeBusy ()
 VFreeBusy (const VFreeBusy &)
VFreeBusyoperator= (const VFreeBusy &)
 ~VFreeBusy ()
 VFreeBusy (icalcomponent *v)
 VFreeBusy (string str)
 operator icalcomponent * ()
void new_from_string (string str)
void detach ()
string as_ical_string () throw (icalerrorenum)
bool is_valid ()
icalcomponent_kind isa ()
int isa_component (void *component)
void add_property (ICalProperty *property)
 Working with properties.
void remove_property (ICalProperty *property)
int count_properties (icalproperty_kind kind)
ICalPropertyget_current_property ()
ICalPropertyget_first_property (icalproperty_kind kind)
ICalPropertyget_next_property (icalproperty_kind kind)
VComponentget_inner ()
 Return the first VEVENT, VTODO or VJOURNAL sub-component if it is one of those types.
void add_component (VComponent *child)
void remove_component (VComponent *child)
int count_components (icalcomponent_kind kind)
VComponentget_current_component ()
 Iteration Routines.
VComponentget_first_component (icalcomponent_kind kind)
VComponentget_next_component (icalcomponent_kind kind)
icalcompiter begin_component (icalcomponent_kind kind)
 Using external iterators.
icalcompiter end_component (icalcomponent_kind kind)
VComponentnext (icalcompiter *i)
VComponentprev (icalcompiter *i)
VComponentcurrent (icalcompiter *i)
int count_errors ()
 Working with embedded error properties.
void strip_errors ()
 Remove all X-LIC-ERROR properties.
void convert_errors ()
 Convert some X-LIC-ERROR properties into RETURN-STATUS properties.
struct icaltimetype get_dtstart ()
void set_dtstart (struct icaltimetype v)
struct icaltimetype get_dtend ()
 For the icalcomponent routines only, dtend and duration are tied together.
void set_dtend (struct icaltimetype v)
struct icaltimetype get_due ()
void set_due (struct icaltimetype v)
struct icaldurationtype get_duration ()
void set_duration (struct icaldurationtype v)
icalproperty_method get_method ()
void set_method (icalproperty_method method)
struct icaltimetype get_dtstamp ()
void set_dtstamp (struct icaltimetype v)
string get_summary ()
void set_summary (string v)
string get_location ()
void set_location (string v)
string get_description ()
void set_description (string v)
string get_comment ()
void set_comment (string v)
string get_uid ()
void set_uid (string v)
string get_relcalid ()
void set_relcalid (string v)
struct icaltimetype get_recurrenceid ()
void set_recurrenceid (struct icaltimetype v)
int get_sequence ()
void set_sequence (int v)
int get_status ()
void set_status (enum icalproperty_status v)
VComponentget_first_real_component ()
 For VCOMPONENT: Return a reference to the first VEVENT, VTODO, or VJOURNAL.
virtual struct icaltime_span get_span ()
 For VEVENT, VTODO, VJOURNAL and VTIMEZONE: report the start and end times of an event in UTC.
int recurrence_is_excluded (struct icaltimetype *dtstart, struct icaltimetype *recurtime)
bool remove (VComponent &, bool ignoreValue)
 helper functions for adding/removing/updating property and sub-components
bool update (VComponent &, bool removeMissing)
bool add (VComponent &)

Static Public Member Functions

static icalcomponent_kind string_to_kind (string str)
 Kind conversion routines.
static string kind_to_string (icalcomponent_kind kind)

Detailed Description

Definition at line 294 of file vcomponent.h.


Constructor & Destructor Documentation

Definition at line 758 of file vcomponent.cpp.

Definition at line 759 of file vcomponent.cpp.

: VComponent(v) {}

Definition at line 766 of file vcomponent.cpp.

{}
VFreeBusy::VFreeBusy ( icalcomponent *  v)

Definition at line 768 of file vcomponent.cpp.

Definition at line 769 of file vcomponent.cpp.


Member Function Documentation

bool VComponent::add ( VComponent fromC) [inherited]

Definition at line 524 of file vcomponent.cpp.

                                     {
       /* make sure the kind are the same */
       if (this->isa() != fromC.isa()) return false;

       /* properties first */
    ICalPropertyTmpPtr prop;
       for (prop=fromC.get_first_property(ICAL_ANY_PROPERTY); prop != NULL;
               prop=fromC.get_next_property(ICAL_ANY_PROPERTY)) {
              /* clone another property */
              ICalProperty *p = new ICalProperty(*prop);
              add_property(p);
       }

       /* sub-components next */
       bool err = false;
    VComponentTmpPtr comp;
       for (comp=fromC.get_first_component(ICAL_ANY_COMPONENT); comp != NULL;
               comp=fromC.get_next_component(ICAL_ANY_COMPONENT)) {
              VComponent *c = new VComponent(comp->isa());
              err = c->add(*comp);
              add_component(c);
       }

       return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void VComponent::add_component ( VComponent child) [inherited]

Definition at line 171 of file vcomponent.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void VComponent::add_property ( ICalProperty property) [inherited]

Working with properties.

Definition at line 137 of file vcomponent.cpp.

                                                   {
       icalcomponent_add_property(imp, *property);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 109 of file vcomponent.cpp.

                                                        {
  char *str = icalcomponent_as_ical_string(imp);

  if (!str) throw icalerrno;

  return(str);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Using external iterators.

Definition at line 254 of file vcomponent.cpp.

                                                               {
       return icalcomponent_begin_component(imp, kind);
}

Here is the call graph for this function:

Convert some X-LIC-ERROR properties into RETURN-STATUS properties.

Definition at line 281 of file vcomponent.cpp.

Here is the call graph for this function:

Definition at line 177 of file vcomponent.cpp.

                                                       {
       return        icalcomponent_count_components(imp, kind);
}

Here is the call graph for this function:

int VComponent::count_errors ( ) [inherited]

Working with embedded error properties.

Definition at line 271 of file vcomponent.cpp.

Here is the call graph for this function:

Definition at line 145 of file vcomponent.cpp.

                                                      {
       return icalcomponent_count_properties(imp, kind);
}

Here is the call graph for this function:

Definition at line 266 of file vcomponent.cpp.

                                              {
       return (VComponent*)icalcompiter_deref(i);
}

Here is the call graph for this function:

void VComponent::detach ( ) [inline, inherited]

Definition at line 46 of file vcomponent.h.

                     {
           imp = NULL;
       }

Definition at line 257 of file vcomponent.cpp.

                                                             {
       return icalcomponent_end_component(imp, kind);
}

Here is the call graph for this function:

Definition at line 367 of file vcomponent.cpp.

                              {
       return (string)icalcomponent_get_comment(imp);
}

Here is the call graph for this function:

Iteration Routines.

There are two forms of iterators, internal and external. The internal ones came first, and are almost completely sufficient, but they fail badly when you want to construct a loop that removes components from the container. Iterate through components

Definition at line 188 of file vcomponent.cpp.

                                             {
       icalcomponent* t = icalcomponent_get_current_component(imp);
       return ((t != NULL) ? new VComponent(t) : NULL);
}

Here is the call graph for this function:

Definition at line 150 of file vcomponent.cpp.

                                              {
       icalproperty* t = icalcomponent_get_current_property(imp);
       return ((t != NULL) ? new ICalProperty(t) : NULL);
}

Here is the call graph for this function:

Definition at line 361 of file vcomponent.cpp.

                                  {
        return (string)icalcomponent_get_description(imp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct icaltimetype VComponent::get_dtend ( ) [read, inherited]

For the icalcomponent routines only, dtend and duration are tied together.

If you call the set routine for one and the other exists, the routine will calculate the change to the other. That is, if there is a DTEND and you call set_duration, the routine will modify DTEND to be the sum of DTSTART and the duration. If you call a get routine for one and the other exists, the routine will calculate the return value. If you call a set routine and neither exists, the routine will create the apropriate property

Definition at line 310 of file vcomponent.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

struct icaltimetype VComponent::get_dtstamp ( ) [read, inherited]

Definition at line 339 of file vcomponent.cpp.

Here is the call graph for this function:

struct icaltimetype VComponent::get_dtstart ( ) [read, inherited]

Definition at line 293 of file vcomponent.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

struct icaltimetype VComponent::get_due ( ) [read, inherited]

Definition at line 318 of file vcomponent.cpp.

                                       {
        return icalcomponent_get_due(imp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct icaldurationtype VComponent::get_duration ( ) [read, inherited]

Definition at line 325 of file vcomponent.cpp.

Here is the call graph for this function:

Definition at line 192 of file vcomponent.cpp.

                                                                  {
       VComponent* result = NULL;
       icalcomponent* t = icalcomponent_get_first_component(imp, kind);
       if (t != NULL) {
              switch (kind) {
                     case ICAL_VALARM_COMPONENT:
                            result = new VAlarm(t);
                            break;
                     case ICAL_VCALENDAR_COMPONENT:
                            result = new VCalendar(t);
                            break;
                     case ICAL_VEVENT_COMPONENT:
                            result = new VEvent(t);
                            break;
                     case ICAL_VQUERY_COMPONENT:
                            result = new VQuery(t);
                            break;
                     case ICAL_VTODO_COMPONENT:
                            result = new VToDo(t);
                            break;
                        case ICAL_VAGENDA_COMPONENT:
                                result = new VAgenda(t);
                                break;
                     default:
                            result = new VComponent(t);
              }
       }

       return (result);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 155 of file vcomponent.cpp.

                                                                  {
       icalproperty* t = icalcomponent_get_first_property(imp, kind);
       return ((t != NULL) ? new ICalProperty(t) : NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

For VCOMPONENT: Return a reference to the first VEVENT, VTODO, or VJOURNAL.

Definition at line 410 of file vcomponent.cpp.

Here is the call graph for this function:

VComponent * VComponent::get_inner ( ) [inherited]

Return the first VEVENT, VTODO or VJOURNAL sub-component if it is one of those types.

Definition at line 167 of file vcomponent.cpp.

Here is the call graph for this function:

Definition at line 353 of file vcomponent.cpp.

                               {
        return (string)icalcomponent_get_location(imp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 332 of file vcomponent.cpp.

Here is the call graph for this function:

Definition at line 222 of file vcomponent.cpp.

                                                                 {
       VComponent* result = NULL;
       icalcomponent* t = icalcomponent_get_next_component(imp, kind);
       if (t != NULL) {
              switch (kind) {
                     case ICAL_VALARM_COMPONENT:
                            result = new VAlarm(t);
                            break;
                     case ICAL_VCALENDAR_COMPONENT:
                            result = new VCalendar(t);
                            break;
                     case ICAL_VEVENT_COMPONENT:
                            result = new VEvent(t);
                            break;
                     case ICAL_VQUERY_COMPONENT:
                            result = new VQuery(t);
                            break;
                     case ICAL_VTODO_COMPONENT:
                            result = new VToDo(t);
                            break;
                        case ICAL_VAGENDA_COMPONENT:
                                result = new VAgenda(t);
                                break;
                     default:
                            result = new VComponent(t);
              }
       }

       return (result);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 160 of file vcomponent.cpp.

                                                                 {
       icalproperty* t = icalcomponent_get_next_property(imp, kind);
       return ((t != NULL) ? new ICalProperty(t) : NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct icaltimetype VComponent::get_recurrenceid ( ) [read, inherited]

Definition at line 388 of file vcomponent.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 381 of file vcomponent.cpp.

                               {
       return (string)icalcomponent_get_relcalid(imp);
}

Here is the call graph for this function:

int VComponent::get_sequence ( ) [inherited]

Definition at line 395 of file vcomponent.cpp.

                            {
        return (int)icalcomponent_get_sequence(imp);
}

Here is the call graph for this function:

struct icaltime_span VComponent::get_span ( ) [read, virtual, inherited]

For VEVENT, VTODO, VJOURNAL and VTIMEZONE: report the start and end times of an event in UTC.

Definition at line 416 of file vcomponent.cpp.

Here is the call graph for this function:

int VComponent::get_status ( ) [inherited]

Definition at line 402 of file vcomponent.cpp.

                          {
        return (int)icalcomponent_get_status(imp);
}

Here is the call graph for this function:

Definition at line 346 of file vcomponent.cpp.

                              {
       return (string)icalcomponent_get_summary(imp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

string VComponent::get_uid ( ) [inherited]

Definition at line 374 of file vcomponent.cpp.

                          {
       return (string)icalcomponent_get_uid(imp);
}

Here is the call graph for this function:

bool VComponent::is_valid ( ) [inherited]

Definition at line 118 of file vcomponent.cpp.

                         {
       if (imp == NULL) return false;
       return (icalcomponent_is_valid(imp) ? true : false);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 123 of file vcomponent.cpp.

                                  {
       return icalcomponent_isa(imp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int VComponent::isa_component ( void component) [inherited]

Definition at line 127 of file vcomponent.cpp.

                                            {
       return icalcomponent_isa_component(component);
}

Here is the call graph for this function:

string VComponent::kind_to_string ( icalcomponent_kind  kind) [static, inherited]

Definition at line 289 of file vcomponent.cpp.

                                                        {
       return (string)icalcomponent_kind_to_string(kind);
}

Here is the call graph for this function:

void VComponent::new_from_string ( string  str) [inherited]

Definition at line 131 of file vcomponent.cpp.

Here is the call graph for this function:

VComponent * VComponent::next ( icalcompiter i) [inherited]

Definition at line 260 of file vcomponent.cpp.

                                           {
       return (VComponent*)icalcompiter_next(i);
}

Here is the call graph for this function:

Here is the caller graph for this function:

VComponent::operator icalcomponent * ( ) [inline, inherited]

Definition at line 40 of file vcomponent.h.

{ return imp; }
VFreeBusy & VFreeBusy::operator= ( const VFreeBusy v)

Definition at line 760 of file vcomponent.cpp.

                                                 {
       if (this == &v) return *this;
       VComponent::operator=(v);

       return *this;
}
VComponent * VComponent::prev ( icalcompiter i) [inherited]

Definition at line 263 of file vcomponent.cpp.

                                           {
       return (VComponent*)icalcompiter_prior(i);
}

Here is the call graph for this function:

int VComponent::recurrence_is_excluded ( struct icaltimetype dtstart,
struct icaltimetype recurtime 
) [inherited]

Definition at line 420 of file vcomponent.cpp.

                                                                      {
       return  icalproperty_recurrence_is_excluded(imp, dtstart, recurtime);
}

Here is the call graph for this function:

bool VComponent::remove ( VComponent fromVC,
bool  ignoreValue 
) [inherited]

helper functions for adding/removing/updating property and sub-components

Note: the VComponent kind have to be the same

Definition at line 435 of file vcomponent.cpp.

                                                           {

    /* the two components must be the same kind */
    if (this->isa() != fromVC.isa()) return false;

    /* properties first */
    ICalPropertyTmpPtr propToBeRemoved;
    for (propToBeRemoved=fromVC.get_first_property(ICAL_ANY_PROPERTY); propToBeRemoved != NULL;
         propToBeRemoved=fromVC.get_next_property(ICAL_ANY_PROPERTY)) {

        /* loop through properties from this component */
        ICalPropertyTmpPtr next;
        ICalPropertyTmpPtr p;
        for (p=this->get_first_property(propToBeRemoved->isa()); p != NULL; p=next) {
            next = this->get_next_property(propToBeRemoved->isa());
            if (ignoreValue)
                 this->remove_property(p);
            else {
                 if (*p == *propToBeRemoved) {
                     this->remove_property(p);
                     break;
                 }
            }
        }
    }

    /* components next - should remove by UID */
    VComponentTmpPtr comp;
    for (comp=fromVC.get_first_component(ICAL_ANY_COMPONENT); comp != NULL;
         comp=fromVC.get_next_component(ICAL_ANY_COMPONENT)) {
        const char* fromCompUid = comp->get_uid();
        VComponentTmpPtr c;
        for (c=this->get_first_component(comp->isa()); c != NULL;
             c=this->get_next_component(comp->isa())) {
            const char* thisCompUid = c->get_uid();
            if (strcmp(fromCompUid, thisCompUid) == 0) {
                // recursively go down the components
                c->remove(*comp, ignoreValue);
                    // if all properties are removed and there is no sub-components, then
                    // remove this compoent
                    if ((c->count_properties(ICAL_ANY_PROPERTY) == 0) &&
                        (c->count_components(ICAL_ANY_COMPONENT) == 0)) {
                        this->remove_component(c);
                    }
                break;
                }
            }
    }
    
    return true;
}

Here is the call graph for this function:

void VComponent::remove_component ( VComponent child) [inherited]

Definition at line 174 of file vcomponent.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void VComponent::remove_property ( ICalProperty property) [inherited]

Definition at line 140 of file vcomponent.cpp.

                                                      {
       icalcomponent_remove_property(imp, *property);
       icalproperty_free(*property);
        property->detach();        // set imp to null, it's free already.
}

Here is the call graph for this function:

Here is the caller graph for this function:

void VComponent::set_comment ( string  v) [inherited]

Definition at line 370 of file vcomponent.cpp.

Here is the call graph for this function:

Definition at line 364 of file vcomponent.cpp.

Here is the call graph for this function:

void VComponent::set_dtend ( struct icaltimetype  v) [inherited]

Definition at line 314 of file vcomponent.cpp.

Here is the call graph for this function:

void VComponent::set_dtstamp ( struct icaltimetype  v) [inherited]

Definition at line 342 of file vcomponent.cpp.

Here is the call graph for this function:

void VComponent::set_dtstart ( struct icaltimetype  v) [inherited]

Definition at line 296 of file vcomponent.cpp.

Here is the call graph for this function:

void VComponent::set_due ( struct icaltimetype  v) [inherited]

Definition at line 321 of file vcomponent.cpp.

Here is the call graph for this function:

void VComponent::set_duration ( struct icaldurationtype  v) [inherited]

Definition at line 328 of file vcomponent.cpp.

Here is the call graph for this function:

void VComponent::set_location ( string  v) [inherited]

Definition at line 356 of file vcomponent.cpp.

Here is the call graph for this function:

Definition at line 335 of file vcomponent.cpp.

Here is the call graph for this function:

void VComponent::set_recurrenceid ( struct icaltimetype  v) [inherited]

Definition at line 391 of file vcomponent.cpp.

Here is the call graph for this function:

void VComponent::set_relcalid ( string  v) [inherited]

Definition at line 384 of file vcomponent.cpp.

Here is the call graph for this function:

void VComponent::set_sequence ( int  v) [inherited]

Definition at line 398 of file vcomponent.cpp.

Here is the call graph for this function:

Definition at line 405 of file vcomponent.cpp.

Here is the call graph for this function:

void VComponent::set_summary ( string  v) [inherited]

Definition at line 349 of file vcomponent.cpp.

Here is the call graph for this function:

void VComponent::set_uid ( string  v) [inherited]

Definition at line 377 of file vcomponent.cpp.

Here is the call graph for this function:

Kind conversion routines.

Definition at line 286 of file vcomponent.cpp.

Here is the call graph for this function:

void VComponent::strip_errors ( ) [inherited]

Remove all X-LIC-ERROR properties.

Definition at line 276 of file vcomponent.cpp.

Here is the call graph for this function:

bool VComponent::update ( VComponent fromC,
bool  removeMissing 
) [inherited]

Definition at line 489 of file vcomponent.cpp.

                                                            {

    /* make sure they are the same kind */
    if (this->isa() != fromC.isa()) return false;

    /* property first */
    ICalPropertyTmpPtr prop;
    for (prop=fromC.get_first_property(ICAL_ANY_PROPERTY); prop != NULL;
        prop=fromC.get_next_property(ICAL_ANY_PROPERTY)) {
        ICalPropertyTmpPtr thisProp;
       thisProp = this->get_first_property(prop->isa());
       if (thisProp == NULL) {
            thisProp = new ICalProperty(prop->isa());
            this->add_property(thisProp);
        }
        ICalValue *value = new ICalValue(*(prop->get_value())); // clone the value
        thisProp->set_value(*value);
    }

    /* recursively updating sub-components */
    VComponentTmpPtr comp;
    for (comp=fromC.get_first_component(ICAL_ANY_COMPONENT); comp != NULL;
         comp=fromC.get_next_component(ICAL_ANY_COMPONENT)) {
        VComponentTmpPtr thisComp;
        thisComp = this->get_first_component(comp->isa());
        if (thisComp == NULL) {
            thisComp = new VComponent(comp->isa());
            this->add_component(thisComp);
        }
        bool err = thisComp->update(*comp, removeMissing);
        if (!err) return false;
    }
    return true;
}

Here is the call graph for this function:


The documentation for this class was generated from the following files: