-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcdr.h
More file actions
89 lines (80 loc) · 2.64 KB
/
Copy pathcdr.h
File metadata and controls
89 lines (80 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* $Id: cdr.h */
/*
* Copyright (C) 2012-2014 Dmytro Mishchenko <arkadiamail@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef CDR_H
#define CDR_H
#include <QString>
#include <QDateTime>
#include <QDataStream>
#include <QMetaType>
class Cdr
{
public:
Cdr();
Cdr(const Cdr &other);
/*
explicit Cdr(const QDateTime &a_tmBegin, const QDateTime &a_tmAnswer,
const QDateTime &a_tmEnd,
const bool a_answered, const bool a_ended, const QString &a_direction,
const QString &a_last_status, const QString &a_last_status_text,
const QString &a_disposition, const QString &a_name,
const QString &a_number, const QString &a_recordingPath);
*/
~Cdr();
void start();
void answer();
void end(void);
void end(const QString &status, const QString &status_text);
QString durationStr() const;
QString getDuration() const;
QString startTime() const;
QDateTime getTmBegin() const;
QDateTime getTmAnswer() const;
QDateTime getTmEnd() const;
bool isAnswered() const;
bool isEnded() const;
QString getDirection() const;
QString getLastStatus() const;
QString getLastStatusText() const;
QString getDisposition() const;
QString getName() const;
QString getNumber() const;
QString getDisplayNumber() const;
QString getRecordingPath() const;
void setDirection(const QString &dir);
void setName(const QString &newName);
void setNumber(const QString &newNumber);
void setRecordingPath(const QString &fileName);
friend QDataStream& operator <<(QDataStream& stream, const Cdr& c);
friend QDataStream& operator >>(QDataStream& stream, Cdr& c);
private:
QDateTime tmBegin;
QDateTime tmAnswer;
QDateTime tmEnd;
bool answered;
bool ended;
QString direction;
QString last_status;
QString last_status_text;
QString disposition;
QString name;
QString number;
QString recordingPath;
};
Q_DECLARE_METATYPE(Cdr)
#endif // CDR_H