summaryrefslogtreecommitdiffstats
blob: 314d39c96f6f75fd1044733271252d6bcf5c4bf5 (plain)
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
/*
 * Copyright (c) 2010 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */

#include <SwifTools/Notifier/Notifier.h>

namespace Swift {

const int Notifier::DEFAULT_STATUS_NOTIFICATION_TIMEOUT_SECONDS = 3;
const int Notifier::DEFAULT_MESSAGE_NOTIFICATION_TIMEOUT_SECONDS = 5;

Notifier::~Notifier() {
}

std::string Notifier::typeToString(Type type) {
    switch (type) {
        case ContactAvailable: return "Contact Becomes Available";
        case ContactUnavailable: return "Contact Becomes Unavailable";
        case ContactStatusChange: return "Contact Changes Status";
        case IncomingMessage: return "Incoming Message";
        case SystemMessage: return "System Message";
    }
    assert(false);
    return "";
}

std::vector<Notifier::Type> Notifier::getAllTypes() {
    std::vector<Type> result;
    result.push_back(ContactAvailable);
    result.push_back(ContactUnavailable);
    result.push_back(ContactStatusChange);
    result.push_back(IncomingMessage);
    result.push_back(SystemMessage);
    return result;
}

std::vector<Notifier::Type> Notifier::getDefaultTypes() {
    std::vector<Type> result;
    result.push_back(IncomingMessage);
    result.push_back(SystemMessage);
    return result;
}

}