1 #ifndef GALAXY_I_FRIENDS_H
2 #define GALAXY_I_FRIENDS_H
Contains GalaxyID, which is the class that represents the ID of an entity used by Galaxy Peer.
Contains data structures and interfaces related to callback listeners.
Represents the ID of an entity used by Galaxy Peer.
Definition: GalaxyID.h:30
The class that is inherited by all specific callback listeners and provides a static method that retu...
Definition: IListenerRegistrar.h:117
Listener for the event of a user being added to the friend list.
Definition: IFriends.h:333
virtual void OnFriendAdded(GalaxyID userID, InvitationDirection invitationDirection)=0
Notification for the event of a user being added to the friend list.
InvitationDirection
The direction of the invitation that initiated the change in the friend list.
Definition: IFriends.h:340
@ INVITATION_DIRECTION_INCOMING
The user indicated in the notification was the inviter.
Definition: IFriends.h:341
@ INVITATION_DIRECTION_OUTGOING
The user indicated in the notification was the invitee.
Definition: IFriends.h:342
Listener for the event of removing a user from the friend list.
Definition: IFriends.h:363
virtual void OnFriendDeleteFailure(GalaxyID userID, FailureReason failureReason)=0
Notification for the event of a failure in removing a user from the friend list.
FailureReason
The reason of a failure in removing a user from the friend list.
Definition: IFriends.h:377
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IFriends.h:378
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IFriends.h:379
virtual void OnFriendDeleteSuccess(GalaxyID userID)=0
Notification for the event of a success in removing a user from the friend list.
Listener for the event of retrieving requested list of incoming friend invitations.
Definition: IFriends.h:198
FailureReason
The reason of a failure in retrieving the user's list of incoming friend invitations.
Definition: IFriends.h:212
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IFriends.h:213
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IFriends.h:214
virtual void OnFriendInvitationListRetrieveSuccess()=0
Notification for the event of a success in retrieving the user's list of incoming friend invitations.
virtual void OnFriendInvitationListRetrieveFailure(FailureReason failureReason)=0
Notification for the event of a failure in retrieving the user's list of incoming friend invitations.
Listener for the event of receiving a friend invitation.
Definition: IFriends.h:271
virtual void OnFriendInvitationReceived(GalaxyID userID, uint32_t sendTime)=0
Notification for the event of receiving a friend invitation.
Listener for the event of responding to a friend invitation.
Definition: IFriends.h:292
FailureReason
The reason of a failure in responding to a friend invitation.
Definition: IFriends.h:307
@ FAILURE_REASON_USER_ALREADY_FRIEND
User already on the friend list.
Definition: IFriends.h:311
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IFriends.h:308
@ FAILURE_REASON_USER_DOES_NOT_EXIST
User does not exist.
Definition: IFriends.h:309
@ FAILURE_REASON_FRIEND_INVITATION_DOES_NOT_EXIST
Friend invitation does not exist.
Definition: IFriends.h:310
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IFriends.h:312
virtual void OnFriendInvitationRespondToFailure(GalaxyID userID, FailureReason failureReason)=0
Notification for the event of a failure in responding to a friend invitation.
virtual void OnFriendInvitationRespondToSuccess(GalaxyID userID, bool accept)=0
Notification for the event of a success in responding to a friend invitation.
Listener for the event of sending a friend invitation.
Definition: IFriends.h:158
FailureReason
The reason of a failure in sending a friend invitation.
Definition: IFriends.h:172
@ FAILURE_REASON_USER_ALREADY_INVITED
Friend invitation already sent to the user.
Definition: IFriends.h:175
@ FAILURE_REASON_USER_ALREADY_FRIEND
User already on the friend list.
Definition: IFriends.h:176
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IFriends.h:173
@ FAILURE_REASON_USER_DOES_NOT_EXIST
User does not exist.
Definition: IFriends.h:174
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IFriends.h:177
virtual void OnFriendInvitationSendFailure(GalaxyID userID, FailureReason failureReason)=0
Notification for the event of a failure in sending a friend invitation.
virtual void OnFriendInvitationSendSuccess(GalaxyID userID)=0
Notification for the event of a success in sending a friend invitation.
Listener for the event of retrieving requested list of friends.
Definition: IFriends.h:122
FailureReason
The reason of a failure in retrieving the user's list of friends.
Definition: IFriends.h:136
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IFriends.h:137
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IFriends.h:138
virtual void OnFriendListRetrieveSuccess()=0
Notification for the event of a success in retrieving the user's list of friends.
virtual void OnFriendListRetrieveFailure(FailureReason failureReason)=0
Notification for the event of a failure in retrieving the user's list of friends.
The interface for managing social info and activities.
Definition: IFriends.h:621
virtual void RequestSentFriendInvitationList(ISentFriendInvitationListRetrieveListener *const listener=NULL)=0
Performs a request for the user's list of outgoing friend invitations.
virtual GalaxyID GetFriendByIndex(uint32_t index)=0
Returns the GalaxyID for a friend.
virtual void GetFriendAvatarImageRGBA(GalaxyID userID, AvatarType avatarType, void *buffer, uint32_t bufferLength)=0
Copies the avatar of a specified user.
virtual bool IsUserInformationAvailable(GalaxyID userID)=0
Checks if the information of specified user is available.
virtual void GetFriendPersonaNameCopy(GalaxyID userID, char *buffer, uint32_t bufferLength)=0
Copies the nickname of a specified user.
virtual void RespondToFriendInvitation(GalaxyID userID, bool accept, IFriendInvitationRespondToListener *const listener=NULL)=0
Responds to the friend invitation.
virtual const char * GetPersonaName()=0
Returns the user's nickname.
virtual void RequestUserInformation(GalaxyID userID, AvatarCriteria avatarCriteria=AVATAR_TYPE_NONE, IUserInformationRetrieveListener *const listener=NULL)=0
Performs a request for information about specified user.
virtual const char * GetFriendAvatarUrl(GalaxyID userID, AvatarType avatarType)=0
Returns the URL of the avatar of a specified user.
virtual bool IsFriend(GalaxyID userID)=0
Checks if a specified user is a friend.
virtual void RequestRichPresence(GalaxyID userID=GalaxyID(), IRichPresenceRetrieveListener *const listener=NULL)=0
Performs a request for the user's rich presence.
virtual void GetRichPresenceCopy(const char *key, char *buffer, uint32_t bufferLength, GalaxyID userID=GalaxyID())=0
Copies the rich presence of a specified user to a buffer.
virtual void GetRichPresenceByIndex(uint32_t index, char *key, uint32_t keyLength, char *value, uint32_t valueLength, GalaxyID userID=GalaxyID())=0
Returns a property from the rich presence storage by index.
virtual bool IsUserInTheSameGame(GalaxyID userID) const =0
Checks if a specified user is playing the same game.
virtual void SetRichPresence(const char *key, const char *value, IRichPresenceChangeListener *const listener=NULL)=0
Sets the variable value under a specified name.
virtual void GetFriendInvitationByIndex(uint32_t index, GalaxyID &userID, uint32_t &sendTime)=0
Reads the details of the friend invitation.
virtual PersonaState GetFriendPersonaState(GalaxyID userID)=0
Returns the state of a specified user.
virtual uint32_t GetFriendCount()=0
Returns the number of retrieved friends in the user's list of friends.
virtual AvatarCriteria GetDefaultAvatarCriteria()=0
Returns the default avatar criteria.
virtual void DeleteRichPresence(const char *key, IRichPresenceChangeListener *const listener=NULL)=0
Removes the variable value under a specified name.
virtual void RequestFriendInvitationList(IFriendInvitationListRetrieveListener *const listener=NULL)=0
Performs a request for the user's list of incoming friend invitations.
virtual const char * GetRichPresenceKeyByIndex(uint32_t index, GalaxyID userID=GalaxyID())=0
Returns a key from the rich presence storage by index.
virtual bool IsFriendAvatarImageRGBAAvailable(GalaxyID userID, AvatarType avatarType)=0
Checks if a specified avatar image is available.
virtual void RequestFriendList(IFriendListListener *const listener=NULL)=0
Performs a request for the user's list of friends.
virtual void DeleteFriend(GalaxyID userID, IFriendDeleteListener *const listener=NULL)=0
Removes a user from the friend list.
virtual void GetFriendAvatarUrlCopy(GalaxyID userID, AvatarType avatarType, char *buffer, uint32_t bufferLength)=0
Copies URL of the avatar of a specified user.
virtual void GetRichPresenceKeyByIndexCopy(uint32_t index, char *buffer, uint32_t bufferLength, GalaxyID userID=GalaxyID())=0
Copies a key from the rich presence storage by index to a buffer.
virtual const char * GetFriendPersonaName(GalaxyID userID)=0
Returns the nickname of a specified user.
virtual PersonaState GetPersonaState()=0
Returns the user's state.
virtual void ClearRichPresence(IRichPresenceChangeListener *const listener=NULL)=0
Removes all rich presence data for the user.
virtual void SendFriendInvitation(GalaxyID userID, IFriendInvitationSendListener *const listener=NULL)=0
Sends a friend invitation.
virtual uint32_t GetRichPresenceCount(GalaxyID userID=GalaxyID())=0
Returns the number of retrieved properties in user's rich presence.
virtual void GetPersonaNameCopy(char *buffer, uint32_t bufferLength)=0
Copies the user's nickname to a buffer.
virtual void ShowOverlayInviteDialog(const char *connectionString)=0
Shows game invitation dialog that allows to invite users to game.
virtual void SetDefaultAvatarCriteria(AvatarCriteria defaultAvatarCriteria)=0
Sets the default avatar criteria.
virtual void SendInvitation(GalaxyID userID, const char *connectionString, ISendInvitationListener *const listener=NULL)=0
Sends a game invitation without using the overlay.
virtual void FindUser(const char *userSpecifier, IUserFindListener *const listener=NULL)=0
Finds a specified user.
virtual const char * GetRichPresence(const char *key, GalaxyID userID=GalaxyID())=0
Returns the rich presence of a specified user.
virtual uint32_t GetFriendInvitationCount()=0
Returns the number of retrieved friend invitations.
virtual uint32_t GetFriendAvatarImageID(GalaxyID userID, AvatarType avatarType)=0
Returns the ID of the avatar of a specified user.
Event of receiving a game invitation.
Definition: IFriends.h:517
virtual void OnGameInvitationReceived(GalaxyID userID, const char *connectionString)=0
Notification for the event of receiving a game invitation.
Event of requesting a game join by user.
Definition: IFriends.h:494
virtual void OnGameJoinRequested(GalaxyID userID, const char *connectionString)=0
Notification for the event of accepting a game invitation.
Listener for the event of changing persona data.
Definition: IFriends.h:50
virtual void OnPersonaDataChanged(GalaxyID userID, uint32_t personaStateChange)=0
Notification for the event of changing persona data.
PersonaStateChange
Describes what has changed about a user.
Definition: IFriends.h:57
@ PERSONA_CHANGE_AVATAR
Avatar, i.e. its URL, has changed.
Definition: IFriends.h:60
@ PERSONA_CHANGE_AVATAR_DOWNLOADED_IMAGE_LARGE
Large avatar image has been downloaded.
Definition: IFriends.h:63
@ PERSONA_CHANGE_AVATAR_DOWNLOADED_IMAGE_MEDIUM
Medium avatar image has been downloaded.
Definition: IFriends.h:62
@ PERSONA_CHANGE_AVATAR_DOWNLOADED_IMAGE_ANY
Any avatar images have been downloaded.
Definition: IFriends.h:64
@ PERSONA_CHANGE_NAME
Persona name has changed.
Definition: IFriends.h:59
@ PERSONA_CHANGE_AVATAR_DOWNLOADED_IMAGE_SMALL
Small avatar image has been downloaded.
Definition: IFriends.h:61
@ PERSONA_CHANGE_NONE
No information has changed.
Definition: IFriends.h:58
Listener for the event of rich presence modification.
Definition: IFriends.h:400
virtual void OnRichPresenceChangeFailure(FailureReason failureReason)=0
Notification for the event of failure to modify rich presence.
FailureReason
The reason of a failure in rich presence modification.
Definition: IFriends.h:412
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IFriends.h:413
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IFriends.h:414
virtual void OnRichPresenceChangeSuccess()=0
Notification for the event of successful rich presence change.
Listener for the event of any user rich presence update.
Definition: IFriends.h:434
virtual void OnRichPresenceUpdated(GalaxyID userID)=0
Notification for the event of successful rich presence update.
Listener for the event of retrieving requested user's rich presence.
Definition: IFriends.h:454
FailureReason
The reason of a failure in retrieving the user's rich presence.
Definition: IFriends.h:468
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IFriends.h:469
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IFriends.h:470
virtual void OnRichPresenceRetrieveFailure(GalaxyID userID, FailureReason failureReason)=0
Notification for the event of a failure in retrieving the user's rich presence.
virtual void OnRichPresenceRetrieveSuccess(GalaxyID userID)=0
Notification for the event of a success in retrieving the user's rich presence.
Listener for the event of sending an invitation without using the overlay.
Definition: IFriends.h:538
FailureReason
The reason of a failure in sending an invitation.
Definition: IFriends.h:553
@ FAILURE_REASON_SENDER_BLOCKED
Sender blocked by receiver. Will also occur if both users blocked each other.
Definition: IFriends.h:559
@ FAILURE_REASON_RECEIVER_DOES_NOT_ALLOW_INVITING
Receiver does not allow inviting.
Definition: IFriends.h:556
@ FAILURE_REASON_RECEIVER_BLOCKED
Receiver blocked by sender.
Definition: IFriends.h:558
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IFriends.h:554
@ FAILURE_REASON_USER_DOES_NOT_EXIST
Receiver does not exist.
Definition: IFriends.h:555
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IFriends.h:560
@ FAILURE_REASON_SENDER_DOES_NOT_ALLOW_INVITING
Sender does not allow inviting.
Definition: IFriends.h:557
virtual void OnInvitationSendFailure(GalaxyID userID, const char *connectionString, FailureReason failureReason)=0
Notification for the event of a failure in sending an invitation.
virtual void OnInvitationSendSuccess(GalaxyID userID, const char *connectionString)=0
Notification for the event of success in sending an invitation.
Listener for the event of retrieving requested list of outgoing friend invitations.
Definition: IFriends.h:235
FailureReason
The reason of a failure in retrieving the user's list of outgoing friend invitations.
Definition: IFriends.h:249
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IFriends.h:250
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IFriends.h:251
virtual void OnSentFriendInvitationListRetrieveFailure(FailureReason failureReason)=0
Notification for the event of a failure in retrieving the user's list of outgoing friend invitations.
virtual void OnSentFriendInvitationListRetrieveSuccess()=0
Notification for the event of a success in retrieving the user's list of outgoing friend invitations.
Listener for the event of searching a user.
Definition: IFriends.h:582
FailureReason
The reason of a failure in searching a user.
Definition: IFriends.h:597
@ FAILURE_REASON_USER_NOT_FOUND
Specified user was not found.
Definition: IFriends.h:599
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IFriends.h:598
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IFriends.h:600
virtual void OnUserFindFailure(const char *userSpecifier, FailureReason failureReason)=0
Notification for the event of a failure in finding a user.
virtual void OnUserFindSuccess(const char *userSpecifier, GalaxyID userID)=0
Notification for the event of success in finding a user.
The class that is inherited by the self-registering versions of all specific callback listeners.
Definition: IListenerRegistrar.h:211
SelfRegisteringListener< IGameInvitationReceivedListener > GlobalGameInvitationReceivedListener
Globally self-registering version of IGameInvitationReceivedListener.
Definition: IFriends.h:532
uint32_t AvatarCriteria
The bit sum of the AvatarType.
Definition: IFriends.h:35
SelfRegisteringListener< IFriendAddListener > GlobalFriendAddListener
Globally self-registering version of IFriendAddListener.
Definition: IFriends.h:357
SelfRegisteringListener< ISendInvitationListener > GlobalSendInvitationListener
Globally self-registering version of ISendInvitationListener.
Definition: IFriends.h:576
SelfRegisteringListener< ISentFriendInvitationListRetrieveListener > GlobalSentFriendInvitationListRetrieveListener
Globally self-registering version of ISentFriendInvitationListRetrieveListener.
Definition: IFriends.h:265
SelfRegisteringListener< IFriendInvitationListRetrieveListener > GlobalFriendInvitationListRetrieveListener
Globally self-registering version of IFriendInvitationListRetrieveListener.
Definition: IFriends.h:229
SelfRegisteringListener< IFriendListListener > GlobalFriendListListener
Globally self-registering version of IFriendListListener.
Definition: IFriends.h:152
SelfRegisteringListener< IUserInformationRetrieveListener > GlobalUserInformationRetrieveListener
Globally self-registering version of IUserInformationRetrieveListener.
Definition: IFriends.h:116
AvatarType
The type of avatar.
Definition: IFriends.h:25
PersonaState
The state of the user.
Definition: IFriends.h:41
SelfRegisteringListener< IRichPresenceChangeListener > GlobalRichPresenceChangeListener
Globally self-registering version of IRichPresenceChangeListener.
Definition: IFriends.h:428
SelfRegisteringListener< IFriendDeleteListener > GlobalFriendDeleteListener
Globally self-registering version of IFriendDeleteListener.
Definition: IFriends.h:394
SelfRegisteringListener< IFriendInvitationSendListener > GlobalFriendInvitationSendListener
Globally self-registering version of IFriendInvitationSendListener.
Definition: IFriends.h:192
SelfRegisteringListener< IUserFindListener > GlobalUserFindListener
Globally self-registering version of IUserFindListener.
Definition: IFriends.h:615
SelfRegisteringListener< IFriendInvitationListener > GlobalFriendInvitationListener
Globally self-registering version of IFriendInvitationListener.
Definition: IFriends.h:286
SelfRegisteringListener< IFriendInvitationRespondToListener > GlobalFriendInvitationRespondToListener
Globally self-registering version of IFriendInvitationRespondToListener.
Definition: IFriends.h:327
SelfRegisteringListener< IPersonaDataChangedListener > GlobalPersonaDataChangedListener
Globally self-registering version of IPersonaDataChangedListener.
Definition: IFriends.h:79
SelfRegisteringListener< IGameJoinRequestedListener > GlobalGameJoinRequestedListener
Globally self-registering version of IGameJoinRequestedListener.
Definition: IFriends.h:509
SelfRegisteringListener< IRichPresenceRetrieveListener > GlobalRichPresenceRetrieveListener
Globally self-registering version of IRichPresenceRetrieveListener.
Definition: IFriends.h:485
SelfRegisteringListener< IRichPresenceListener > GlobalRichPresenceListener
Globally self-registering version of IRichPresenceListener.
Definition: IFriends.h:448
@ AVATAR_TYPE_NONE
No avatar type specified.
Definition: IFriends.h:26
@ AVATAR_TYPE_MEDIUM
Avatar resolution size: 64x64.
Definition: IFriends.h:28
@ AVATAR_TYPE_SMALL
Avatar resolution size: 32x32.
Definition: IFriends.h:27
@ AVATAR_TYPE_LARGE
Avatar resolution size: 184x184.
Definition: IFriends.h:29
@ PERSONA_STATE_OFFLINE
User is not currently logged on.
Definition: IFriends.h:42
@ PERSONA_STATE_ONLINE
User is logged on.
Definition: IFriends.h:43