mdiary/src/mdiary.h

51 lines
1.5 KiB
C
Raw Permalink Normal View History

#ifndef MDIARY_H
#define MDIARY_H
#include <glib.h>
#include <gtk/gtk.h>
2017-02-04 16:12:46 +01:00
#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 */
2017-02-04 17:01:09 +01:00
COL_SUMMARY, /* Summary of the entry */
COL_TEXT, /* Raw text from the file */
2017-02-19 12:50:28 +01:00
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);
2017-03-24 20:49:10 +01:00
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,
2017-02-05 18:45:54 +01:00
GtkListStore *autoCompletion,
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
#endif /* MDIARY_H */