zdk.net
Context.h
1 //
2 // Context.h
3 // ZDK
4 //
5 
6 #ifndef ZDK_NET_Context_h
7 #define ZDK_NET_Context_h
8 
9 #include "native_shared_ptr.h"
10 #include "PublicInterfaces.h"
11 #include "CallsProvider.h"
12 #include "AccountProvider.h"
13 #include "ConferenceProvider.h"
14 #include "DNSRequestProvider.h"
15 #include "ContextConfiguration.h"
16 #include "EncryptionConfiguration.h"
17 #include "AudioEndpointControl.h"
18 #include "VideoEndpointControl.h"
19 #include "RingBackToneControl.h"
20 #include "Activation.h"
21 #include "Log.h"
22 #include "ProxyManager.h"
23 #include "BanafoManager.h"
24 #include "ProtocolType.h"
25 #include "ContextEventsHandler.h"
26 #include "Result.h"
27 #include "ZHandle.h"
28 
29 using namespace System::Collections::Generic;
30 
31 namespace ZDK_NET
32 {
33  ref class CallsProvider;
34  ref class AccountProvider;
35  ref class ConferenceProvider;
36  ref class DNSRequestProvider;
37  ref class ContextConfiguration;
38  ref class EncryptionConfiguration;
39  ref class AudioEndpointControl;
40  ref class VideoEndpointControl;
41  ref class RingBackToneControl;
42  ref class Activation;
43  ref class Log;
44  ref class ProxyManager;
45  ref class BanafoManager;
46  ref class ContextEventsHandler;
47  ref class Result;
48 
51  public ref class Context : ZHandle
52  {
53  private:
54  //LISTENERS:
55  static GeneralStatusEventListener *ContextEventsHandler_Listener = nullptr;
56 
57  static bool RegisterEventListeners()
58  {
59  std::shared_ptr<GeneralStatusEventListener> ContextEventsHandler_Listener_tmp = std::make_shared<GeneralStatusEventListener>();
60  ContextEventsHandler_Listener = ContextEventsHandler_Listener_tmp.get();
61  listenersMap->try_emplace(reinterpret_cast<intptr_t>(ContextEventsHandler_Listener), std::move(ContextEventsHandler_Listener_tmp));
62  return true;
63  }
64 
65  static bool RegisteredEventListeners = RegisterEventListeners();
66  public:
67  ZDK::IContext* cppRef = nullptr;
68 
69  Context(ZDK::Shared::Context src);
70  Context();
71  ~Context();
72  !Context();
73 
78  property bool ContextRunning
79  {
80  bool get();
81  }
82 
90  {
92  }
93 
102  property ZDK_NET::AccountProvider^ AccountProvider
103  {
105  }
106 
113  property ZDK_NET::ConferenceProvider^ ConferenceProvider
114  {
116  }
117 
124  property ZDK_NET::DNSRequestProvider^ DNSRequestProvider
125  {
127  }
128 
138  property ZDK_NET::ContextConfiguration^ Configuration
139  {
141  }
142 
149  property ZDK_NET::EncryptionConfiguration^ EncryptionConfiguration
150  {
152  }
153 
162  property ZDK_NET::AudioEndpointControl^ AudioControls
163  {
165  }
166 
175  property ZDK_NET::VideoEndpointControl^ VideoControls
176  {
178  }
179 
188  property ZDK_NET::RingBackToneControl^ Ringback
189  {
191  }
192 
199  property ZDK_NET::Activation^ Activation
200  {
201  ZDK_NET::Activation^ get();
202  }
203 
212  property ZDK_NET::Log^ Logger
213  {
214  ZDK_NET::Log^ get();
215  }
216 
223  property ZDK_NET::ProxyManager^ ProxyManager
224  {
225  ZDK_NET::ProxyManager^ get();
226  }
227 
234  property ZDK_NET::BanafoManager^ BanafoManager
235  {
236  ZDK_NET::BanafoManager^ get();
237  }
238 
245  property System::String^ LibraryVersion
246  {
247  System::String^ get();
248  }
249 
264 
278 
296  ZDK_NET::Result^ AddProtocol(ZDK_NET::ProtocolType proto, int port);
297 
298  /*
299  */
300  ZDK_NET::Result^ TestSIPURI(System::String^ sipUri);
301 
311 
324 
331  void ForceNativeCrash(unsigned int delayMs);
332 
333  virtual long long Handle() override;
334 
335  virtual void Initialize() override;
336 
337  virtual void ReleaseReference() override;
338 
339  };
340 }
341 
342 #endif
ZDK_NET::DNSRequestProvider
DNS resolving requests provider.
Definition: DNSRequestProvider.h:26
ZDK_NET::Result
API invocation status result.
Definition: Result.h:24
ZDK_NET::Context
ZDK's main entry point.
Definition: Context.h:52
ZDK_NET::RingBackToneControl
Ringback tone's main entry point.
Definition: RingBackToneControl.h:27
ZDK_NET::Context::StartContext
ZDK_NET::Result ^ StartContext()
Initialize the ZDK.
ZDK_NET::VideoEndpointControl
Video endpoint's main entry point.
Definition: VideoEndpointControl.h:26
ZDK_NET::Context::SetStatusListener
void SetStatusListener(ZDK_NET::ContextEventsHandler^ value)
Configures the context event listener.
ZDK_NET::EncryptionConfiguration
Encription specific configuration.
Definition: EncryptionConfiguration.h:26
GeneralStatusEventListener
Definition: GeneralStatusEventListener.h:90
ZDK_NET::Log
Debug logging facility.
Definition: Log.h:25
ZDK_NET::AudioEndpointControl
Audio endpoint's main entry point.
Definition: AudioEndpointControl.h:39
ZDK_NET::Activation
Handles the Activation process of the ZDK.
Definition: Activation.h:25
ZDK_NET::Context::StopContext
ZDK_NET::Result ^ StopContext()
Destroys the ZDK.
ZDK_NET::BanafoManager
Banafo Service Manager.
Definition: BanafoManager.h:40
ZDK_NET::Context::ForceNativeCrash
void ForceNativeCrash(unsigned int delayMs)
Force native crash.
ZDK_NET::ContextConfiguration
General ZDK/Context configuration.
Definition: ContextConfiguration.h:25
ZDK_NET::ProxyManager
Proxy Manager.
Definition: ProxyManager.h:27
ZDK_NET::CallsProvider
Active calls information provider.
Definition: CallsProvider.h:26
ZDK_NET::ConferenceProvider
Conference controlling helper.
Definition: ConferenceProvider.h:29
ZDK_NET::Context::NetworkChanged
ZDK_NET::Result ^ NetworkChanged()
Notify the ZDK for changed network event.
ZDK_NET::AccountProvider
Account information and control provider.
Definition: AccountProvider.h:45
ZDK_NET::Context::AddProtocol
ZDK_NET::Result ^ AddProtocol(ZDK_NET::ProtocolType proto, int port)
Creates a call manager instance for a protocol.
ZDK_NET::ContextEventsHandler
Definition: ContextEventsHandler.h:49
ZDK_NET::ZHandle
Definition: ZHandle.h:18