Easemob Windows SDK
Public Member Functions | Static Public Member Functions | List of all members
easemob::EMClient Class Reference

#include <emclient.h>

Inheritance diagram for easemob::EMClient:
Inheritance graph
Collaboration diagram for easemob::EMClient:
Collaboration graph

Public Member Functions

EMErrorPtr login (const std::string &username, const std::string &password)
 Login with user name and password. More...
 
void logout ()
 Logout current user. More...
 
const EMLoginInfogetLoginInfo ()
 Get info of current logoin user. More...
 
void addConnectionListener (EMConnectionListener *)
 register connection listener. More...
 
void removeConnectionListener (EMConnectionListener *)
 remove connection listener. More...
 
EMErrorPtr createAccount (const std::string &username, const std::string &password)
 Register a new account with user name and password. More...
 
EMChatConfigsPtr getChatConfigs ()
 get the chat configs. More...
 
EMChatManagerInterfacegetChatManager ()
 Get chat manager to handle the message operation. More...
 
EMContactManagerInterfacegetContactManager ()
 Get contact manager to manage the contacts. More...
 
EMGroupManagerInterfacegetGroupManager ()
 Get group manager to manage the group. More...
 
EMChatroomManagerInterfacegetChatroomManager ()
 Get chatroom manager to manage the chatroom. More...
 
virtual void onNetworkChanged (EMNetworkListener::EMNetworkType to)
 Get call manager to handle the voice/video call. More...
 
void reconnect ()
 
void disconnect ()
 
void onConnect ()
 
void onDisconnect (EMErrorPtr error)
 
void onPong ()
 

Static Public Member Functions

static EMClientcreate (const EMChatConfigsPtr configs)
 Get the chat client with configs. More...
 

Additional Inherited Members

- Public Types inherited from easemob::EMNetworkListener
enum  EMNetworkType { NONE, CABLE, WIFI, MOBILE }
 

Detailed Description

Enjoy your IM journey!

Introduction

Easemob Linux SDK is an SDK for you to create IM related applications on linux platform.

Integration guide

For your fast integration, here is an short guide.

Step 1: Get client

Include emchatclient.h and call EMClient::create() to get your client, which is the start point of your IM.

Step 2: Register and login

Call register() to register a new account. Then you can call login() or logout() to login or logout.

Step 3: Manage your contacts

Call getContactManager() to get contact manager to add/remove your contact.

step 4: Let's chat

Now you can call getChatManager() to chat with your friends.

That's it!

Member Function Documentation

§ addConnectionListener()

void easemob::EMClient::addConnectionListener ( EMConnectionListener )

register connection listener.

Parameters
EMConnectionListenerPtr
Returns
NA.

§ create()

static EMClient* easemob::EMClient::create ( const EMChatConfigsPtr  configs)
static

Get the chat client with configs.

Note: Caller should delete the client when it is not used any more.

Parameters
chatconfigurations.
Returns
EMChatClient instance.

§ createAccount()

EMErrorPtr easemob::EMClient::createAccount ( const std::string &  username,
const std::string &  password 
)

Register a new account with user name and password.

Note: Blocking and time consuming operation.

Parameters
username and password
Returns
register result, EMError::EM_NO_ERROR means success, others means fail.

§ getChatConfigs()

EMChatConfigsPtr easemob::EMClient::getChatConfigs ( )

get the chat configs.

Note: NA.

Parameters
NA
Returns
EMChatConfigPtr.

§ getChatManager()

EMChatManagerInterface& easemob::EMClient::getChatManager ( )

Get chat manager to handle the message operation.

Parameters
NA
Returns
chat manager instance.

§ getChatroomManager()

EMChatroomManagerInterface& easemob::EMClient::getChatroomManager ( )

Get chatroom manager to manage the chatroom.

Parameters
NA
Returns
Chatroom manager instance.

§ getContactManager()

EMContactManagerInterface& easemob::EMClient::getContactManager ( )

Get contact manager to manage the contacts.

Parameters
NA
Returns
contact manager instance.

§ getGroupManager()

EMGroupManagerInterface& easemob::EMClient::getGroupManager ( )

Get group manager to manage the group.

Parameters
NA
Returns
group manager instance.

§ getLoginInfo()

const EMLoginInfo& easemob::EMClient::getLoginInfo ( )

Get info of current logoin user.

Parameters
NA
Returns
Login info.

§ login()

EMErrorPtr easemob::EMClient::login ( const std::string &  username,
const std::string &  password 
)

Login with user name and password.

Note: Blocking and time consuming operation.

Parameters

§ logout()

void easemob::EMClient::logout ( )

Logout current user.

Parameters
NA
Returns
NA.

§ onNetworkChanged()

virtual void easemob::EMClient::onNetworkChanged ( EMNetworkListener::EMNetworkType  to)
virtual

Get call manager to handle the voice/video call.

Note: not release yet, coming soon

Parameters
NA
Returns
call manager instance. call this method to notify SDK the network change.
Parameters
EMNetworkType
Returns
NA.

Implements easemob::EMNetworkListener.

§ removeConnectionListener()

void easemob::EMClient::removeConnectionListener ( EMConnectionListener )

remove connection listener.

Parameters
EMConnectionListenerPtr
Returns
NA.

The documentation for this class was generated from the following file: