Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
calRecurrenceRule.cpp File Reference
#include "nsCOMArray.h"
#include "calRecurrenceRule.h"
#include "calDateTime.h"
#include "calIItemBase.h"
#include "calIEvent.h"
#include "calICSService.h"
#include "nsIClassInfoImpl.h"
#include <climits>

Go to the source code of this file.

Defines

#define RECUR_HELPER(x)   case ICAL_##x##_RECURRENCE: aType.AssignLiteral( #x ); break
#define RECUR_HELPER(x)   if (aType.EqualsLiteral( #x )) mIcalRecur.freq = ICAL_##x##_RECURRENCE
#define HANDLE_COMPONENT(_comptype, _icalvar, _icalmax)
#define HANDLE_COMPONENT(_comptype, _icalvar, _icalmax)

Functions

static icaltimetype ensureDateTime (icaltimetype const &icalt)

Define Documentation

#define HANDLE_COMPONENT (   _comptype,
  _icalvar,
  _icalmax 
)
Value:
if (aComponentType.EqualsLiteral( #_comptype )) {                    \
        int count;                                                      \
        for (count = 0; count < _icalmax; count++) {                    \
            if (mIcalRecur._icalvar[count] == ICAL_RECURRENCE_ARRAY_MAX) \
                break;                                                  \
        }                                                               \
        if (count) {                                                    \
            *aValues = (PRInt16*) nsMemory::Clone(mIcalRecur._icalvar,  \
                                                  count * sizeof(PRInt16)); \
            if (!*aValues) return NS_ERROR_OUT_OF_MEMORY;               \
        } else {                                                        \
            *aValues = nsnull;                                          \
        }                                                               \
        *aCount = count;                                                \
    }
#define HANDLE_COMPONENT (   _comptype,
  _icalvar,
  _icalmax 
)
Value:
if (aComponentType.EqualsLiteral( #_comptype )) {                    \
        if (aCount > _icalmax)                                          \
            return NS_ERROR_FAILURE;                                    \
        memcpy(mIcalRecur._icalvar, aValues, aCount * sizeof(PRInt16)); \
        if (aCount < _icalmax)                                          \
            mIcalRecur._icalvar[aCount] = ICAL_RECURRENCE_ARRAY_MAX;    \
    }
#define RECUR_HELPER (   x)    case ICAL_##x##_RECURRENCE: aType.AssignLiteral( #x ); break
#define RECUR_HELPER (   x)    if (aType.EqualsLiteral( #x )) mIcalRecur.freq = ICAL_##x##_RECURRENCE

Function Documentation

static icaltimetype ensureDateTime ( icaltimetype const icalt) [inline, static]

Definition at line 406 of file calRecurrenceRule.cpp.

                                                                     {
    if (!icalt.is_date) {
        return icalt;
    } else {
        icaltimetype ret = icalt;
        ret.is_date = 0;
        ret.hour = 0;
        ret.minute = 0;
        ret.second = 0;
        return ret;
    }
}