mdiary/src/mdiary.h

51 lines
1.5 KiB
C

#ifndef MDIARY_H
#define MDIARY_H
#include <glib.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#define MDS_ERROR_BASE_DIR 1
#define MDS_ERROR_GPG 2
enum {
COL_TITLE = 0, /* Title of the entry */
COL_DATE_TEXT, /* Textual representation of the date (auto generated) */
COL_TAGS_TEXT, /* Textual representation of the tags (auto generated) */
COL_TIMESTAMP, /* GDateTime of the entry */
COL_TAGLIST, /* GList<gchar *> of the tags */
COL_SUMMARY, /* Summary of the entry */
COL_TEXT, /* Raw text from the file */
COL_URL, /* Path to the file */
COL_COUNT
};
struct mdiary_scanner {
gboolean gpg_enabled;
gint64 time_earliest;
gint64 time_latest;
gint entries_added;
gint entries_encrypted;
gint entries_failed;
gint error_code;
};
struct mdiary_scanner *mdiary_scanner_new(gboolean gpg_enabled);
void mdiary_scanner_free(struct mdiary_scanner *mdiary_scanner);
gint mdiary_scan_to_store(struct mdiary_scanner *mdiary_scanner,
gchar *base_dir,
GtkListStore *entryListStore, GtkListStore *autoCompletion);
void mdiary_add_entry_to_store(GtkListStore *entryListStore,
GtkListStore *autoCompletion,
gchar *title,
GDateTime *datetime,
GList *tags,
gchar *summary,
gchar *text,
gchar *file_url);
GDateTime *mdiary_get_date_from_string_ext(gchar *string, gchar *prefix, gchar *suffix);
GDateTime *mdiary_get_date_from_string(gchar *string);
void mdiary_reset_store(GtkListStore *entryListStore, GtkListStore *autoCompletion);
#endif /* MDIARY_H */