Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
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 | #pragma once |
michael@0 | 6 | |
michael@0 | 7 | #include "CC_Common.h" |
michael@0 | 8 | #include "CC_Observer.h" |
michael@0 | 9 | |
michael@0 | 10 | #include <vector> |
michael@0 | 11 | |
michael@0 | 12 | extern "C" |
michael@0 | 13 | { |
michael@0 | 14 | #include "ccapi_types.h" |
michael@0 | 15 | #include "ccapi_service.h" |
michael@0 | 16 | } |
michael@0 | 17 | |
michael@0 | 18 | namespace CSF |
michael@0 | 19 | { |
michael@0 | 20 | class ECC_API CC_Service |
michael@0 | 21 | { |
michael@0 | 22 | public: |
michael@0 | 23 | NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_Service) |
michael@0 | 24 | protected: |
michael@0 | 25 | CC_Service() {} |
michael@0 | 26 | public: |
michael@0 | 27 | virtual ~CC_Service() {}; |
michael@0 | 28 | |
michael@0 | 29 | public: |
michael@0 | 30 | /** |
michael@0 | 31 | * Clients use CC_Observer to receive CCAPI events (Device, Line, Call) from the service. |
michael@0 | 32 | */ |
michael@0 | 33 | virtual void addCCObserver ( CC_Observer * observer ) = 0; |
michael@0 | 34 | virtual void removeCCObserver ( CC_Observer * observer ) = 0; |
michael@0 | 35 | |
michael@0 | 36 | /** |
michael@0 | 37 | * Use init() immediately on creating the service, and destroy() when finished with it. |
michael@0 | 38 | * password is required for Asterisk not CUCM. |
michael@0 | 39 | * deviceName is required for CUCM not Asterisk. |
michael@0 | 40 | */ |
michael@0 | 41 | virtual bool init(const std::string& user, const std::string& password, const std::string& domain, const std::string& deviceName) = 0; |
michael@0 | 42 | virtual void destroy() = 0; |
michael@0 | 43 | |
michael@0 | 44 | /** |
michael@0 | 45 | * TODO: Set config parameters prior to starting the service. |
michael@0 | 46 | * Need to design a nice abstraction for this accommodating SIPCC and CTI. |
michael@0 | 47 | */ |
michael@0 | 48 | |
michael@0 | 49 | /** |
michael@0 | 50 | * Use start() to attempt to register for a device and stop() to cancel a current |
michael@0 | 51 | * registration (or registration attempt). |
michael@0 | 52 | */ |
michael@0 | 53 | virtual bool startService() = 0; |
michael@0 | 54 | virtual void stop() = 0; |
michael@0 | 55 | |
michael@0 | 56 | |
michael@0 | 57 | /** |
michael@0 | 58 | * Check on the current status/health of the service. |
michael@0 | 59 | */ |
michael@0 | 60 | virtual bool isStarted() = 0; |
michael@0 | 61 | |
michael@0 | 62 | /** |
michael@0 | 63 | * Obtain the currently selected Device. |
michael@0 | 64 | * If multiple devices are discoverable (i.e. in CTI), all known devices will appear |
michael@0 | 65 | * in getDevices(), but only the ActiveDevice will be controllable at any given time. |
michael@0 | 66 | */ |
michael@0 | 67 | virtual CC_DevicePtr getActiveDevice() = 0; |
michael@0 | 68 | virtual std::vector<CC_DevicePtr> getDevices() = 0; |
michael@0 | 69 | |
michael@0 | 70 | /** |
michael@0 | 71 | * Global settings for audio and video control. Return nullptr if Media control is not |
michael@0 | 72 | * available in this implementation. Return nullptr in any case if media is not yet |
michael@0 | 73 | * initialized. |
michael@0 | 74 | * TODO: Assuming for now that media init aligns with init/destroy. |
michael@0 | 75 | */ |
michael@0 | 76 | virtual AudioControlPtr getAudioControl() = 0; |
michael@0 | 77 | virtual VideoControlPtr getVideoControl() = 0; |
michael@0 | 78 | |
michael@0 | 79 | virtual bool setLocalVoipPort(int port) = 0; |
michael@0 | 80 | virtual bool setRemoteVoipPort(int port) = 0; |
michael@0 | 81 | virtual bool setP2PMode(bool mode) = 0; |
michael@0 | 82 | virtual bool setSDPMode(bool mode) = 0; |
michael@0 | 83 | |
michael@0 | 84 | private: |
michael@0 | 85 | CC_Service(const CC_Service& rhs); |
michael@0 | 86 | CC_Service& operator=(const CC_Service& rhs); |
michael@0 | 87 | }; |
michael@0 | 88 | } |