zathura/bookmarks.h

65 lines
1.7 KiB
C
Raw Permalink Normal View History

2011-09-01 15:43:34 +02:00
/* See LICENSE file for license and copyright information */
#ifndef BOOKMARKS_H
#define BOOKMARKS_H
#include <stdbool.h>
#include "zathura.h"
struct zathura_bookmark_s
{
gchar* id;
unsigned int page;
};
typedef struct zathura_bookmark_s zathura_bookmark_t;
2011-09-02 12:04:05 +02:00
/**
* Create a bookmark and add it to the list of bookmarks.
* @param zathura The zathura instance.
* @param id The bookmark's id.
* @param page The bookmark's page.
* @return the bookmark instance or NULL on failure.
*/
2011-09-01 15:43:34 +02:00
zathura_bookmark_t* zathura_bookmark_add(zathura_t* zathura, const gchar* id, unsigned int page);
2011-09-02 12:04:05 +02:00
/**
* Remove a bookmark from the list of bookmarks.
* @param zathura The zathura instance.
* @param id The bookmark's id.
2011-09-03 13:40:28 +02:00
* @return true on success, false otherwise
2011-09-02 12:04:05 +02:00
*/
2011-09-03 13:40:28 +02:00
bool zathura_bookmark_remove(zathura_t* zathura, const gchar* id);
2011-09-01 15:43:34 +02:00
2011-09-02 12:04:05 +02:00
/**
* Get bookmark from the list of bookmarks.
* @param zathura The zathura instance.
* @param id The bookmark's id.
* @return The bookmark instance if it exists or NULL otherwise.
*/
2011-09-01 15:43:34 +02:00
zathura_bookmark_t* zathura_bookmark_get(zathura_t* zathura, const gchar* id);
2011-09-02 12:04:05 +02:00
/**
* Free a bookmark instance.
* @param bookmark The bookmark instance.
*/
2011-09-01 15:43:34 +02:00
void zathura_bookmark_free(zathura_bookmark_t* bookmark);
2011-09-02 12:04:05 +02:00
/**
* Load bookmarks for a specific file.
* @param zathura The zathura instance.
* @param file The file.
2012-02-08 15:30:13 +01:00
* @return true on success, false otherwise
2011-09-02 12:04:05 +02:00
*/
2011-09-01 15:43:34 +02:00
bool zathura_bookmarks_load(zathura_t* zathura, const gchar* file);
2011-10-15 18:42:30 +02:00
/**
* Compare two bookmarks.
* @param lhs a bookmark
* @param rhs a bookmark
* @returns g_strcmp0(lhs->id, rhs->id)
*/
int zathura_bookmarks_compare(zathura_bookmark_t* lhs, zathura_bookmark_t* rhs);
2011-09-01 15:43:34 +02:00
#endif // BOOKMARKS_H