2017-02-01 18:20:48 +01:00
|
|
|
#ifndef MDIARY_H
|
|
|
|
#define MDIARY_H
|
|
|
|
|
2017-02-04 13:37:56 +01:00
|
|
|
#include <glib.h>
|
|
|
|
#include <gtk/gtk.h>
|
2017-02-04 16:12:46 +01:00
|
|
|
#include <stdlib.h>
|
2017-02-04 13:37:56 +01:00
|
|
|
|
|
|
|
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 */
|
2017-02-04 17:01:09 +01:00
|
|
|
COL_SUMMARY, /* Summary of the entry */
|
2017-02-04 13:37:56 +01:00
|
|
|
COL_TEXT, /* Raw text from the file */
|
2017-02-19 12:50:28 +01:00
|
|
|
COL_URL, /* Path to the file */
|
2017-02-04 13:37:56 +01:00
|
|
|
COL_COUNT
|
|
|
|
};
|
|
|
|
|
2017-02-15 19:16:55 +01:00
|
|
|
struct mdiary_scanner {
|
|
|
|
gboolean gpg_enabled;
|
|
|
|
gint64 time_earliest;
|
|
|
|
gint64 time_latest;
|
|
|
|
gint entries_added;
|
|
|
|
gint entries_encrypted;
|
2017-02-15 19:38:04 +01:00
|
|
|
gint entries_failed;
|
2017-02-15 19:16:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct mdiary_scanner *mdiary_scanner_new(gboolean gpg_enabled);
|
2017-03-24 20:49:10 +01:00
|
|
|
void mdiary_scanner_free(struct mdiary_scanner *mdiary_scanner);
|
2017-02-15 19:16:55 +01:00
|
|
|
gint mdiary_scan_to_store(struct mdiary_scanner *mdiary_scanner,
|
|
|
|
gchar *base_dir,
|
|
|
|
GtkListStore *entryListStore, GtkListStore *autoCompletion);
|
2017-02-04 13:37:56 +01:00
|
|
|
void mdiary_add_entry_to_store(GtkListStore *entryListStore,
|
2017-02-05 18:45:54 +01:00
|
|
|
GtkListStore *autoCompletion,
|
2017-02-04 13:37:56 +01:00
|
|
|
gchar *title,
|
|
|
|
GDateTime *datetime,
|
|
|
|
GList *tags,
|
2017-02-04 17:01:09 +01:00
|
|
|
gchar *summary,
|
2017-02-19 12:50:28 +01:00
|
|
|
gchar *text,
|
|
|
|
gchar *file_url);
|
2017-02-04 16:12:46 +01:00
|
|
|
GDateTime *mdiary_get_date_from_string_ext(gchar *string, gchar *prefix, gchar *suffix);
|
|
|
|
GDateTime *mdiary_get_date_from_string(gchar *string);
|
2017-02-07 19:03:05 +01:00
|
|
|
void mdiary_reset_store(GtkListStore *entryListStore, GtkListStore *autoCompletion);
|
2017-02-04 16:12:46 +01:00
|
|
|
|
2017-02-01 18:20:48 +01:00
|
|
|
#endif /* MDIARY_H */
|