menu: added new Keywords tag to .desktop files
[barry.git] / src / vjournal.h
blob686e060661f4431499a448e9cfecc73c105795ef
1 ///
2 /// \file vjournal.h
3 /// Conversion routines for vjournals (VCALENDAR, etc)
4 ///
6 /*
7 Copyright (C) 2008-2009, Nicolas VIVIEN
8 Copyright (C) 2006-2013, 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_VJOURNAL_H__
24 #define __BARRY_SYNC_VJOURNAL_H__
26 #include "dll.h"
27 #include "vbase.h"
28 #include "vformat.h"
29 #include "r_memo.h"
30 #include <stdint.h>
31 #include <string>
33 namespace Barry { namespace Sync {
36 // vJournal
38 /// Class for converting between RFC 2445 iCalendar data format,
39 /// and the Barry::Memo class.
40 ///
41 class BXEXPORT vJournal : public vBase
43 // external reference
44 vTimeConverter &m_vtc;
46 // data to pass to external requests
47 char *m_gJournalData; // 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_vJournalData; // copy of m_gJournalData, for C++ use
51 Barry::Memo m_BarryMemo;
53 protected:
54 bool HasMultipleVJournals() const;
56 public:
57 explicit vJournal(vTimeConverter &vtc);
58 ~vJournal();
60 const std::string& ToMemo(const Barry::Memo &memo);
61 const Barry::Memo& ToBarry(const char *vjournal, uint32_t RecordId);
63 char* ExtractVJournal();
65 void Clear();
67 // This is the v-name of the innermost BEGIN/END block
68 static const char* GetVName() { return "VJOURNAL"; }
71 }} // namespace Barry::Sync
73 #endif