Tizen Native API
6.5
|
The Book Metadata API provides functions to get information about ebook files present in the device.
Required Header
#include <media_content.h>
Overview
The Book Metadata API provides functions to get information about book files present in the device. Following information about book content (book_meta_h) is provided:
Attribute | Filter Keyword | Comments |
---|---|---|
subject | MEDIA_GENRE | Get from metadata if exist. |
author | MEDIA_COMPOSER | Get from metadata if exist. |
date | MEDIA_RECORDED_DATE | Get from metadata if exist. |
publisher | MEDIA_COPYRIGHT | Get from metadata if exist. |
For getting the book handle (book_meta_h) from the media information (media_info_h), call the media_info_get_book() function.
For getting the information related to book files stored in the device call the respective get functions e.g. to get author of the ebook file call book_meta_get_author() function and so on.
When the book handle is no longer needed, it should be destroyed by calling book_meta_destroy() function.
Functions | |
int | book_meta_clone (book_meta_h *dst, book_meta_h src) |
Clones the book metadata. | |
int | book_meta_destroy (book_meta_h book) |
Destroys the book metadata. | |
int | book_meta_get_media_id (book_meta_h book, char **media_id) |
Gets the ID of the media of the given book metadata. | |
int | book_meta_get_subject (book_meta_h book, char **subject) |
Gets the subject of the given book metadata. | |
int | book_meta_get_author (book_meta_h book, char **author) |
Gets the author of the given book metadata. | |
int | book_meta_get_date (book_meta_h book, char **date) |
Gets the publication date of the given book metadata. | |
int | book_meta_get_publisher (book_meta_h book, char **publisher) |
Gets the publisher notice of the given book metadata. | |
int | book_meta_get_path_with_keyword (const char *keyword, char ***path_list, unsigned int *len) |
Gets a list of paths to ebooks which contain a given keyword. | |
Typedefs | |
typedef struct book_meta_s * | book_meta_h |
The structure type for the Book metadata handle. |
Typedef Documentation
typedef struct book_meta_s* book_meta_h |
The structure type for the Book metadata handle.
- Since :
- 6.5
Function Documentation
int book_meta_clone | ( | book_meta_h * | dst, |
book_meta_h | src | ||
) |
Clones the book metadata.
This function copies the book metadata handle from a source to destination.
- Since :
- 6.5
- Remarks:
- The dst should be released using book_meta_destroy().
- Parameters:
-
[out] dst The destination handle to the book metadata [in] src The source handle to the book metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- media_info_get_book()
- book_meta_destroy()
int book_meta_destroy | ( | book_meta_h | book | ) |
Destroys the book metadata.
This function frees all resources related to the book metadata handle. This handle can no longer be used to perform any operations. A new handle has to be created before the next use.
- Since :
- 6.5
- Parameters:
-
[in] book The handle to the book metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- book_meta_clone()
int book_meta_get_author | ( | book_meta_h | book, |
char ** | author | ||
) |
Gets the author of the given book metadata.
If there is no information, author will be NULL.
- Since :
- 6.5
- Remarks:
- The author should be released using free().
- Parameters:
-
[in] book The handle to the book metadata [out] author The author of the book metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int book_meta_get_date | ( | book_meta_h | book, |
char ** | date | ||
) |
Gets the publication date of the given book metadata.
If there is no information, date will be NULL.
- Since :
- 6.5
- Remarks:
- The date should be released using free().
- Parameters:
-
[in] book The handle to the book metadata [out] date The date of the book metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int book_meta_get_media_id | ( | book_meta_h | book, |
char ** | media_id | ||
) |
Gets the ID of the media of the given book metadata.
- Since :
- 6.5
- Remarks:
- The media_id should be released using free().
- Parameters:
-
[in] book The handle to the book metadata [out] media_id The media ID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int book_meta_get_path_with_keyword | ( | const char * | keyword, |
char *** | path_list, | ||
unsigned int * | len | ||
) |
Gets a list of paths to ebooks which contain a given keyword.
This function returns a list of ebook paths including keyword.
The search scope is title, table of contents, and body.
If there are no ebooks matching the criteria, path_list will be NULL.
- Since :
- 6.5
- Remarks:
- Each element of path_list should be released with free(), then the array itself should be released with free().
http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.
http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage.
- Parameters:
-
[in] keyword Keyword to search for [out] path_list A list of paths to books containing keyword [out] len Length of path_list
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
int book_meta_get_publisher | ( | book_meta_h | book, |
char ** | publisher | ||
) |
Gets the publisher notice of the given book metadata.
If there is no information, publisher will be NULL.
- Since :
- 6.5
- Remarks:
- The publisher should be released using free().
- Parameters:
-
[in] book The handle to the book metadata [out] publisher The publisher of the book metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int book_meta_get_subject | ( | book_meta_h | book, |
char ** | subject | ||
) |
Gets the subject of the given book metadata.
If there is no information, subject will be NULL.
- Since :
- 6.5
- Remarks:
- The subject should be released using free().
- Parameters:
-
[in] book The handle to the book metadata [out] subject The subject of the book metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter