include/VCalConverter.h

00001 /*
00002  * @file VCalConverter.h
00003  * This file is part of Maemo calendar.
00004  * It is the header file for ALL class.
00005  *
00006  * Copyright (C) 2008 Nokia Corporation. All rights reserved.
00007  *
00008  * Contact: Biris Ilias <ilias.biris@nokia.com>
00009  *
00010  * This software, including documentation, is protected by copyright 
00011  * controlled by Nokia Corporation. All rights are reserved. Copying, 
00012  * including reproducing, storing, adapting or translating, any or all
00013  * of this material requires the prior written consent of Nokia Corporation.
00014  * This material also contains confidential information which may not be
00015  * disclosed to others without the prior written consent of Nokia.
00016  */
00017 
00018 #ifndef __VCALCONVERTER_H__
00019 #define __VCALCONVERTER_H__
00020 
00021 #include "Common.h"
00022 #include "ICalConverter.h"
00023 #include <vector>
00024 #include <string>
00025 using namespace std;
00026 extern "C" {
00027 #include <libical/ical.h>
00028 #include <libical/icalcomponent.h>
00029 #include <libical/icalenums.h>
00030 #include "stdlib.h"
00031 #include "stdio.h"
00032 }
00033 
00034 using std::string;
00040 class VCalConverter
00041 {
00042     public:
00046         VCalConverter();
00050         ~VCalConverter();
00051 
00058         FileType checkContentsType(string szContents);
00059         
00067         string vCalToICalRule(string vcal);
00068         
00076         string iCalToVCalRule(string ical);
00077 
00085         string vCalToICalDate(string vcal);
00086         
00094         string iCalToVCalDate(string ical);
00102         string vCalToICalAlarm(string vCalAlarm);
00110         string iCalToVCalAlarm(string iCalAlarm);
00117         vector<string> getTokens(string str, string delimiter);
00118         
00126         string getTranspFromVcal(string szContents);
00127         
00135         icaltimetype getCreatedTimeFromVcal(string szContents);
00136         
00144         int getStatusFromVcal(string szContents);
00152         icalproperty* getVcalTransp(string szTransp);
00160         string getVcalStatus(statusParam iStatus);
00168         int getParticipationRoleFromVcal(string szAtten);
00176         string getVcalPartRole(int iRole);
00185         string getVcalCreatedTime(string szTime,string szContents);
00193         icalparameter* getVcalRSVP(bool fRSVP);
00201         bool getRSVPFromVcal(string szContents);
00202         
00203     private:
00213         void Tokenize(const string & str, 
00214                         vector <string> &tokens,
00215                          string delimiters = " ");
00224         string getNoDelimiterString(string str, string delimiters, string repStr);
00225             
00231         void initRecurrenceItem(RecurrenceItem* item);
00232         
00240         int getDay(string vcal, bool opFlag);
00241     
00248         string getByMonthFromVcal(string vcal);
00249         
00256         string getByDayFromVcal(string vcal);
00257         
00264         string getDurationFromVcal(string vcal);
00265         
00273         string getFrequency(vector<string> tokens, int index);
00274         
00282         string getInterval(vector<string> tokens, int index);
00283         
00291         string getCount(vector<string> tokens, int index);
00292         
00300         string getUntil(vector<string> tokens, int index);
00301         
00309         string getByDayFromIcal(vector<string> tokens, int index);
00310         
00318         string getByMonthFromIcal(vector<string> tokens, int index);
00319 
00326         time_t tzStringTogmtime(string strIcalComp);
00327         
00335         string gmttimeToTZString(time_t tTime, bool onlyDate);
00336         
00344         string getVCalDate(vector<string> tokens, int index, int type);
00345 
00352         string getAudioAlarm(string alarm);
00353 };
00354 #endif

Generated on Tue Feb 24 16:21:31 2009 for calendar-backend by  doxygen 1.5.1