~midori/midori/fix-1094858

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
127
128
129
130
131
132
133
134
135
136
137
138
139
/*
 Copyright (C) 2008 Christian Dywan <christian@twotoasts.de>

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 See the file COPYING for the full license text.
*/

#ifndef __KATZE_ITEM_H__
#define __KATZE_ITEM_H__

#include <glib-object.h>

G_BEGIN_DECLS

#define KATZE_TYPE_ITEM \
    (katze_item_get_type ())
#define KATZE_ITEM(obj) \
    (G_TYPE_CHECK_INSTANCE_CAST ((obj), KATZE_TYPE_ITEM, KatzeItem))
#define KATZE_ITEM_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_CAST ((klass), KATZE_TYPE_ITEM, KatzeItemClass))
#define KATZE_IS_ITEM(obj) \
    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KATZE_TYPE_ITEM))
#define KATZE_IS_ITEM_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_TYPE ((klass), KATZE_TYPE_ITEM))
#define KATZE_ITEM_GET_CLASS(obj) \
    (G_TYPE_INSTANCE_GET_CLASS ((obj), KATZE_TYPE_ITEM, KatzeItemClass))

typedef struct _KatzeItem                KatzeItem;
typedef struct _KatzeItemClass           KatzeItemClass;

struct _KatzeItem
{
    GObject parent_instance;

    gchar* name;
    gchar* text;
    gchar* uri;
    gchar* icon;
    gchar* token;
    gint64 added;
    GHashTable* metadata;

    KatzeItem* parent;
};

struct _KatzeItemClass
{
    GObjectClass parent_class;

    gpointer
    (*copy)                       (KatzeItem*      item);
};

GType
katze_item_get_type               (void) G_GNUC_CONST;

KatzeItem*
katze_item_new                    (void);

const gchar*
katze_item_get_name               (KatzeItem*      item);

void
katze_item_set_name               (KatzeItem*      item,
                                   const gchar*    name);

const gchar*
katze_item_get_text               (KatzeItem*      item);

void
katze_item_set_text               (KatzeItem*      item,
                                   const gchar*    text);

const gchar*
katze_item_get_uri                (KatzeItem*      item);

void
katze_item_set_uri                (KatzeItem*      item,
                                   const gchar*    uri);

const gchar*
katze_item_get_icon               (KatzeItem*      item);

void
katze_item_set_icon               (KatzeItem*      item,
                                   const gchar*    icon);

const gchar*
katze_item_get_token              (KatzeItem*      item);

void
katze_item_set_token              (KatzeItem*      item,
                                   const gchar*    token);

gint64
katze_item_get_added              (KatzeItem*      item);

void
katze_item_set_added              (KatzeItem*      item,
                                   gint64          added);

GList*
katze_item_get_meta_keys          (KatzeItem*      item);

const gchar*
katze_item_get_meta_string        (KatzeItem*      item,
                                   const gchar*    key);

void
katze_item_set_meta_string        (KatzeItem*      item,
                                   const gchar*    key,
                                   const gchar*    value);

gint64
katze_item_get_meta_integer       (KatzeItem*      item,
                                   const gchar*    key);

void
katze_item_set_meta_integer       (KatzeItem*      item,
                                   const gchar*    key,
                                   gint64          value);

gpointer
katze_item_get_parent             (KatzeItem*      item);

void
katze_item_set_parent             (KatzeItem*      item,
                                   gpointer        parent);

KatzeItem*
katze_item_copy                   (KatzeItem*      item);

G_END_DECLS

#endif /* __MIDORI_WEB_ITEM_H__ */