Photon C++ Client API: Listener Class Reference

Photon C++ Client API

Photon C++ Client API  4.1.12.2
Listener Class Referenceabstract
Inheritance diagram for Listener:
Collaboration diagram for Listener:

Public Member Functions

virtual void debugReturn (int debugLevel, const Common::JString &string)=0
 
virtual void onStateChange (int state)=0
 
virtual void connectionErrorReturn (int errorCode)=0
 
virtual void clientErrorReturn (int errorCode)=0
 
virtual void warningReturn (int warningCode)=0
 
virtual void serverErrorReturn (int errorCode)=0
 
virtual void connectReturn (int errorCode, const Common::JString &errorString)=0
 
virtual void disconnectReturn (void)=0
 
virtual void subscribeReturn (const Common::JVector< Common::JString > &channels, const Common::JVector< bool > &results)=0
 
virtual void unsubscribeReturn (const Common::JVector< Common::JString > &channels)=0
 
virtual void onStatusUpdate (const Common::JString &user, int status, bool gotMessage, const Common::Object &message)=0
 
virtual void onGetMessages (const Common::JString &channelName, const Common::JVector< Common::JString > &senders, const Common::JVector< Common::Object > &messages)=0
 
virtual void onPrivateMessage (const Common::JString &sender, const Common::Object &message, const Common::JString &channelName)=0
 

Detailed Description

Callback interface for Chat client side. Contains callback methods to notify your app about updates. Must be provided to new Chat::Client in constructor

Member Function Documentation

§ debugReturn()

virtual void debugReturn ( int  debugLevel,
const Common::JString string 
)
pure virtual

This is the callback function for debug-messages.

Parameters
debugLevelone of the values in DebugLevel
stringthe formatted debug string
See also
BaseListener

Implements BaseListener.

§ onStateChange()

virtual void onStateChange ( int  state)
pure virtual

Notifies app that client state changed.

Parameters
statenew client state
See also
ClientState::ClientState

§ connectReturn()

virtual void connectReturn ( int  errorCode,
const Common::JString errorString 
)
pure virtual

Client is connected now.

§ disconnectReturn()

virtual void disconnectReturn ( void  )
pure virtual

Disconnection happened.

§ subscribeReturn()

virtual void subscribeReturn ( const Common::JVector< Common::JString > &  channels,
const Common::JVector< bool > &  results 
)
pure virtual

The result of the subscribe operation. Returns per channel name if the channel is now subscribed.

Parameters
channelschannel names
resultsper channel result: true if subscribed

§ unsubscribeReturn()

virtual void unsubscribeReturn ( const Common::JVector< Common::JString > &  channels)
pure virtual

Result of unsubscribe operation. Returns per channel name if the channel is now subscribed.

Parameters
channelschannel names that are no longer subscribed

§ onStatusUpdate()

virtual void onStatusUpdate ( const Common::JString user,
int  status,
bool  gotMessage,
const Common::Object message 
)
pure virtual

The new status of another user (you get updates for users that are in your friends list).

Parameters
username of the user
statusnew status of that user
gotMessagetrue if the status contains a message you should cache locally. False: This status update does not include a message (keep any you have).
messagemessage that user set

§ onGetMessages()

virtual void onGetMessages ( const Common::JString channelName,
const Common::JVector< Common::JString > &  senders,
const Common::JVector< Common::Object > &  messages 
)
pure virtual

Notifies the app that the client got new messages from the server Number of senders is equal to number of messages in 'messages'. Sender with number '0' corresponds to message with number '0', sender with number '1' corresponds to message with number '1' and so on

Parameters
channelNamechannel from where messages came
senderslist of users who sent messages
messageslist of messages it self

§ onPrivateMessage()

virtual void onPrivateMessage ( const Common::JString sender,
const Common::Object message,
const Common::JString channelName 
)
pure virtual

Notifies the app about a private message

Parameters
senderuser who sent this message
messagethe message itself
channelNamethe channel name for private messages (messages that you sent yourself get added to a channel per target username)