Tizen Native API  8.0

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 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]dstThe destination handle to the book metadata
[in]srcThe source handle to the book metadata
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
See also:
media_info_get_book()
book_meta_destroy()

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]bookThe handle to the book metadata
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid 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]bookThe handle to the book metadata
[out]authorThe author of the book metadata
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid 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]bookThe handle to the book metadata
[out]dateThe date of the book metadata
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid 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]bookThe handle to the book metadata
[out]media_idThe media ID
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid 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]keywordKeyword to search for
[out]path_listA list of paths to books containing keyword
[out]lenLength of path_list
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_PERMISSION_DENIEDPermission denied
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_DB_FAILEDDB Operation failed
MEDIA_CONTENT_ERROR_DB_BUSYDB Operation busy
See also:
media_info_get_media_from_db_by_path()
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]bookThe handle to the book metadata
[out]publisherThe publisher of the book metadata
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid 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]bookThe handle to the book metadata
[out]subjectThe subject of the book metadata
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter