Added passing through name to number lookup for resolving numbers in exported events.
[qwerkisync] / EventParsers / VMGEntities / VMessage.h
1 /*
2  * Copyright (C) 2011, Jamie Thompson
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public
6  * License as published by the Free Software Foundation; either
7  * version 3 of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public
15  * License along with this program; If not, see
16  * <http://www.gnu.org/licenses/>.
17  */
18
19 #ifndef EVENTPARSERS_VMGEntities_VMESSAGEWRITER_H
20 #define EVENTPARSERS_VMGEntities_VMESSAGEWRITER_H
21
22 #include "SMSEntity.h"
23 #include "iReader.h"
24 #include "iWriter.h"
25
26 class Settings;
27
28 class QString;
29 class QTextStream;
30
31 namespace EventTypes { class SMS; }
32
33 namespace EventParsers
34 {
35         namespace VMGEntities
36         {
37                 class VCard;
38                 class VEnvelope;
39
40                 class VMessage : public SMSEntity, public iWriter, public iReader
41                 {
42                 public:
43                         VMessage(const Settings &settings, const SMSEntity* parent);
44                         //VMessage(QTextStream& stream);
45                         VMessage(const Settings &settings, const SMSEntity* parent, float version);
46                         ~VMessage();
47
48                         virtual bool Read(const QString & initialLine, QTextStream& stream, EventTypes::SMS & event);
49                         virtual void Write(QTextStream & stream, const EventTypes::SMS & event, const NumberToNameLookup &numberToNameLookup);
50
51                 protected:
52                         virtual const char * getTagName() const { return "VMSG"; }
53
54                 private:
55                         float m_Version;
56                 };
57         }
58 }
59
60 #endif // EVENTPARSERS_VMGEntities_VMESSAGEWRITER_H