ppp: minor cleanups to match other chatscripts order and documentation
[barry.git] / src / vtodo.h
blob2562267dfbdc6be402d7329dcef6facddcb4dd1e
1 //
2 // \file vtodo.h
3 // Conversion routines for vtodos (VCALENDAR, etc)
4 //
6 /*
7 Copyright (C) 2008-2009, Nicolas VIVIEN
8 Copyright (C) 2006-2010, Net Direct Inc. (http://www.netdirect.ca/)
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 See the GNU General Public License in the COPYING file at the
20 root directory of this project for more details.
23 #ifndef __BARRY_SYNC_VTODO_H__
24 #define __BARRY_SYNC_VTODO_H__
26 #include "dll.h"
27 #include "vbase.h"
28 #include "vformat.h"
29 #include "r_task.h"
30 #include <stdint.h>
31 #include <string>
33 namespace Barry { namespace Sync {
36 // vTodo
38 /// Class for converting between RFC 2445 iCalendar data format,
39 /// and the Barry::Task class.
40 ///
41 class BXEXPORT vTodo : public vBase
43 // external reference
44 vTimeConverter &m_vtc;
46 // data to pass to external requests
47 char *m_gTodoData; // dynamic memory returned by vformat()... can
48 // be used directly by the plugin, without
49 // overmuch allocation and freeing (see Extract())
50 std::string m_vTodoData; // copy of m_gJournalData, for C++ use
51 Barry::Task m_BarryTask;
53 protected:
54 bool HasMultipleVTodos() const;
56 public:
57 vTodo(vTimeConverter &vtc);
58 ~vTodo();
60 const std::string& ToTask(const Barry::Task &task);
61 const Barry::Task& ToBarry(const char *vtodo, uint32_t RecordId);
63 char* ExtractVTodo();
65 void Clear();
67 // This is the v-name of the innermost BEGIN/END block
68 static const char* GetVName() { return "VTODO"; }
71 }} // namespace Barry::Sync
73 #endif