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 | |
michael@0 | 9 | #include "CC_Observer.h" |
michael@0 | 10 | #include "ECC_Observer.h" |
michael@0 | 11 | #include "ECC_Types.h" |
michael@0 | 12 | |
michael@0 | 13 | #include <string> |
michael@0 | 14 | #include <vector> |
michael@0 | 15 | |
michael@0 | 16 | /** |
michael@0 | 17 | * @mainpage Enhanced Call Control |
michael@0 | 18 | * |
michael@0 | 19 | * @section intro_sec Introduction |
michael@0 | 20 | * This wraps and aggregates the SIPCC and CTI call control stacks, media stacks, and various additional |
michael@0 | 21 | * components and glue necessary to start, configure and run them, and presents a high-level C++ API |
michael@0 | 22 | * for connection, device selection and status, and call control. |
michael@0 | 23 | * |
michael@0 | 24 | * @section main_outline Outline |
michael@0 | 25 | * @li The main entry point is CSF::CallControlManager, which is used to configure and start a |
michael@0 | 26 | * call control stack. |
michael@0 | 27 | * @li Configuration and events are raised to the CSF::ECC_Observer interface. |
michael@0 | 28 | * @li Call Control is performed via CSF::CC_Device, CSF::CC_Line and CSF::CC_Call. |
michael@0 | 29 | * @li Call Control events are raised to the CSF::CC_Observer interface. |
michael@0 | 30 | * @li Audio/Video device selection and global media configuration is performed via CSF::AudioControl |
michael@0 | 31 | * and CSF::VideoControl. Per-call media operations (mute, volume, etc) are integrated onto |
michael@0 | 32 | * the CSF::CC_Call and CSF::CC_CallInfo interfaces. |
michael@0 | 33 | */ |
michael@0 | 34 | |
michael@0 | 35 | namespace CSF |
michael@0 | 36 | { |
michael@0 | 37 | DECLARE_NS_PTR(CallControlManager) |
michael@0 | 38 | /** |
michael@0 | 39 | * CallControlManager |
michael@0 | 40 | * |
michael@0 | 41 | * The class is partitioned into several blocks of functionality: |
michael@0 | 42 | * - Create/Destroy - Initialisation and clean shutdown. |
michael@0 | 43 | * Destroy is optional if the destructor is used properly. |
michael@0 | 44 | * - Observer - Register for events when any state changes. Optional but strongly advised. |
michael@0 | 45 | * |
michael@0 | 46 | * Methods are generally synchronous (at present). |
michael@0 | 47 | */ |
michael@0 | 48 | class ECC_API CallControlManager |
michael@0 | 49 | { |
michael@0 | 50 | public: |
michael@0 | 51 | NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CallControlManager) |
michael@0 | 52 | /** |
michael@0 | 53 | * Use create() to create a CallControlManager instance. |
michael@0 | 54 | * |
michael@0 | 55 | * CallControlManager cleans up its resources in its destructor, implicitly disconnect()in if required. |
michael@0 | 56 | * Use the destroy() method if you need to force a cleanup earlier. It is a bad idea to continue using |
michael@0 | 57 | * CallControlManager or any of its related objects after destroy(). |
michael@0 | 58 | */ |
michael@0 | 59 | static CallControlManagerPtr create(); |
michael@0 | 60 | virtual bool destroy() = 0; |
michael@0 | 61 | |
michael@0 | 62 | virtual ~CallControlManager(); |
michael@0 | 63 | |
michael@0 | 64 | /** |
michael@0 | 65 | CC_Observer is for core call control events (on CC_Device, CC_Line and CC_Call). |
michael@0 | 66 | ECC_Observer is for "value add" features of CallControlManager. |
michael@0 | 67 | |
michael@0 | 68 | Client can add multiple observers if they have different Observer objects that handle |
michael@0 | 69 | different event scenarios, but generally it's probably sufficient to only register one observer. |
michael@0 | 70 | |
michael@0 | 71 | @param[in] observer - This is a pointer to a CC_Observer-derived class that the client |
michael@0 | 72 | must instantiate to receive notifications on this client object. |
michael@0 | 73 | */ |
michael@0 | 74 | virtual void addCCObserver ( CC_Observer * observer ) = 0; |
michael@0 | 75 | virtual void removeCCObserver ( CC_Observer * observer ) = 0; |
michael@0 | 76 | |
michael@0 | 77 | virtual void addECCObserver ( ECC_Observer * observer ) = 0; |
michael@0 | 78 | virtual void removeECCObserver ( ECC_Observer * observer ) = 0; |
michael@0 | 79 | |
michael@0 | 80 | virtual void setMultiClusterMode(bool allowMultipleClusters) = 0; |
michael@0 | 81 | virtual void setSIPCCLoggingMask(const cc_int32_t mask) = 0; |
michael@0 | 82 | virtual void setAuthenticationString(const std::string &authString) = 0; |
michael@0 | 83 | virtual void setSecureCachePath(const std::string &secureCachePath) = 0; |
michael@0 | 84 | |
michael@0 | 85 | // Add local codecs |
michael@0 | 86 | virtual void setAudioCodecs(int codecMask) = 0; |
michael@0 | 87 | virtual void setVideoCodecs(int codecMask) = 0; |
michael@0 | 88 | |
michael@0 | 89 | virtual bool registerUser(const std::string& deviceName, const std::string& user, const std::string& password, const std::string& domain) = 0; |
michael@0 | 90 | virtual bool disconnect() = 0; |
michael@0 | 91 | virtual std::string getPreferredDeviceName() = 0; |
michael@0 | 92 | virtual std::string getPreferredLineDN() = 0; |
michael@0 | 93 | virtual ConnectionStatusEnum::ConnectionStatus getConnectionStatus() = 0; |
michael@0 | 94 | virtual std::string getCurrentServer() = 0; |
michael@0 | 95 | |
michael@0 | 96 | /* P2P MODE */ |
michael@0 | 97 | virtual bool startP2PMode(const std::string& user) = 0; |
michael@0 | 98 | |
michael@0 | 99 | /* SDP MODE */ |
michael@0 | 100 | virtual bool startSDPMode() = 0; |
michael@0 | 101 | |
michael@0 | 102 | /** |
michael@0 | 103 | * Obtain the device object, from which call control can be done. |
michael@0 | 104 | * getAvailablePhoneDetails lists all known devices which the user is likely to be able to control. |
michael@0 | 105 | */ |
michael@0 | 106 | virtual CC_DevicePtr getActiveDevice() = 0; |
michael@0 | 107 | virtual PhoneDetailsVtrPtr getAvailablePhoneDetails() = 0; |
michael@0 | 108 | virtual PhoneDetailsPtr getAvailablePhoneDetails(const std::string& deviceName) = 0; |
michael@0 | 109 | |
michael@0 | 110 | /** |
michael@0 | 111 | * Obtain the audio/video object, from which video setup can be done. |
michael@0 | 112 | * This relates to global tuning, device selection, preview window positioning, etc, not to |
michael@0 | 113 | * per-call settings or control. |
michael@0 | 114 | * |
michael@0 | 115 | * These objects are unavailable except while in softphone mode. |
michael@0 | 116 | */ |
michael@0 | 117 | virtual VideoControlPtr getVideoControl() = 0; |
michael@0 | 118 | virtual AudioControlPtr getAudioControl() = 0; |
michael@0 | 119 | |
michael@0 | 120 | virtual bool setProperty(ConfigPropertyKeysEnum::ConfigPropertyKeys key, std::string& value) = 0; |
michael@0 | 121 | virtual std::string getProperty(ConfigPropertyKeysEnum::ConfigPropertyKeys key) = 0; |
michael@0 | 122 | |
michael@0 | 123 | protected: |
michael@0 | 124 | CallControlManager() {} |
michael@0 | 125 | private: |
michael@0 | 126 | CallControlManager(const CallControlManager&); |
michael@0 | 127 | CallControlManager& operator=(const CallControlManager&); |
michael@0 | 128 | }; |
michael@0 | 129 | } //end namespace CSF |