1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/*
* Copyright © 2011 Igalia S.L.
*
* This file is part of Epiphany.
*
* Epiphany is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Epiphany is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Epiphany. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <glib.h>
G_BEGIN_DECLS
typedef enum {
EPHY_PAGE_VISIT_NONE = 0,
EPHY_PAGE_VISIT_LINK,
EPHY_PAGE_VISIT_TYPED,
/* We jump to 8 to avoid changing the visits table format. */
EPHY_PAGE_VISIT_BOOKMARK = 8,
EPHY_PAGE_VISIT_HOMEPAGE
} EphyHistoryPageVisitType;
typedef enum {
EPHY_HISTORY_URL_TITLE,
} EphyHistoryURLProperty;
typedef enum {
EPHY_HISTORY_SORT_NONE = 0,
EPHY_HISTORY_SORT_MOST_RECENTLY_VISITED,
EPHY_HISTORY_SORT_LEAST_RECENTLY_VISITED,
EPHY_HISTORY_SORT_MOST_VISITED,
EPHY_HISTORY_SORT_LEAST_VISITED,
EPHY_HISTORY_SORT_TITLE_ASCENDING,
EPHY_HISTORY_SORT_TITLE_DESCENDING,
EPHY_HISTORY_SORT_URL_ASCENDING,
EPHY_HISTORY_SORT_URL_DESCENDING
} EphyHistorySortType;
typedef struct
{
int id;
char* url;
char* title;
int visit_count;
double zoom_level;
} EphyHistoryHost;
typedef struct _EphyHistoryURL
{
int id;
char* url;
char* title;
char *sync_id;
int visit_count;
int typed_count;
gint64 last_visit_time; /* Microseconds */
gboolean hidden;
EphyHistoryHost *host;
gboolean notify_visit;
gboolean notify_delete;
} EphyHistoryURL;
typedef struct _EphyHistoryPageVisit
{
EphyHistoryURL* url;
int id;
gint64 visit_time; /* Microseconds */
EphyHistoryPageVisitType visit_type;
} EphyHistoryPageVisit;
typedef struct _EphyHistoryQuery
{
gint64 from; /* Microseconds */
gint64 to; /* Microseconds */
guint limit;
GList* substring_list;
gboolean ignore_hidden;
gboolean ignore_local;
gint host;
EphyHistorySortType sort_type;
} EphyHistoryQuery;
EphyHistoryPageVisit * ephy_history_page_visit_new (const char *url, gint64 visit_time, EphyHistoryPageVisitType visit_type);
EphyHistoryPageVisit * ephy_history_page_visit_new_with_url (EphyHistoryURL *url, gint64 visit_time, EphyHistoryPageVisitType visit_type);
EphyHistoryPageVisit * ephy_history_page_visit_copy (EphyHistoryPageVisit *visit);
void ephy_history_page_visit_free (EphyHistoryPageVisit *visit);
GList * ephy_history_page_visit_list_copy (GList* original);
void ephy_history_page_visit_list_free (GList* list);
EphyHistoryHost * ephy_history_host_new (const char *url, const char *title, int visit_count, double zoom_level);
EphyHistoryHost * ephy_history_host_copy (EphyHistoryHost *original);
void ephy_history_host_free (EphyHistoryHost *host);
void ephy_history_host_list_free (GList *list);
EphyHistoryURL * ephy_history_url_new (const char *url, const char *title, int visit_count, int typed_count, gint64 last_visit_time);
EphyHistoryURL * ephy_history_url_copy (EphyHistoryURL *url);
void ephy_history_url_free (EphyHistoryURL *url);
GList * ephy_history_url_list_copy (GList *original);
void ephy_history_url_list_free (GList *list);
EphyHistoryQuery * ephy_history_query_new (void);
void ephy_history_query_free (EphyHistoryQuery *query);
EphyHistoryQuery * ephy_history_query_copy (EphyHistoryQuery *query);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(EphyHistoryHost, ephy_history_host_free)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(EphyHistoryURL, ephy_history_url_free)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(EphyHistoryPageVisit, ephy_history_page_visit_free)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(EphyHistoryQuery, ephy_history_query_free)
G_END_DECLS
|