Addressing some compilation warnings:
[qwerkisync] / EventTypes / SMS.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 EVENTTYPES_SMS_H
20 #define EVENTTYPES_SMS_H
21
22 #include <QDateTime>
23 #include <QDebug>
24 #include <QList>
25 #include <QString>
26
27 #include "RtcomEvent.h"
28 #include "EventTypes/iCSVSymbianEvent.h"
29 #include "EventTypes/iVMGEvent.h"
30
31 #include "AttachmentCollection.h"
32
33 class Settings;
34
35 namespace EventTypes
36 {
37         class SMS : public RtcomEvent, public EventTypes::iVMGEvent, public EventTypes::iCSVSymbianEvent
38         {
39         public:
40                 enum eDestination
41                 {
42                         INBOX,
43                         SENT
44                 };
45
46         public:
47                 virtual const DBBackends::iDBBackend &DB() const;
48
49                 SMS(const Settings &settings);
50                 ~SMS();
51
52                 virtual const uint HashCode() const;
53
54                 const float Version() const { return m_Version; }
55                 void Version(const float version) { m_Version = version; }
56
57                 const bool IsRead() const { return m_Read; }
58                 void IsRead(const bool isRead) { m_Read = isRead; }
59
60                 const eDestination Destination() const { return m_Destination; }
61                 void Destination(const eDestination destination) { m_Destination = destination; }
62
63                 virtual const QDateTime Timestamp() const { return m_Timestamp; }
64                 void Timestamp(const QDateTime timestamp) { m_Timestamp = timestamp; }
65
66                 const QString Tel() const { return m_Tel; }
67                 void Tel(const QString tel) { m_Tel = tel; }
68
69                 QString Contents() const { return m_Contents; }
70                 void Contents(const QString contents) { m_Contents = contents; }
71
72                 bool Pending() const { return m_Pending; }
73                 void Pending(const bool pending) { m_Pending = pending; }
74
75                 virtual const AttachmentCollection & Attachments() const { return m_Attachments; }
76                 virtual AttachmentCollection & Attachments() { return m_Attachments; }
77
78         public:
79                 SMS(const Settings &settings, const RTComElEvent& event, const QList<RTComElAttachment*> attachments = QList<RTComElAttachment*>());
80                 virtual RTComElEvent * toRTComEvent(const NumberToNameLookup &numberToNameLookup) const;
81
82         public:
83                 virtual void WriteCSVSymbian(QTextStream &stream, const ColumnIndicesByIndexHash &headerIndices, const QChar delimiter, const NumberToNameLookup &numberToNameLookup, SymbianEventLogStrings &strings) const;
84                 virtual const QString PathForVMG() const;
85                 virtual void WriteVMG(QTextStream &stream, const NumberToNameLookup &numberToNameLookup) const;
86
87         protected:
88                 const Settings &CurrentSettings() const { return m_Settings; }
89
90         private:
91                 const Settings &m_Settings;
92                 float m_Version;
93                 bool m_Read;
94                 eDestination m_Destination;
95                 QDateTime m_Timestamp;
96                 QString m_Tel;
97                 QString m_Contents;
98                 AttachmentCollection m_Attachments;
99                 bool m_Pending;
100         };
101 }
102
103 QDebug operator<<(QDebug dbg, EventTypes::SMS & event);
104
105 #endif // EVENTTYPES_SMS_H