~midori/midori/gtk3WebKit2only

« back to all changes in this revision

Viewing changes to src/xbel.h

  • Committer: Christian Dywan
  • Date: 2007-12-16 22:20:24 UTC
  • Revision ID: git-v1:3bbd273a4f9e85a1d8380cb0924c875683fa3ad1
Tags: v0.0.14
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 Copyright (C) 2007 Christian Dywan <christian@twotoasts.de>
 
3
 
 
4
 This library is free software; you can redistribute it and/or
 
5
 modify it under the terms of the GNU Lesser General Public
 
6
 License as published by the Free Software Foundation; either
 
7
 version 2.1 of the License, or (at your option) any later version.
 
8
 
 
9
 See the file COPYING for the full license text.
 
10
*/
 
11
 
 
12
#ifndef __XBEL_H__
 
13
#define __XBEL_H__ 1
 
14
 
 
15
#include <glib.h>
 
16
#include <glib-object.h>
 
17
 
 
18
#define XBEL_ERROR g_quark_from_string("XBEL_ERROR")
 
19
 
 
20
typedef enum
 
21
{
 
22
    XBEL_ERROR_INVALID_URI,        /* Malformed uri */
 
23
    XBEL_ERROR_INVALID_VALUE,      /* Requested field not found */
 
24
    XBEL_ERROR_URI_NOT_FOUND,      /* Requested uri not found */
 
25
    XBEL_ERROR_READ,               /* Malformed document */
 
26
    XBEL_ERROR_UNKNOWN_ENCODING,   /* Parsed text was in an unknown encoding */
 
27
    XBEL_ERROR_WRITE,              /* Writing failed. */
 
28
} XBELError;
 
29
 
 
30
typedef enum
 
31
{
 
32
    XBEL_ITEM_FOLDER,
 
33
    XBEL_ITEM_BOOKMARK,
 
34
    XBEL_ITEM_SEPARATOR
 
35
} XbelItemKind;
 
36
 
 
37
// Note: This structure is entirely private.
 
38
typedef struct
 
39
{
 
40
    XbelItemKind kind;
 
41
    struct XbelItem* parent;
 
42
 
 
43
    GList* items; // folder
 
44
    gboolean folded; // foolder
 
45
    gchar* title;    // !separator
 
46
    gchar* desc;     // folder and bookmark
 
47
    gchar* href;     // bookmark
 
48
    //time_t added;    // !separator
 
49
    //time_t modfied;    // bookmark
 
50
    //time_t visited;    // bookmark
 
51
} XbelItem;
 
52
 
 
53
XbelItem*
 
54
xbel_bookmark_new(void);
 
55
 
 
56
XbelItem*
 
57
xbel_separator_new(void);
 
58
 
 
59
XbelItem*
 
60
xbel_folder_new(void);
 
61
 
 
62
void
 
63
xbel_item_free(XbelItem*);
 
64
 
 
65
XbelItem*
 
66
xbel_item_copy(XbelItem*);
 
67
 
 
68
GType
 
69
xbel_item_get_type();
 
70
 
 
71
#define G_TYPE_XBEL_ITEM xbel_item_get_type()
 
72
 
 
73
void
 
74
xbel_folder_append_item(XbelItem*, XbelItem*);
 
75
 
 
76
void
 
77
xbel_folder_prepend_item(XbelItem*, XbelItem*);
 
78
 
 
79
void
 
80
xbel_folder_remove_item(XbelItem*, XbelItem*);
 
81
 
 
82
guint
 
83
xbel_folder_get_n_items(XbelItem*);
 
84
 
 
85
XbelItem*
 
86
xbel_folder_get_nth_item(XbelItem*, guint);
 
87
 
 
88
gboolean
 
89
xbel_folder_is_empty(XbelItem*);
 
90
 
 
91
gboolean
 
92
xbel_folder_get_folded(XbelItem*);
 
93
 
 
94
XbelItemKind
 
95
xbel_item_get_kind(XbelItem*);
 
96
 
 
97
XbelItem*
 
98
xbel_item_get_parent(XbelItem*);
 
99
 
 
100
G_CONST_RETURN gchar*
 
101
xbel_item_get_title(XbelItem*);
 
102
 
 
103
G_CONST_RETURN gchar*
 
104
xbel_item_get_desc(XbelItem*);
 
105
 
 
106
G_CONST_RETURN gchar*
 
107
xbel_bookmark_get_href(XbelItem*);
 
108
 
 
109
/*time_t
 
110
xbel_bookmark_get_added(XbelItem*);
 
111
 
 
112
time_t
 
113
xbel_bookmark_get_modified(XbelItem*);
 
114
 
 
115
time_t
 
116
xbel_bookmark_get_visited(XbelItem*);*/
 
117
 
 
118
gboolean
 
119
xbel_item_is_bookmark(XbelItem*);
 
120
 
 
121
gboolean
 
122
xbel_item_is_separator(XbelItem*);
 
123
 
 
124
gboolean
 
125
xbel_item_is_folder(XbelItem*);
 
126
 
 
127
void
 
128
xbel_folder_set_folded(XbelItem*, gboolean);
 
129
 
 
130
void
 
131
xbel_item_set_title(XbelItem*, const gchar*);
 
132
 
 
133
void
 
134
xbel_item_set_desc(XbelItem*, const gchar*);
 
135
 
 
136
void
 
137
xbel_bookmark_set_href(XbelItem*, const gchar*);
 
138
 
 
139
gboolean
 
140
xbel_folder_from_data(XbelItem*, const gchar*, GError**);
 
141
 
 
142
gboolean
 
143
xbel_folder_from_file(XbelItem*, const gchar*, GError**);
 
144
 
 
145
gboolean
 
146
xbel_folder_from_data_dirs(XbelItem*, const gchar*, gchar**, GError**);
 
147
 
 
148
gchar*
 
149
xbel_folder_to_data(XbelItem*, gsize*, GError**);
 
150
 
 
151
gboolean
 
152
xbel_folder_to_file(XbelItem*, const gchar*, GError**);
 
153
 
 
154
#endif /* !__XBEL_H__ */