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

  title | UTF-16 title of the notification.
  titleLength | Number of characters in the title, not including the null-terminator.
  message | UTF-16 message of the notification, or NULL for no message.
  messageLength | Number of characters in the message, not including the null-terminator.
  image | Data of the image to show in the notification, or NULL for no image.
  imageSize | Size of the image data in bytes.
  jpeg | Whether 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_id | Identification number of the notification.
  header | Pointer 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_id | Identification number of the notification.
  buffer | Pointer where MPO image of the notification will be saved.
  size | Pointer 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_id | Identification number of the notification.
  message | Pointer where UTF-16 message of the notification will be saved.
  size | Pointer where size of the message data will be saved in bytes.

## NEWS_GetTotalNotifications()

Result NEWS_GetTotalNotifications | ( | u32 * | num | ) |

Gets current total notifications number.

Parameters

  num | Pointer 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_id | Identification number of the notification.
  header | Pointer 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_id | Identification number of the notification.
  buffer | Pointer to MPO image to set.
  size | Size 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_id | Identification number of the notification.
  message | Pointer to UTF-16 message to set.
  size | Size of message to set.