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 <vector> |
michael@0 | 10 | |
michael@0 | 11 | extern "C" |
michael@0 | 12 | { |
michael@0 | 13 | #include "ccapi_types.h" |
michael@0 | 14 | } |
michael@0 | 15 | |
michael@0 | 16 | namespace CSF |
michael@0 | 17 | { |
michael@0 | 18 | class ECC_API CC_DeviceInfo |
michael@0 | 19 | { |
michael@0 | 20 | public: |
michael@0 | 21 | NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_DeviceInfo) |
michael@0 | 22 | protected: |
michael@0 | 23 | CC_DeviceInfo() { } |
michael@0 | 24 | |
michael@0 | 25 | public: |
michael@0 | 26 | //Base class needs dtor to be declared as virtual |
michael@0 | 27 | virtual ~CC_DeviceInfo() {}; |
michael@0 | 28 | |
michael@0 | 29 | /** |
michael@0 | 30 | gets the device name |
michael@0 | 31 | @returns - the device name as an std::string |
michael@0 | 32 | */ |
michael@0 | 33 | virtual std::string getDeviceName() = 0; |
michael@0 | 34 | |
michael@0 | 35 | /** |
michael@0 | 36 | gets the service state |
michael@0 | 37 | @param [in] handle - reference to device info |
michael@0 | 38 | @returns cc_service_state_t - INS/OOS |
michael@0 | 39 | */ |
michael@0 | 40 | virtual cc_service_state_t getServiceState() = 0; |
michael@0 | 41 | |
michael@0 | 42 | /** |
michael@0 | 43 | gets the service cause |
michael@0 | 44 | @param [in] handle - reference to device info |
michael@0 | 45 | @returns cc_service_cause_t - reason for service state |
michael@0 | 46 | */ |
michael@0 | 47 | virtual cc_service_cause_t getServiceCause() = 0; |
michael@0 | 48 | |
michael@0 | 49 | /** |
michael@0 | 50 | gets vector of CC_CallPtr from this CC_DeviceInfo |
michael@0 | 51 | |
michael@0 | 52 | @returns vector<CC_CallPtr> containing the CC_CallPtrs |
michael@0 | 53 | */ |
michael@0 | 54 | virtual std::vector<CC_CallPtr> getCalls () = 0; |
michael@0 | 55 | |
michael@0 | 56 | /** |
michael@0 | 57 | gets list of handles to calls on the device by state |
michael@0 | 58 | @param [in] handle - reference to device info |
michael@0 | 59 | @param [in] state - call state for which the calls are requested |
michael@0 | 60 | @param [out] handles - array of call handle to be returned |
michael@0 | 61 | @param [in,out] count number allocated in array/elements returned |
michael@0 | 62 | @returns |
michael@0 | 63 | */ |
michael@0 | 64 | // void getCallsByState (cc_call_state_t state, |
michael@0 | 65 | // cc_call_handle_t handles[], cc_uint16_t *count); |
michael@0 | 66 | |
michael@0 | 67 | /** |
michael@0 | 68 | gets vector of CC_LinePtr from this CC_DeviceInfo |
michael@0 | 69 | |
michael@0 | 70 | @returns vector<CC_LinePtr> containing the CC_LinePtrs |
michael@0 | 71 | */ |
michael@0 | 72 | virtual std::vector<CC_LinePtr> getLines () = 0; |
michael@0 | 73 | |
michael@0 | 74 | /** |
michael@0 | 75 | gets vector of features on the device |
michael@0 | 76 | |
michael@0 | 77 | @returns |
michael@0 | 78 | */ |
michael@0 | 79 | virtual std::vector<CC_FeatureInfoPtr> getFeatures () = 0; |
michael@0 | 80 | |
michael@0 | 81 | /** |
michael@0 | 82 | gets handles of call agent servers |
michael@0 | 83 | |
michael@0 | 84 | @returns |
michael@0 | 85 | */ |
michael@0 | 86 | virtual std::vector<CC_CallServerInfoPtr> getCallServers () = 0; |
michael@0 | 87 | |
michael@0 | 88 | /** |
michael@0 | 89 | gets call server name |
michael@0 | 90 | @param [in] handle - handle of call server |
michael@0 | 91 | @returns name of the call server |
michael@0 | 92 | NOTE: The memory for return string doesn't need to be freed it will be freed when the info reference is freed |
michael@0 | 93 | */ |
michael@0 | 94 | // cc_string_t getCallServerName (cc_callserver_ref_t handle); |
michael@0 | 95 | |
michael@0 | 96 | /** |
michael@0 | 97 | gets call server mode |
michael@0 | 98 | @param [in] handle - handle of call server |
michael@0 | 99 | @returns - mode of the call server |
michael@0 | 100 | */ |
michael@0 | 101 | // cc_cucm_mode_t getCallServerMode (cc_callserver_ref_t handle); |
michael@0 | 102 | |
michael@0 | 103 | /** |
michael@0 | 104 | gets calls erver name |
michael@0 | 105 | @param [in] handle - handle of call server |
michael@0 | 106 | @returns status of the call server |
michael@0 | 107 | */ |
michael@0 | 108 | // cc_ccm_status_t getCallServerStatus (cc_callserver_ref_t handle); |
michael@0 | 109 | |
michael@0 | 110 | /** |
michael@0 | 111 | get the NOTIFICATION PROMPT |
michael@0 | 112 | @param [in] handle - reference to device info |
michael@0 | 113 | @returns |
michael@0 | 114 | */ |
michael@0 | 115 | // cc_string_t getNotifyPrompt (); |
michael@0 | 116 | |
michael@0 | 117 | /** |
michael@0 | 118 | get the NOTIFICATION PROMPT PRIORITY |
michael@0 | 119 | @param [in] handle - reference to device info |
michael@0 | 120 | @returns |
michael@0 | 121 | */ |
michael@0 | 122 | // cc_uint32_t getNotifyPromptPriority (); |
michael@0 | 123 | |
michael@0 | 124 | /** |
michael@0 | 125 | get the NOTIFICATION PROMPT Progress |
michael@0 | 126 | @param [in] handle - reference to device info |
michael@0 | 127 | @returns |
michael@0 | 128 | */ |
michael@0 | 129 | // cc_uint32_t getNotifyPromptProgress (); |
michael@0 | 130 | |
michael@0 | 131 | private: |
michael@0 | 132 | // Cannot copy - clients should be passing the pointer not the object. |
michael@0 | 133 | CC_DeviceInfo& operator=(const CC_DeviceInfo& rhs); |
michael@0 | 134 | CC_DeviceInfo(const CC_DeviceInfo&); |
michael@0 | 135 | }; |
michael@0 | 136 | }; |