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_PHONECALL_H
20 #define EVENTTYPES_PHONECALL_H
27 #include "RtcomEvent.h"
29 #include "AttachmentCollection.h"
35 class PhoneCall : public RtcomEvent
38 virtual const DBBackends::iDBBackend &DB() const;
40 PhoneCall(const Settings &settings);
41 PhoneCall(const Settings &settings, const Settings::eDirection destination, const QDateTime ×tamp, const QString &tel, int durationInSeconds, const AttachmentCollection &attachments = AttachmentCollection());
44 virtual const uint HashCode() const;
46 const Settings::eDirection Destination() const { return m_Destination; }
47 void setDestination(const Settings::eDirection destination) { m_Destination = destination; }
49 virtual const QDateTime Timestamp() const { return m_Timestamp; }
50 void setTimestamp(const QDateTime timestamp) { m_Timestamp = timestamp; }
52 const QString Tel() const { return m_Tel; }
53 void setTel(const QString tel) { m_Tel = tel; }
55 virtual const int DurationInSeconds() const { return m_DurationInSeconds; }
56 void setDurationInSeconds(const int durationInSeconds) { m_DurationInSeconds = durationInSeconds; }
58 virtual const AttachmentCollection & Attachments() const { return m_Attachments; }
59 virtual AttachmentCollection & Attachments() { return m_Attachments; }
62 virtual void Export(const QString &baseDirectory) const;
63 PhoneCall(const Settings &settings, const RTComElEvent& event, const QList<RTComElAttachment*> attachments = QList<RTComElAttachment*>());
64 virtual RTComElEvent * toRTComEvent(const NumberToNameLookup &numberToNameLookup) const;
67 const Settings &CurrentSettings() const { return m_Settings; }
70 const Settings &m_Settings;
71 Settings::eDirection m_Destination;
72 QDateTime m_Timestamp;
74 int m_DurationInSeconds;
75 AttachmentCollection m_Attachments;
79 QDebug operator<<(QDebug dbg, EventTypes::PhoneCall & event);
81 #endif // EVENTTYPES_PHONECALL_H