2 * Copyright (C) 2011, Jamie Thompson
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.
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.
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/>.
19 #ifndef EVENTTYPES_SMS_H
20 #define EVENTTYPES_SMS_H
27 #include "RtcomEvent.h"
28 #include "EventTypes/iCSVSymbianEvent.h"
29 #include "EventTypes/iVMGEvent.h"
31 #include "AttachmentCollection.h"
37 class SMS : public RtcomEvent, public EventTypes::iVMGEvent, public EventTypes::iCSVSymbianEvent
47 virtual const DBBackends::iDBBackend &DB() const;
49 SMS(const Settings &settings);
52 virtual const uint HashCode() const;
54 const float Version() const { return m_Version; }
55 void Version(const float version) { m_Version = version; }
57 const bool IsRead() const { return m_Read; }
58 void IsRead(const bool isRead) { m_Read = isRead; }
60 const eDestination Destination() const { return m_Destination; }
61 void Destination(const eDestination destination) { m_Destination = destination; }
63 virtual const QDateTime Timestamp() const { return m_Timestamp; }
64 void Timestamp(const QDateTime timestamp) { m_Timestamp = timestamp; }
66 const QString Tel() const { return m_Tel; }
67 void Tel(const QString tel) { m_Tel = tel; }
69 QString Contents() const { return m_Contents; }
70 void Contents(const QString contents) { m_Contents = contents; }
72 bool Pending() const { return m_Pending; }
73 void Pending(const bool pending) { m_Pending = pending; }
75 virtual const AttachmentCollection & Attachments() const { return m_Attachments; }
76 virtual AttachmentCollection & Attachments() { return m_Attachments; }
79 SMS(const Settings &settings, const RTComElEvent& event, const QList<RTComElAttachment*> attachments = QList<RTComElAttachment*>());
80 virtual RTComElEvent * toRTComEvent(const NumberToNameLookup &numberToNameLookup) const;
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;
88 const Settings &CurrentSettings() const { return m_Settings; }
91 const Settings &m_Settings;
94 eDestination m_Destination;
95 QDateTime m_Timestamp;
98 AttachmentCollection m_Attachments;
103 QDebug operator<<(QDebug dbg, EventTypes::SMS & event);
105 #endif // EVENTTYPES_SMS_H