~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/src/history/historyitem.h

  • Committer: Package Import Robot
  • Author(s): Francois Marier
  • Date: 2011-11-25 13:24:12 UTC
  • mfrom: (4.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20111125132412-dc4qvhyosk74cd42
Tags: 1.0.1-4
Don't assume that arch:all packages will get built (closes: #649726)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc.
 
3
 *
 
4
 *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
 
5
 *  Author: Alexamdre Savard <alexandre.savard@savoirfairelinux.com>
 
6
 *
 
7
 *  This program is free software; you can redistribute it and/or modify
 
8
 *  it under the terms of the GNU General Public License as published by
 
9
 *  the Free Software Foundation; either version 3 of the License, or
 
10
 *  (at your option) any later version.
 
11
 *
 
12
 *  This program is distributed in the hope that it will be useful,
 
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 *  GNU General Public License for more details.
 
16
 *
 
17
 *  You should have received a copy of the GNU General Public License
 
18
 *  along with this program; if not, write to the Free Software
 
19
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
20
 *
 
21
 *  Additional permission under GNU GPL version 3 section 7:
 
22
 *
 
23
 *  If you modify this program, or any covered work, by linking or
 
24
 *  combining it with the OpenSSL project's OpenSSL library (or a
 
25
 *  modified version of that library), containing parts covered by the
 
26
 *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
 
27
 *  grants you additional permission to convey the resulting work.
 
28
 *  Corresponding Source for a non-source form of such a combination
 
29
 *  shall include the source code for the parts of OpenSSL used as well
 
30
 *  as that of the covered work.
 
31
 */
 
32
 
 
33
#ifndef HISTORY_ITEM_H_
 
34
#define HISTORY_ITEM_H_
 
35
 
 
36
#include <string>
 
37
#include <config/config.h>
 
38
 
 
39
typedef enum CallType {
 
40
    CALL_MISSED,
 
41
    CALL_INCOMING,
 
42
    CALL_OUTGOING
 
43
} CallType;
 
44
 
 
45
class HistoryItem {
 
46
 
 
47
    public:
 
48
        /*
 
49
         * Constructor
 
50
         *
 
51
         * @param Timestamp start
 
52
         * @param Call type
 
53
         * @param Timestamp stop
 
54
         * @param Call name
 
55
         * @param Call number
 
56
                 * @param Call id
 
57
         * @param Call account id
 
58
                 * @param Recording file name (if any recording were performed)
 
59
                 * @param Configuration ID
 
60
                 * @param time added
 
61
         */
 
62
        HistoryItem(const std::string&, CallType, const std::string&,
 
63
                    const std::string&, const std::string&, const std::string&,
 
64
                    const std::string&, const std::string&, const std::string&,
 
65
                    const std::string&);
 
66
 
 
67
        /*
 
68
         * Constructor from a serialized form
 
69
                 * @string contaning serialized form
 
70
         */
 
71
        HistoryItem(std::string="");
 
72
 
 
73
        std::string get_timestamp() const {
 
74
            return timestamp_start_;
 
75
        }
 
76
 
 
77
        bool save(Conf::ConfigTree **history);
 
78
 
 
79
        std::string serialize() const;
 
80
 
 
81
    private:
 
82
        /*
 
83
         * @return true if the account ID corresponds to a loaded account
 
84
         */
 
85
        bool valid_account(const std::string &id) const;
 
86
 
 
87
        /*
 
88
         * Timestamp representing the date of the call
 
89
         */
 
90
        std::string timestamp_start_;
 
91
        std::string timestamp_stop_;
 
92
 
 
93
        /*
 
94
         * Represents the type of call
 
95
         * Has be either CALL_MISSED, CALL_INCOMING or CALL_OUTGOING
 
96
         */
 
97
        CallType call_type_;
 
98
 
 
99
        /*
 
100
         * The information about the callee/caller, depending on the type of call.
 
101
         */
 
102
        std::string name_;
 
103
        std::string number_;
 
104
 
 
105
        /**
 
106
         * The identifier fo this item
 
107
         */
 
108
        std::string id_;
 
109
 
 
110
        /*
 
111
         * The account the call was made with
 
112
         */
 
113
        std::string account_id_;
 
114
 
 
115
        /**
 
116
         * Whether or not a recording exist for this call
 
117
         */
 
118
        std::string recording_file_;
 
119
 
 
120
        /**
 
121
         * The conference ID for this call (if any)
 
122
         */
 
123
        std::string confID_;
 
124
 
 
125
        /**
 
126
         * Time added to conference
 
127
         */
 
128
        std::string timeAdded_;
 
129
};
 
130
 
 
131
 
 
132
#endif // HISTORY_ITEM