zdk.net
AccountProvider.h
1 //
2 // AccountProvider.h
3 // ZDK
4 //
5 
6 #ifndef ZDK_NET_AccountProvider_h
7 #define ZDK_NET_AccountProvider_h
8 
9 #include "native_shared_ptr.h"
10 #include "PublicInterfaces.h"
11 #include "Account.h"
12 #include "String.h"
13 #include "SipMethodTypes.h"
14 #include "AccountProviderEventsHandler.h"
15 #include "AccountConfig.h"
16 #include "MSRPConfig.h"
17 #include "StunConfig.h"
18 #include "IAXConfig.h"
19 #include "SIPConfig.h"
20 #include "ZRTPConfig.h"
21 #include "PushConfig.h"
22 #include "HeaderField.h"
23 #include "ZHandle.h"
24 
25 using namespace System::Collections::Generic;
26 
27 namespace ZDK_NET
28 {
29  ref class Account;
30  ref class AccountProviderEventsHandler;
31  ref class AccountConfig;
32  ref class MSRPConfig;
33  ref class StunConfig;
34  ref class IAXConfig;
35  ref class SIPConfig;
36  ref class ZRTPConfig;
37  ref class PushConfig;
38  ref class HeaderField;
39 
44  public ref class AccountProvider : ZHandle
45  {
46  private:
47  //LISTENERS:
48  static GeneralStatusEventListener *AccountProviderEventsHandler_Listener = nullptr;
49 
50  static bool RegisterEventListeners()
51  {
52  std::shared_ptr<GeneralStatusEventListener> AccountProviderEventsHandler_Listener_tmp = std::make_shared<GeneralStatusEventListener>();
53  AccountProviderEventsHandler_Listener = AccountProviderEventsHandler_Listener_tmp.get();
54  listenersMap->try_emplace(reinterpret_cast<intptr_t>(AccountProviderEventsHandler_Listener), std::move(AccountProviderEventsHandler_Listener_tmp));
55  return true;
56  }
57 
58  static bool RegisteredEventListeners = RegisterEventListeners();
59  public:
60  ZDK::IAccountProvider* cppRef = nullptr;
61 
62  AccountProvider(ZDK::Shared::AccountProvider src);
63  ~AccountProvider();
65 
72  property List<Account^>^ ListAccounts
73  {
74  List<Account^>^ get();
75  }
76 
81  property int AccountsCount
82  {
83  int get();
84  }
85 
90  property ZDK_NET::Account^ DefaultAccount
91  {
92  ZDK_NET::Account^ get();
93  }
94 
108 
117 
126  ZDK_NET::Account^ GetAccount(long long hAccountId);
127 
135 
145 
153 
161 
169 
177 
185 
193 
201 
212  ZDK_NET::HeaderField^ CreateSIPHeaderField(System::String^ name, List<System::String^>^ values, ZDK_NET::SipMethodTypes method);
213 
223 
233 
234  virtual long long Handle() override;
235 
236  virtual void Initialize() override;
237 
238  virtual void ReleaseReference() override;
239 
240  };
241 }
242 
243 #endif
ZDK_NET::AccountProvider::DeleteUserAccount
void DeleteUserAccount(ZDK_NET::Account^ account)
Destroys an user account.
ZDK_NET::AccountProvider::CreateZRTPConfiguration
ZDK_NET::ZRTPConfig ^ CreateZRTPConfiguration()
Creates a new empty ZRTP configuration.
ZDK_NET::IAXConfig
IAX specific account configuration.
Definition: IAXConfig.h:22
ZDK_NET::AccountProvider::CreateAccountConfiguration
ZDK_NET::AccountConfig ^ CreateAccountConfiguration()
Creates a new empty account configuration.
ZDK_NET::AccountProvider::CreateIAXConfiguration
ZDK_NET::IAXConfig ^ CreateIAXConfiguration()
Creates a new empty IAX configuration.
ZDK_NET::AccountProvider::CreateMSRPConfiguration
ZDK_NET::MSRPConfig ^ CreateMSRPConfiguration()
Creates a new empty MSRP configuration.
ZDK_NET::AccountProvider::CreateSIPHeaderField
ZDK_NET::HeaderField ^ CreateSIPHeaderField(System::String^ name, List< System::String^>^ values, ZDK_NET::SipMethodTypes method)
Creates a SIP header.
ZDK_NET::PushConfig
Push notification specific configuration.
Definition: PushConfig.h:25
ZDK_NET::HeaderField
SIP header fields structure.
Definition: HeaderField.h:27
ZDK_NET::ZRTPConfig
ZRTP specific account configuration.
Definition: ZRTPConfig.h:27
ZDK_NET::AccountConfig
General account configuration.
Definition: AccountConfig.h:29
GeneralStatusEventListener
Definition: GeneralStatusEventListener.h:90
ZDK_NET::MSRPConfig
MSRP (Message Session Relay Protocol) specific account configuration.
Definition: MSRPConfig.h:22
ZDK_NET::AccountProvider::CreateUserAccount
ZDK_NET::Account ^ CreateUserAccount()
Creates a new user account.
ZDK_NET::Account
The main account class.
Definition: Account.h:38
ZDK_NET::AccountProvider::CreatePushConfiguration
ZDK_NET::PushConfig ^ CreatePushConfiguration()
Creates a new empty Push configuration.
ZDK_NET::AccountProvider::CreateSIPConfiguration
ZDK_NET::SIPConfig ^ CreateSIPConfiguration()
Creates a new empty SIP configuration.
ZDK_NET::AccountProvider::SetAsDefaultAccount
bool SetAsDefaultAccount(ZDK_NET::Account^ account)
Sets the default account.
ZDK_NET::AccountProvider::DropAccountProviderListener
void DropAccountProviderListener(ZDK_NET::AccountProviderEventsHandler^ value)
Removes a specific already added account provider event listener.
ZDK_NET::AccountProvider::GetAccount
ZDK_NET::Account ^ GetAccount(long long hAccountId)
Gets the account with the specified ID.
ZDK_NET::AccountProviderEventsHandler
Definition: AccountProviderEventsHandler.h:34
ZDK_NET::StunConfig
STUN specific account configuration.
Definition: StunConfig.h:29
ZDK_NET::AccountProvider::UnregisterAllAccounts
void UnregisterAllAccounts()
Unregisters all accounts.
ZDK_NET::AccountProvider
Account information and control provider.
Definition: AccountProvider.h:45
ZDK_NET::AccountProvider::AddAccountProviderListener
void AddAccountProviderListener(ZDK_NET::AccountProviderEventsHandler^ value)
Adds a new account provider event listener.
ZDK_NET::SIPConfig
SIP specific account configuration.
Definition: SIPConfig.h:36
ZDK_NET::AccountProvider::CreateStunConfiguration
ZDK_NET::StunConfig ^ CreateStunConfiguration()
Creates a new empty STUN configuration.
ZDK_NET::ZHandle
Definition: ZHandle.h:18