libnx  v4.8.0
friends_la.h
Go to the documentation of this file.
1 /**
2  * @file friends_la.h
3  * @brief Wrapper for using the MyPage (friends) LibraryApplet.
4  * @author yellows8
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "../services/acc.h"
10 #include "../services/friends.h"
11 
12 /// Arg type values used with \ref FriendsLaArg.
13 typedef enum {
14  FriendsLaArgType_ShowFriendList = 0, ///< ShowFriendList. Launches the applet with the "Friend List" menu initially selected.
15  FriendsLaArgType_ShowUserDetailInfo = 1, ///< ShowUserDetailInfo
16  FriendsLaArgType_StartSendingFriendRequest = 2, ///< StartSendingFriendRequest
17  FriendsLaArgType_ShowMethodsOfSendingFriendRequest = 3, ///< ShowMethodsOfSendingFriendRequest. Launches the applet with the "Add Friend" menu initially selected.
18  FriendsLaArgType_StartFacedFriendRequest = 4, ///< StartFacedFriendRequest. Launches the applet where the "Search for Local Users" menu is initially shown. Returning from this menu will exit the applet.
19  FriendsLaArgType_ShowReceivedFriendRequestList = 5, ///< ShowReceivedFriendRequestList. Launches the applet where the "Received Friend Requests" menu is initially shown. Returning from this menu will exit the applet.
20  FriendsLaArgType_ShowBlockedUserList = 6, ///< ShowBlockedUserList. Launches the applet where the "Blocked-User List" menu is initially shown. Returning from this menu will exit the applet.
21  FriendsLaArgType_ShowMyProfile = 7, ///< ShowMyProfile. Launches the applet with the "Profile" menu initially selected. ShowMyProfileForHomeMenu is identical to this except for playStartupSound=true.
22  FriendsLaArgType_StartFriendInvitation = 8, ///< [9.0.0+] StartFriendInvitation. Launches the applet for sending online-play invites to friends, where the friends are selected via the UI.
23  FriendsLaArgType_StartSendingFriendInvitation = 9, ///< [9.0.0+] StartSendingFriendInvitation.
24  FriendsLaArgType_ShowReceivedInvitationDetail = 10, ///< [9.0.0+] ShowReceivedInvitationDetail.
26 
27 /// Header for the arg struct.
28 typedef struct {
29  u32 type; ///< \ref FriendsLaArgType
30  u32 pad; ///< Padding.
31  AccountUid uid; ///< \ref AccountUid
33 
34 /// Common data for the arg struct, for the pre-9.0.0 types.
35 /// This is only set for ::FriendsLaArgType_ShowUserDetailInfo/::FriendsLaArgType_StartSendingFriendRequest, for everything else this is cleared.
36 typedef struct {
37  AccountNetworkServiceAccountId id; ///< \ref AccountNetworkServiceAccountId for the other account.
38  FriendsInAppScreenName first_inAppScreenName; ///< First InAppScreenName.
39  FriendsInAppScreenName second_inAppScreenName; ///< Second InAppScreenName.
41 
42 /// Arg struct pushed for the applet input storage, for pre-9.0.0.
43 typedef struct {
44  FriendsLaArgHeader hdr; ///< \ref FriendsLaArgHeader
45  FriendsLaArgCommonData data; ///< \ref FriendsLaArgCommonData
47 
48 /// Arg struct pushed for the applet input storage, for [9.0.0+].
49 typedef struct {
50  FriendsLaArgHeader hdr; ///< \ref FriendsLaArgHeader
51 
52  union {
53  u8 raw[0x1090]; ///< Raw data.
54 
55  FriendsLaArgCommonData common; ///< \ref FriendsLaArgCommonData
56 
57  struct {
58  s32 id_count; ///< \ref AccountNetworkServiceAccountId count, must be 1-15.
59  u32 pad; ///< Padding.
60  u64 userdata_size; ///< User-data size, must be <=0x400.
61  u8 userdata[0x400]; ///< Arbitrary user-data, see above size.
62  FriendsFriendInvitationGameModeDescription desc; ///< \ref FriendsFriendInvitationGameModeDescription
63  } start_friend_invitation; ///< Data for ::FriendsLaArgType_StartFriendInvitation.
64 
65  struct {
66  s32 id_count; ///< \ref AccountNetworkServiceAccountId count, must be 1-15.
67  u32 pad; ///< Padding.
68  AccountNetworkServiceAccountId id_list[16]; ///< \ref AccountNetworkServiceAccountId list, see above count.
69  u64 userdata_size; ///< User-data size, must be <=0x400.
70  u8 userdata[0x400]; ///< Arbitrary user-data, see above size.
71  FriendsFriendInvitationGameModeDescription desc; ///< \ref FriendsFriendInvitationGameModeDescription
72  } start_sending_friend_invitation; ///< Data for ::FriendsLaArgType_StartSendingFriendInvitation.
73 
74  struct {
75  FriendsFriendInvitationId invitation_id; ///< \ref FriendsFriendInvitationId
76  FriendsFriendInvitationGroupId invitation_group_id; ///< \ref FriendsFriendInvitationGroupId
77  } show_received_invitation_detail; ///< Data for ::FriendsLaArgType_ShowReceivedInvitationDetail.
78  } data; ///< Data for each \ref FriendsLaArgType.
79 } FriendsLaArg;
80 
81 /**
82  * @brief Launches the applet with ::FriendsLaArgType_ShowFriendList, the specified input, and playStartupSound=false.
83  * @param[in] uid \ref AccountUid
84  */
86 
87 /**
88  * @brief Launches the applet with ::FriendsLaArgType_ShowUserDetailInfo, the specified input, and playStartupSound=false.
89  * @param[in] uid \ref AccountUid
90  * @param[in] id \ref AccountNetworkServiceAccountId for the user to show UserDetailInfo for.
91  * @param[in] first_inAppScreenName First \ref FriendsInAppScreenName.
92  * @param[in] second_inAppScreenName Second \ref FriendsInAppScreenName.
93  */
95 
96 /**
97  * @brief Launches the applet with ::FriendsLaArgType_StartSendingFriendRequest, the specified input, and playStartupSound=false. On success, this will load the output Result from the output storage.
98  * @param[in] uid \ref AccountUid
99  * @param[in] id \ref AccountNetworkServiceAccountId to send the friend request to.
100  * @param[in] first_inAppScreenName First \ref FriendsInAppScreenName.
101  * @param[in] second_inAppScreenName Second \ref FriendsInAppScreenName.
102  */
104 
105 /**
106  * @brief Launches the applet with ::FriendsLaArgType_ShowMethodsOfSendingFriendRequest, the specified input, and playStartupSound=false.
107  * @param[in] uid \ref AccountUid
108  */
110 
111 /**
112  * @brief Launches the applet with ::FriendsLaArgType_StartFacedFriendRequest, the specified input, and playStartupSound=false.
113  * @param[in] uid \ref AccountUid
114  */
116 
117 /**
118  * @brief Launches the applet with ::FriendsLaArgType_ShowReceivedFriendRequestList, the specified input, and playStartupSound=false.
119  * @param[in] uid \ref AccountUid
120  */
122 
123 /**
124  * @brief Launches the applet with ::FriendsLaArgType_ShowBlockedUserList, the specified input, and playStartupSound=false.
125  * @param[in] uid \ref AccountUid
126  */
128 
129 /**
130  * @brief Launches the applet with ::FriendsLaArgType_ShowMyProfile, the specified input, and playStartupSound=false.
131  * @param[in] uid \ref AccountUid
132  */
134 
135 /**
136  * @brief Same as \ref friendsLaShowMyProfile except with playStartupSound=true.
137  * @param[in] uid \ref AccountUid
138  */
140 
141 /**
142  * @brief Launches the applet with ::FriendsLaArgType_StartFriendInvitation, the specified input, and playStartupSound=false. On success, this will load the output Result from the output storage.
143  * @note Only available on [9.0.0+].
144  * @param[in] uid \ref AccountUid
145  * @param[in] id_count \ref AccountNetworkServiceAccountId count, must be 1-15. Number of friends to invite.
146  * @param[in] desc \ref FriendsFriendInvitationGameModeDescription
147  * @param[in] userdata Arbitrary user-data. Can be NULL.
148  * @param[in] userdata_size User-data size, must be <=0x400. Can be 0 if userdata is NULL.
149  */
150 Result friendsLaStartFriendInvitation(AccountUid uid, s32 id_count, const FriendsFriendInvitationGameModeDescription *desc, const void* userdata, u64 userdata_size);
151 
152 /**
153  * @brief Launches the applet with ::FriendsLaArgType_StartSendingFriendInvitation, the specified input, and playStartupSound=false. On success, this will load the output Result from the output storage.
154  * @note Only available on [9.0.0+].
155  * @param[in] uid \ref AccountUid
156  * @param[in] id_list \ref AccountNetworkServiceAccountId list.
157  * @param[in] id_count Size of the id_list array in entries, must be 1-15. Number of friends to invite.
158  * @param[in] desc \ref FriendsFriendInvitationGameModeDescription
159  * @param[in] userdata Arbitrary user-data. Can be NULL.
160  * @param[in] userdata_size User-data size, must be <=0x400. Can be 0 if userdata is NULL.
161  */
162 Result friendsLaStartSendingFriendInvitation(AccountUid uid, const AccountNetworkServiceAccountId *id_list, s32 id_count, const FriendsFriendInvitationGameModeDescription *desc, const void* userdata, u64 userdata_size);
163 
164 /**
165  * @brief Launches the applet with ::FriendsLaArgType_ShowReceivedInvitationDetail, the specified input, and playStartupSound=false.
166  * @note Only available on [9.0.0+].
167  * @param[in] uid \ref AccountUid
168  * @param[in] invitation_id \ref FriendsFriendInvitationId
169  * @param[in] invitation_group_id \ref FriendsFriendInvitationGroupId
170  */
172 
Result friendsLaStartFriendInvitation(AccountUid uid, s32 id_count, const FriendsFriendInvitationGameModeDescription *desc, const void *userdata, u64 userdata_size)
Launches the applet with FriendsLaArgType_StartFriendInvitation, the specified input,...
Result friendsLaShowReceivedFriendRequestList(AccountUid uid)
Launches the applet with FriendsLaArgType_ShowReceivedFriendRequestList, the specified input,...
Result friendsLaShowMyProfileForHomeMenu(AccountUid uid)
Same as friendsLaShowMyProfile except with playStartupSound=true.
Result friendsLaStartSendingFriendInvitation(AccountUid uid, const AccountNetworkServiceAccountId *id_list, s32 id_count, const FriendsFriendInvitationGameModeDescription *desc, const void *userdata, u64 userdata_size)
Launches the applet with FriendsLaArgType_StartSendingFriendInvitation, the specified input,...
Result friendsLaShowUserDetailInfo(AccountUid uid, AccountNetworkServiceAccountId id, const FriendsInAppScreenName *first_inAppScreenName, const FriendsInAppScreenName *second_inAppScreenName)
Launches the applet with FriendsLaArgType_ShowUserDetailInfo, the specified input,...
Result friendsLaStartSendingFriendRequest(AccountUid uid, AccountNetworkServiceAccountId id, const FriendsInAppScreenName *first_inAppScreenName, const FriendsInAppScreenName *second_inAppScreenName)
Launches the applet with FriendsLaArgType_StartSendingFriendRequest, the specified input,...
Result friendsLaStartFacedFriendRequest(AccountUid uid)
Launches the applet with FriendsLaArgType_StartFacedFriendRequest, the specified input,...
Result friendsLaShowReceivedInvitationDetail(AccountUid uid, FriendsFriendInvitationId invitation_id, FriendsFriendInvitationGroupId invitation_group_id)
Launches the applet with FriendsLaArgType_ShowReceivedInvitationDetail, the specified input,...
Result friendsLaShowMyProfile(AccountUid uid)
Launches the applet with FriendsLaArgType_ShowMyProfile, the specified input, and playStartupSound=fa...
FriendsLaArgType
Arg type values used with FriendsLaArg.
Definition: friends_la.h:13
@ FriendsLaArgType_StartFacedFriendRequest
StartFacedFriendRequest. Launches the applet where the "Search for Local Users" menu is initially sho...
Definition: friends_la.h:18
@ FriendsLaArgType_ShowMethodsOfSendingFriendRequest
ShowMethodsOfSendingFriendRequest. Launches the applet with the "Add Friend" menu initially selected.
Definition: friends_la.h:17
@ FriendsLaArgType_ShowUserDetailInfo
ShowUserDetailInfo.
Definition: friends_la.h:15
@ FriendsLaArgType_StartSendingFriendInvitation
[9.0.0+] StartSendingFriendInvitation.
Definition: friends_la.h:23
@ FriendsLaArgType_ShowMyProfile
ShowMyProfile. Launches the applet with the "Profile" menu initially selected. ShowMyProfileForHomeMe...
Definition: friends_la.h:21
@ FriendsLaArgType_ShowReceivedFriendRequestList
ShowReceivedFriendRequestList. Launches the applet where the "Received Friend Requests" menu is initi...
Definition: friends_la.h:19
@ FriendsLaArgType_StartFriendInvitation
[9.0.0+] StartFriendInvitation. Launches the applet for sending online-play invites to friends,...
Definition: friends_la.h:22
@ FriendsLaArgType_StartSendingFriendRequest
StartSendingFriendRequest.
Definition: friends_la.h:16
@ FriendsLaArgType_ShowBlockedUserList
ShowBlockedUserList. Launches the applet where the "Blocked-User List" menu is initially shown....
Definition: friends_la.h:20
@ FriendsLaArgType_ShowReceivedInvitationDetail
[9.0.0+] ShowReceivedInvitationDetail.
Definition: friends_la.h:24
@ FriendsLaArgType_ShowFriendList
ShowFriendList. Launches the applet with the "Friend List" menu initially selected.
Definition: friends_la.h:14
Result friendsLaShowMethodsOfSendingFriendRequest(AccountUid uid)
Launches the applet with FriendsLaArgType_ShowMethodsOfSendingFriendRequest, the specified input,...
Result friendsLaShowBlockedUserList(AccountUid uid)
Launches the applet with FriendsLaArgType_ShowBlockedUserList, the specified input,...
Result friendsLaShowFriendList(AccountUid uid)
Launches the applet with FriendsLaArgType_ShowFriendList, the specified input, and playStartupSound=f...
NetworkServiceAccountId.
Definition: acc.h:47
Account UserId.
Definition: acc.h:25
FriendInvitationGameModeDescription.
Definition: friends.h:29
FriendInvitationGroupId.
Definition: friends.h:39
FriendInvitationId.
Definition: friends.h:34
InAppScreenName.
Definition: friends.h:23
Common data for the arg struct, for the pre-9.0.0 types.
Definition: friends_la.h:36
FriendsInAppScreenName second_inAppScreenName
Second InAppScreenName.
Definition: friends_la.h:39
FriendsInAppScreenName first_inAppScreenName
First InAppScreenName.
Definition: friends_la.h:38
AccountNetworkServiceAccountId id
AccountNetworkServiceAccountId for the other account.
Definition: friends_la.h:37
Header for the arg struct.
Definition: friends_la.h:28
AccountUid uid
AccountUid
Definition: friends_la.h:31
u32 pad
Padding.
Definition: friends_la.h:30
u32 type
FriendsLaArgType
Definition: friends_la.h:29
Arg struct pushed for the applet input storage, for pre-9.0.0.
Definition: friends_la.h:43
FriendsLaArgCommonData data
FriendsLaArgCommonData
Definition: friends_la.h:45
FriendsLaArgHeader hdr
FriendsLaArgHeader
Definition: friends_la.h:44
Arg struct pushed for the applet input storage, for [9.0.0+].
Definition: friends_la.h:49
u32 pad
Padding.
Definition: friends_la.h:59
s32 id_count
AccountNetworkServiceAccountId count, must be 1-15.
Definition: friends_la.h:58
FriendsFriendInvitationGroupId invitation_group_id
FriendsFriendInvitationGroupId
Definition: friends_la.h:76
FriendsLaArgHeader hdr
FriendsLaArgHeader
Definition: friends_la.h:50
FriendsFriendInvitationGameModeDescription desc
FriendsFriendInvitationGameModeDescription
Definition: friends_la.h:62
u64 userdata_size
User-data size, must be <=0x400.
Definition: friends_la.h:60
FriendsLaArgCommonData common
FriendsLaArgCommonData
Definition: friends_la.h:55
FriendsFriendInvitationId invitation_id
FriendsFriendInvitationId
Definition: friends_la.h:75
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
u32 Result
Function error code result type.
Definition: types.h:44
int32_t s32
32-bit signed integer.
Definition: types.h:27
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21