Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #include "PhoneDetailsImpl.h" |
michael@0 | 6 | |
michael@0 | 7 | #include "csf_common.h" |
michael@0 | 8 | |
michael@0 | 9 | namespace CSF |
michael@0 | 10 | { |
michael@0 | 11 | |
michael@0 | 12 | PhoneDetailsImpl::PhoneDetailsImpl() |
michael@0 | 13 | : model(-1), |
michael@0 | 14 | state(ServiceStateType::eUnknown) |
michael@0 | 15 | { |
michael@0 | 16 | } |
michael@0 | 17 | |
michael@0 | 18 | PhoneDetailsImpl::~PhoneDetailsImpl() |
michael@0 | 19 | { |
michael@0 | 20 | } |
michael@0 | 21 | |
michael@0 | 22 | static const char * _softphoneSupportedModelNames[] = { "Cisco Unified Client Services Framework", |
michael@0 | 23 | "Client Services Framework", |
michael@0 | 24 | "Client Services Core" }; |
michael@0 | 25 | |
michael@0 | 26 | bool PhoneDetailsImpl::isSoftPhone() |
michael@0 | 27 | { |
michael@0 | 28 | if(model == -1 && modelDescription != "") |
michael@0 | 29 | { |
michael@0 | 30 | // Evaluate based on model description. |
michael@0 | 31 | for(int i = 0; i < (int) csf_countof(_softphoneSupportedModelNames); i++) |
michael@0 | 32 | { |
michael@0 | 33 | if(modelDescription == _softphoneSupportedModelNames[i]) |
michael@0 | 34 | return true; |
michael@0 | 35 | } |
michael@0 | 36 | return false; |
michael@0 | 37 | } |
michael@0 | 38 | else |
michael@0 | 39 | { |
michael@0 | 40 | } |
michael@0 | 41 | return false; |
michael@0 | 42 | } |
michael@0 | 43 | |
michael@0 | 44 | void PhoneDetailsImpl::setName(const std::string& name) |
michael@0 | 45 | { |
michael@0 | 46 | this->name = name; |
michael@0 | 47 | } |
michael@0 | 48 | void PhoneDetailsImpl::setDescription(const std::string& description) |
michael@0 | 49 | { |
michael@0 | 50 | this->description = description; |
michael@0 | 51 | } |
michael@0 | 52 | // Note that setting model and model description are mutually exclusive. |
michael@0 | 53 | void PhoneDetailsImpl::setModel(int model) |
michael@0 | 54 | { |
michael@0 | 55 | this->model = model; |
michael@0 | 56 | this->modelDescription = ""; |
michael@0 | 57 | } |
michael@0 | 58 | void PhoneDetailsImpl::setModelDescription(const std::string& description) |
michael@0 | 59 | { |
michael@0 | 60 | this->model = -1; |
michael@0 | 61 | this->modelDescription = description; |
michael@0 | 62 | } |
michael@0 | 63 | void PhoneDetailsImpl::setLineDNs(const std::vector<std::string> & lineDNs) |
michael@0 | 64 | { |
michael@0 | 65 | this->lineDNs.assign(lineDNs.begin(), lineDNs.end()); |
michael@0 | 66 | } |
michael@0 | 67 | void PhoneDetailsImpl::setServiceState(ServiceStateType::ServiceState state) |
michael@0 | 68 | { |
michael@0 | 69 | this->state = state; |
michael@0 | 70 | } |
michael@0 | 71 | void PhoneDetailsImpl::setConfig(const std::string& config) |
michael@0 | 72 | { |
michael@0 | 73 | this->config = config; |
michael@0 | 74 | } |
michael@0 | 75 | |
michael@0 | 76 | } |