summaryrefslogtreecommitdiff
path: root/include/user/notification_util.h
blob: f50ad3adaf66b73faacd522cbe6e3cfb0fff0528 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef _DOLCESDK_PSP2_NOTIFICATION_UTIL_H_
#define _DOLCESDK_PSP2_NOTIFICATION_UTIL_H_

#include <psp2/types.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Errors
 */
#define SCE_NOTIFICATIONUTIL_ERROR_INTERNAL               0x80106301

/**
 * BGDL-type notification event handler function
 */
typedef void (*SceNotificationUtilProgressEventHandler)(SceUInt32 eventId);

typedef struct SceNotificationUtilProgressInitParam {
	SceWChar16 notificationText[0x273];
	SceInt16 separator0;                                     // must be 0
	SceNotificationUtilProgressEventHandler eventHandler;
	SceInt32 unk_4EC;                                        // can be set to 0
	SceWChar16 cancelDialogText[0x3E];
	SceInt16 separator1;                                     // must be 0
} SceNotificationUtilProgressInitParam;

typedef struct SceNotificationUtilProgressUpdateParam {
	SceWChar16 notificationText[0x7E];
	SceInt16 separator0;                  //must be 0
	SceFloat targetProgress;
	SceChar8 reserved[0x3C];
} SceNotificationUtilProgressUpdateParam;

typedef struct SceNotificationUtilProgressFinishParam {
	SceWChar16 notificationText[0x273];
	SceInt16 separator0; //must be 0
} SceNotificationUtilProgressFinishParam;

/**
 * Initialize notification util for use with BG application.
 *
 * Does not need to be called for normal applications.
 */
SceInt32 sceNotificationUtilBgAppInitialize(void);

/**
 * Send notification.
 *
 * Text buffer size must be 0x470.
 */
SceInt32 sceNotificationUtilSendNotification(const SceWChar16* text);

/**
 * Clean notifications for calling app from notification history.
 */
SceInt32 sceNotificationUtilCleanHistory(void);

/**
 * Start BGDL-type notification.
 */
SceInt32 sceNotificationUtilProgressBegin(SceNotificationUtilProgressInitParam* initParam);

/**
 * Update BGDL-type notification.
 */
SceInt32 sceNotificationUtilProgressUpdate(SceNotificationUtilProgressUpdateParam* updateParam);

/**
 * Finish BGDL-type notification.
 */
SceInt32 sceNotificationUtilProgressFinish(SceNotificationUtilProgressFinishParam* finishParam);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* _DOLCESDK_PSP2_NOTIFICATION_UTIL_H_ */