biossocialservice.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //! BiosFriendInfo represents friend information
  2. class BiosFriendInfo
  3. {
  4. string m_Uid; //!< The Uid of the friend.
  5. string m_DisplayName; //!< The Displayable nick name of the friend.
  6. bool m_IsFavorite; //!< Xbox: Is a favorite friend?
  7. bool m_IsFollowed; //!< Xbox: Is this a two-way friendship?
  8. static bool Compare( BiosFriendInfo a, BiosFriendInfo b )
  9. {
  10. return ( a.m_Uid == b.m_Uid && a.m_DisplayName == b.m_DisplayName && a.m_IsFavorite == b.m_IsFavorite && a.m_IsFollowed == b.m_IsFollowed );
  11. }
  12. };
  13. typedef array<ref BiosFriendInfo> BiosFriendInfoArray;
  14. //! BiosSocialService is used to query friend list and other social features for the current user.
  15. /*!
  16. Todo: report friend changes
  17. */
  18. class BiosSocialService
  19. {
  20. //! Display small system UI profile for the target.
  21. /*!
  22. Xbox: The async result is returned in the OnPermissionsAsync callback.
  23. @param uid_target target user Uid's for which to display profile.
  24. @return EBiosError indicating if the async operation is pending.
  25. */
  26. proto native EBiosError ShowUserProfileAsync(string uid_target);
  27. //! Query for friends list
  28. /*!
  29. The async result is returned in the OnFriendsAsync callback.
  30. @return EBiosError indicating if the async operation is pending.
  31. */
  32. proto native EBiosError GetFriendsAsync();
  33. //! Async callback for ShowUserProfileAsync
  34. /*!
  35. @param error error indicating success or fail of the async operation.
  36. Xbox: OK - the user displayed the fullscreen profile
  37. Xbox: CANCEL - the user closed the small profile.
  38. */
  39. void OnUserProfileAsync(EBiosError error)
  40. {
  41. OnlineServices.OnUserProfileAsync( error );
  42. }
  43. //! Async callback for GetFriendsAsync
  44. /*!
  45. @param friend_list list of BiosFriendInfo for each friend. NULL if failed.
  46. @param error error indicating success or fail of the async operation.
  47. */
  48. void OnFriendsAsync(BiosFriendInfoArray friend_list, EBiosError error)
  49. {
  50. OnlineServices.OnFriendsAsync( friend_list, error );
  51. }
  52. };