00001 // 00002 // \file vtodo.h 00003 // Conversion routines for vtodos (VCALENDAR, etc) 00004 // 00005 00006 /* 00007 Copyright (C) 2008-2009, Nicolas VIVIEN 00008 Copyright (C) 2006-2010, Net Direct Inc. (http://www.netdirect.ca/) 00009 00010 This program is free software; you can redistribute it and/or modify 00011 it under the terms of the GNU General Public License as published by 00012 the Free Software Foundation; either version 2 of the License, or 00013 (at your option) any later version. 00014 00015 This program is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00018 00019 See the GNU General Public License in the COPYING file at the 00020 root directory of this project for more details. 00021 */ 00022 00023 #ifndef __BARRY_SYNC_VTODO_H__ 00024 #define __BARRY_SYNC_VTODO_H__ 00025 00026 #include "dll.h" 00027 #include "vbase.h" 00028 #include "vformat.h" 00029 #include "r_task.h" 00030 #include <stdint.h> 00031 #include <string> 00032 00033 namespace Barry { namespace Sync { 00034 00035 // 00036 // vTodo 00037 // 00038 /// Class for converting between RFC 2445 iCalendar data format, 00039 /// and the Barry::Task class. 00040 /// 00041 class BXEXPORT vTodo : public vBase 00042 { 00043 // external reference 00044 vTimeConverter &m_vtc; 00045 00046 // data to pass to external requests 00047 char *m_gTodoData; // dynamic memory returned by vformat()... can 00048 // be used directly by the plugin, without 00049 // overmuch allocation and freeing (see Extract()) 00050 std::string m_vTodoData; // copy of m_gJournalData, for C++ use 00051 Barry::Task m_BarryTask; 00052 00053 protected: 00054 bool HasMultipleVTodos() const; 00055 00056 public: 00057 vTodo(vTimeConverter &vtc); 00058 ~vTodo(); 00059 00060 const std::string& ToTask(const Barry::Task &task); 00061 const Barry::Task& ToBarry(const char *vtodo, uint32_t RecordId); 00062 00063 char* ExtractVTodo(); 00064 00065 void Clear(); 00066 }; 00067 00068 }} // namespace Barry::Sync 00069 00070 #endif 00071