summaryrefslogtreecommitdiff
path: root/include/user/notification_util.h
blob: 065606ba23da1e86440b8090405d5db090d97c0e (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
	Vita Development Suite Libraries
*/

#ifndef _VDSUITE_USER_NOTIFICATION_UTIL_H
#define _VDSUITE_USER_NOTIFICATION_UTIL_H

#include <scetypes.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Errors
 */
#define SCE_NOTIFICATION_UTIL_ERROR_INTERNAL               (-2146409727) /* 0x80106301 */

/**
 * Constants
 */
#define SCE_NOTIFICATION_UTIL_TEXT_MAX                     (0x3F)

/**
 * Callback for when a BGDL-type notification is cancelled through the notification tray
 */
typedef void (*SceNotificationUtilCancelCallback)(void *userData);

/**
 * Structs
 */
typedef struct SceNotificationUtilSendParam {
	SceWChar16 text[SCE_NOTIFICATION_UTIL_TEXT_MAX+1];       // must be null-terminated
	char unk_80[0x3E8];
	SceInt32 unk_468;                                        // must be set to 0
	SceInt32 unk_46C;                                        // must be set to 0
} SceNotificationUtilSendParam;

typedef struct SceNotificationUtilProgressInitParam {
	SceWChar16 text[SCE_NOTIFICATION_UTIL_TEXT_MAX+1];       // must be null-terminated
	SceWChar16 subText[SCE_NOTIFICATION_UTIL_TEXT_MAX+1];    // must be null-terminated
	char unk_100[0x3E8];
	SceNotificationUtilCancelCallback cancelCallback;
	void *userData;                                          // optional data for the callback
	SceWChar16 cancelText[SCE_NOTIFICATION_UTIL_TEXT_MAX+1]; // must be null-terminated
} SceNotificationUtilProgressInitParam;

typedef struct SceNotificationUtilProgressUpdateParam {
	SceWChar16 text[SCE_NOTIFICATION_UTIL_TEXT_MAX+1];       // must be null-terminated
	SceWChar16 subText[SCE_NOTIFICATION_UTIL_TEXT_MAX+1];    // must be null-terminated
	SceFloat progress;                                       // from 0.0 to 100.0
} SceNotificationUtilProgressUpdateParam;

typedef struct SceNotificationUtilProgressFinishParam {
	SceWChar16 text[SCE_NOTIFICATION_UTIL_TEXT_MAX+1];       // must be null-terminated
	SceWChar16 subText[SCE_NOTIFICATION_UTIL_TEXT_MAX+1];    // must be null-terminated
	char unk_100[0x3E8];
} SceNotificationUtilProgressFinishParam;

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

/**
 * Send notification.
 */
SceInt32 sceNotificationUtilSendNotification(const SceNotificationUtilSendParam* sendParam);

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

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

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

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

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* _VDSUITE_USER_NOTIFICATION_UTIL_H */