libctru  v2.4.1
Data Structures | Functions
news.h File Reference

NEWS (Notification) service. More...

Go to the source code of this file.

Data Structures

struct  NotificationHeader
 Notification header data. More...
 

Functions

Result newsInit (void)
 Initializes NEWS.
 
void newsExit (void)
 Exits NEWS.
 
Result NEWS_AddNotification (const u16 *title, u32 titleLength, const u16 *message, u32 messageLength, const void *imageData, u32 imageSize, bool jpeg)
 Adds a notification to the home menu Notifications applet. More...
 
Result NEWS_GetTotalNotifications (u32 *num)
 Gets current total notifications number. More...
 
Result NEWS_SetNotificationHeader (u32 news_id, const NotificationHeader *header)
 Sets a custom header for a specific notification. More...
 
Result NEWS_GetNotificationHeader (u32 news_id, NotificationHeader *header)
 Gets the header of a specific notification. More...
 
Result NEWS_SetNotificationMessage (u32 news_id, const u16 *message, u32 size)
 Sets a custom message for a specific notification. More...
 
Result NEWS_GetNotificationMessage (u32 news_id, u16 *message, u32 *size)
 Gets the message of a specific notification. More...
 
Result NEWS_SetNotificationImage (u32 news_id, const void *buffer, u32 size)
 Sets a custom image for a specific notification. More...
 
Result NEWS_GetNotificationImage (u32 news_id, void *buffer, u32 *size)
 Gets the image of a specific notification. More...
 

Detailed Description

NEWS (Notification) service.

Function Documentation

◆ NEWS_AddNotification()

Result NEWS_AddNotification ( const u16 title,
u32  titleLength,
const u16 message,
u32  messageLength,
const void *  imageData,
u32  imageSize,
bool  jpeg 
)

Adds a notification to the home menu Notifications applet.

Parameters
titleUTF-16 title of the notification.
titleLengthNumber of characters in the title, not including the null-terminator.
messageUTF-16 message of the notification, or NULL for no message.
messageLengthNumber of characters in the message, not including the null-terminator.
imageData of the image to show in the notification, or NULL for no image.
imageSizeSize of the image data in bytes.
jpegWhether the image is a JPEG or not.

◆ NEWS_GetNotificationHeader()

Result NEWS_GetNotificationHeader ( u32  news_id,
NotificationHeader header 
)

Gets the header of a specific notification.

Parameters
news_idIdentification number of the notification.
headerPointer where header of the notification will be saved.

◆ NEWS_GetNotificationImage()

Result NEWS_GetNotificationImage ( u32  news_id,
void *  buffer,
u32 size 
)

Gets the image of a specific notification.

Parameters
news_idIdentification number of the notification.
bufferPointer where MPO image of the notification will be saved.
sizePointer where size of the image data will be saved in bytes.

◆ NEWS_GetNotificationMessage()

Result NEWS_GetNotificationMessage ( u32  news_id,
u16 message,
u32 size 
)

Gets the message of a specific notification.

Parameters
news_idIdentification number of the notification.
messagePointer where UTF-16 message of the notification will be saved.
sizePointer where size of the message data will be saved in bytes.

◆ NEWS_GetTotalNotifications()

Result NEWS_GetTotalNotifications ( u32 num)

Gets current total notifications number.

Parameters
numPointer where total number will be saved.

◆ NEWS_SetNotificationHeader()

Result NEWS_SetNotificationHeader ( u32  news_id,
const NotificationHeader header 
)

Sets a custom header for a specific notification.

Parameters
news_idIdentification number of the notification.
headerPointer to notification header to set.

◆ NEWS_SetNotificationImage()

Result NEWS_SetNotificationImage ( u32  news_id,
const void *  buffer,
u32  size 
)

Sets a custom image for a specific notification.

Parameters
news_idIdentification number of the notification.
bufferPointer to MPO image to set.
sizeSize of the MPO image to set.

◆ NEWS_SetNotificationMessage()

Result NEWS_SetNotificationMessage ( u32  news_id,
const u16 message,
u32  size 
)

Sets a custom message for a specific notification.

Parameters
news_idIdentification number of the notification.
messagePointer to UTF-16 message to set.
sizeSize of message to set.