Added CSV parsing and export of Symbian-format Event logs that have had their tables...
[qwerkisync] / EventTypes / PhoneCall.h
index f709713..415fb7f 100644 (file)
 #ifndef EVENTTYPES_PHONECALL_H
 #define EVENTTYPES_PHONECALL_H
 
+#include "Settings.h"
+
 #include <QDateTime>
 #include <QDebug>
 #include <QList>
 #include <QString>
 
+#include "EventTypes/iCSVSymbianEvent.h"
 #include "RtcomEvent.h"
 
 #include "AttachmentCollection.h"
@@ -32,37 +35,42 @@ class Settings;
 
 namespace EventTypes
 {
-       class PhoneCall : public RtcomEvent
+       class PhoneCall : public RtcomEvent, public EventTypes::iCSVSymbianEvent
        {
        public:
                virtual const DBBackends::iDBBackend &DB() const;
 
                PhoneCall(const Settings &settings);
-               PhoneCall(const Settings &settings, const Settings::eDirection destination, const QDateTime &timestamp, const QString &tel, int durationInSeconds, const AttachmentCollection &attachments = AttachmentCollection());
+               PhoneCall(const Settings &settings, const Settings::eDirection destination, const QDateTime &timestamp, const QString &tel, const int durationInSeconds, const bool isMissedCall, const AttachmentCollection &attachments = AttachmentCollection());
                ~PhoneCall();
 
                virtual const uint HashCode() const;
 
                const Settings::eDirection Destination() const { return m_Destination; }
-               void setDestination(const Settings::eDirection destination) { m_Destination = destination; }
+               void Destination(const Settings::eDirection destination) { m_Destination = destination; }
 
                virtual const QDateTime Timestamp() const { return m_Timestamp; }
-               void setTimestamp(const QDateTime timestamp) { m_Timestamp = timestamp; }
+               void Timestamp(const QDateTime timestamp) { m_Timestamp = timestamp; }
 
                const QString Tel() const { return m_Tel; }
-               void setTel(const QString tel) { m_Tel = tel; }
+               void Tel(const QString tel) { m_Tel = tel; }
 
                virtual const int DurationInSeconds() const { return m_DurationInSeconds; }
-               void setDurationInSeconds(const int durationInSeconds) { m_DurationInSeconds = durationInSeconds; }
+               void DurationInSeconds(const int durationInSeconds) { m_DurationInSeconds = durationInSeconds; }
 
                virtual const AttachmentCollection & Attachments() const { return m_Attachments; }
                virtual AttachmentCollection & Attachments() { return m_Attachments; }
 
+               const bool IsMissedCall() const { return m_IsMissedCall; }
+               void IsMissedCall(const bool isMissedCall) { m_IsMissedCall = isMissedCall; }
+
        public:
-               virtual void Export(const QString &baseDirectory) const;
                PhoneCall(const Settings &settings, const RTComElEvent& event, const QList<RTComElAttachment*> attachments = QList<RTComElAttachment*>());
                virtual RTComElEvent * toRTComEvent(const NumberToNameLookup &numberToNameLookup) const;
 
+       public:
+               virtual void WriteCSVSymbian(QTextStream &stream, const ColumnIndicesByIndexHash &headerIndices, const QChar delimiter, const NumberToNameLookup &numberToNameLookup, SymbianEventLogStrings &strings) const;
+
        protected:
                const Settings &CurrentSettings() const { return m_Settings; }
 
@@ -72,6 +80,7 @@ namespace EventTypes
                QDateTime m_Timestamp;
                QString m_Tel;
                int m_DurationInSeconds;
+               bool m_IsMissedCall;
                AttachmentCollection m_Attachments;
        };
 }