PICO Unreal Platform SDK
Pico_User.h
1/*******************************************************************************
2Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
3
4NOTICE:All information contained herein is, and remains the property of
5PICO Technology Co., Ltd. The intellectual and technical concepts
6contained herein are proprietary to PICO Technology Co., Ltd. and may be
7covered by patents, patents in process, and are protected by trade secret or
8copyright law. Dissemination of this information or reproduction of this
9material is strictly forbidden unless prior written permission is obtained from
10PICO Technology Co., Ltd.
11*******************************************************************************/
12// This plugin incorporates portions of the Unreal® Engine. Unreal® is a trademark or registered trademark of Epic Games, Inc.In the United States of America and elsewhere.
13// Unreal® Engine, Copyright 1998 – 2022, Epic Games, Inc.All rights reserved.
14#pragma once
15
16#include "CoreMinimal.h"
17#include "UObject/NoExportTypes.h"
18#include "PPF_Platform.h"
19#include "OnlineSubsystemPicoNames.h"
20#include "OnlineSubsystemPico.h"
21#include "Pico_Room.h"
22#include "Pico_User.generated.h"
23
25
26DECLARE_LOG_CATEGORY_EXTERN(PicoUser, Log, All);
27
28class UPico_Room;
29
33DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoggedInUserFriendsAndRooms, bool, bIsError, const FString&, ErrorMessage, UPico_UserAndRoomArray*, UserAndRoomArray);
34DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextUserAndRoomArrayPage, bool, bIsError, const FString&, ErrorMessage, UPico_UserAndRoomArray*, UserAndRoomArray);
35DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoggedInUserFriends, bool, bIsError, const FString&, ErrorMessage, UPico_UserArray*, UserArray);
36DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetNextUserPage, bool, bIsError, const FString&, ErrorMessage, UPico_UserArray*, UserArray);
37DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetLoginUser, bool, bIsError, const FString&, ErrorMessage, UPico_User*, User);
38DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetUserInfo, bool, bIsError, const FString&, ErrorMessage, UPico_User*, User);
39DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetPermissionResult, bool, bIsError, const FString&, ErrorMessage, UPico_PermissionResult*, PermissionResult);
40DECLARE_DYNAMIC_DELEGATE_ThreeParams(FGetAccessTokenResult, bool, bIsError, const FString&, ErrorMessage, const FString&, AccessToken);
41DECLARE_DYNAMIC_DELEGATE_FourParams(FLaunchFriendRequestResult, bool, bIsError, const FString&, ErrorMessage, bool, bDidCancel, bool, bDidSendRequest);
42
54class ONLINESUBSYSTEMPICO_API FPicoUserInterface
55{
56private:
57
58 FOnlineSubsystemPico& PicoSubsystem;
59
60public:
61 FPicoUserInterface(FOnlineSubsystemPico& InSubsystem);
63
64 FGetLoginUser GetLoginUserDelegate;
65 FGetLoggedInUserFriendsAndRooms GetLoggedInUserFriendsAndRoomsDelegate;
66 FGetNextUserAndRoomArrayPage GetNextUserAndRoomArrayPageDelegate;
67 FGetLoggedInUserFriends GetLoggedInUserFriendsDelegate;
68 FGetNextUserPage GetNextUserFriendsPageDelegate;
69 FGetUserInfo GetUserInfoDelegate;
70 FGetPermissionResult GetAuthorizePermissionsDelegate;
71 FGetPermissionResult RequestUserPermissionsDelegate;
72 FLaunchFriendRequestResult LaunchFriendRequestDelegate;
73 FGetAccessTokenResult GetAccesstokenDelegate;
74
83 bool GetLoginUser(FGetLoginUser InGetLoginUserDelegate);
84
94 bool GetUserInfo(const FString& UserId, FGetUserInfo InGetUserInfoDelegate);
95
104 bool GetLoggedInUserAndRoom(FGetLoggedInUserFriendsAndRooms OnGetLoggedInuserFriendsAndRoomsCallback);
105
116 bool GetNextUserAndRoomArrayPage(UPico_UserAndRoomArray* InUserAndRoomArray, FGetNextUserAndRoomArrayPage OnGetNextUserAndRoomArrayPageCallback);
117
126 bool GetUserFriends(FGetLoggedInUserFriends OnGetLoggedInUserFriendsCallback);
127
137 bool GetNextUserPage(UPico_UserArray* InUserArray, FGetNextUserPage OnGetNextUserPageCallback);
138
149 bool GetAuthorizePermissions(FGetPermissionResult OnGetPermissionResultCallback);
150
167 bool RequestUserPermissions(TArray<FString> Permissions, FGetPermissionResult OnGetPermissionResultCallback);
168
180 bool LaunchFriendRequestFlow(const FString UserId, FLaunchFriendRequestResult OnLaunchFriendRequestResultCallback);
181
182 bool GetAccessToken(FGetAccessTokenResult OnGetAccessTokenResultCallback);
183};
199UCLASS()
200class ONLINESUBSYSTEMPICO_API UOnlinePicoUserFunction : public UBlueprintFunctionLibrary
201{
202 GENERATED_BODY()
203
204
205public:
206
216 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
217 static void PicoGetLoggedInUserAndRoom(UObject* WorldContextObject, FGetLoggedInUserFriendsAndRooms InGetLoggedInuserFriendsAndRoomsCallback);
218
229 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
230 static void PicoGetNextUserAndRoomArrayPage(UObject* WorldContextObject, UPico_UserAndRoomArray* InUserAndRoomArray, FGetNextUserAndRoomArrayPage InGetNextUserAndRoomArrayPageCallback);
231
232
242 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
243 static void PicoGetUserFriends(UObject* WorldContextObject, FGetLoggedInUserFriends InGetLoggedInUserFriendsDelegate);
244
255 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
256 static void PicoGetNextUserPage(UObject* WorldContextObject, UPico_UserArray* InUserArray, FGetNextUserPage InGetNextUserPageDelegate);
257
267 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
268 static bool GetLoginUser(UObject* WorldContextObject, FGetLoginUser InGetLoginUserDelegate);
269
280 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
281 static bool GetPicoUserInfo(UObject* WorldContextObject, const FString& UserId, FGetUserInfo InGetUserInfoDelegate);
282
294 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
295 static bool GetAuthorizePermissions(UObject* WorldContextObject, FGetPermissionResult OnGetPermissionResultCallback);
296
297
315 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
316 static bool RequestUserPermissions(UObject* WorldContextObject, TArray<FString> Permissions, FGetPermissionResult OnGetPermissionResultCallback);
317
330 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
331 static bool LaunchFriendRequestFlow(UObject* WorldContextObject, const FString UserId, FLaunchFriendRequestResult OnLaunchFriendRequestResultCallback);
332
333 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|User")
334 static bool GetAccessToken(UObject* WorldContextObject, FGetAccessTokenResult OnGetAccessTokenResultCallback);
335};
336 // end of BP_User // end of BlueprintFunction
339
340UCLASS(BlueprintType)
341class ONLINESUBSYSTEMPICO_API UPico_User : public UObject
342{
343 GENERATED_BODY()
344public:
345 void InitParams(ppfUser* ppfUserHandle);
346
347private:
348 FString DisplayName = FString();
349 FString ImageUrl = FString();
350 FString ID = FString();
351 FString InviteToken = FString();
352 FString SmallImageUrl = FString();
353 FString PresencePackage = FString();
355 EUserGender UserGender = EUserGender::Unknow;
356 FString Presence = FString();
357 FString PresenceDeeplinkMessage = FString();
358 FString PresenceDestinationApiName = FString();
359 FString PresenceLobbySessionId = FString();
360 FString PresenceMatchSessionId = FString();
361 FString PresenceExtra = FString();
362 FString StoreRegion = FString();
363
364public:
365
366 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
367 FString GetDisplayName();
368
369 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
370 FString GetImageURL();
371
372 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
373 FString GetID();
374
375 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
376 FString GetInviteToken();
377
378 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
379 FString GetSmallImageUrl();
380
381 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
382 FString GetPresencePackage();
383
384 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
385 EUserPresenceStatus GetUserPresenceStatus();
386
387 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
388 EUserGender GetGender();
389
390 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
391 FString GetPresence();
392
393 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
394 FString GetPresenceDeeplinkMessage();
395
396 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
397 FString GetPresenceDestinationApiName();
398
399 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
400 FString GetPresenceLobbySessionId();
401
402 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
403 FString GetPresenceMatchSessionId();
404
405 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
406 FString GetPresenceExtra();
407
408 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User")
409 FString GetStoreRegion();
410};
411
412UCLASS(BlueprintType)
413class ONLINESUBSYSTEMPICO_API UPico_UserArray : public UObject
414{
415
416 GENERATED_BODY()
417
418public:
419 void InitParams(ppfUserArray* InppfUserArrayHandle);
420
421private:
422 UPROPERTY()
423 TArray<UPico_User*> UserArray;
424 FString NextPageParam;
425 int32 Size;
426 bool bHasNextPage;
427
428public:
429
430
431 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
432 UPico_User* GetElement(int32 Index);
433
434 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
435 FString GetNextPageParam();
436
437 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
438 int32 GetSize();
439
440 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User Array")
441 bool HasNextPage();
442
443};
444
445UCLASS(BlueprintType)
446class ONLINESUBSYSTEMPICO_API UPico_UserAndRoom : public UObject
447{
448
449 GENERATED_BODY()
450private:
451 UPROPERTY()
452 UPico_Room* Room = nullptr;
453
454 UPROPERTY()
455 UPico_User* User = nullptr;
456public:
457 void InitParams(ppfUserAndRoom* InppfUserAndRoomHandle);
458
459 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room")
460 UPico_Room* GetRoom();
461
462 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room")
463 UPico_User* GetUser();
464};
465
466UCLASS(BlueprintType)
467class ONLINESUBSYSTEMPICO_API UPico_UserAndRoomArray : public UObject
468{
469
470 GENERATED_BODY()
471
472private:
473 UPROPERTY()
474 TArray<UPico_UserAndRoom*> UserAndRoomArray;
475 FString NextPageParam = FString();
476 int32 Size = 0;
477 bool bHasNextPage;
478public:
479 void InitParams(ppfUserAndRoomArray* InppfUserAndRoomArrayHandle);
480
481 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
482 UPico_UserAndRoom* GetElement(int32 Index);
483
484 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
485 FString GetNextPageParam();
486
487 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
488 int32 GetSize();
489
490 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|User And Room Array")
491 bool HasNextPage();
492};
493
494UCLASS(BlueprintType)
495class ONLINESUBSYSTEMPICO_API UPico_PermissionResult : public UObject
496{
497 GENERATED_BODY()
498
499private:
500 UPROPERTY()
501 TArray<FString> AuthorizedPermissions;
502 int32 Size = 0;
503 FString AccessionToken = FString();
504 FString UserID = FString();
505public:
506 void InitParams(ppfPermissionResult* InppfPermissionResultHandle);
507
508 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
509 FString GetAuthorizedPermission(int32 Index);
510
511 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
512 int32 GetSize();
513
514 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
515 FString GetAccessToken();
516
517 UFUNCTION(BlueprintPure, Category = "Pico Platform|User|Permission")
518 FString GetUserID();
519};
520
521//
PicoUserInterface class.
Definition: Pico_User.h:55
bool GetUserFriends(FGetLoggedInUserFriends OnGetLoggedInUserFriendsCallback)
Gets the friend list of the current user. Friends who don't use this app won't appear in this list.
bool GetNextUserPage(UPico_UserArray *InUserArray, FGetNextUserPage OnGetNextUserPageCallback)
Gets the next page of user list.
bool GetLoggedInUserAndRoom(FGetLoggedInUserFriendsAndRooms OnGetLoggedInuserFriendsAndRoomsCallback)
Gets the friends of the logged-in user and the rooms the friends might be in. If a friend is not in a...
bool RequestUserPermissions(TArray< FString > Permissions, FGetPermissionResult OnGetPermissionResultCallback)
Requests user permissions. The user will received a pop-up notification window.
bool GetAuthorizePermissions(FGetPermissionResult OnGetPermissionResultCallback)
Gets the authorized permissions.
bool LaunchFriendRequestFlow(const FString UserId, FLaunchFriendRequestResult OnLaunchFriendRequestResultCallback)
Launches the flow to apply for friendship with someone.
bool GetUserInfo(const FString &UserId, FGetUserInfo InGetUserInfoDelegate)
Gets the information by user ID.
bool GetNextUserAndRoomArrayPage(UPico_UserAndRoomArray *InUserAndRoomArray, FGetNextUserAndRoomArrayPage OnGetNextUserAndRoomArrayPageCallback)
Gets the friend list of the current user.
bool GetLoginUser(FGetLoginUser InGetLoginUserDelegate)
Gets the information about the current logged-in user.
OnlinePicoUser Blueprint Function class.
Definition: Pico_User.h:201
EUserPresenceStatus
User's current online status.
Definition: OnlineSubsystemPicoNames.h:38
EUserGender
User's gender.
Definition: OnlineSubsystemPicoNames.h:48