1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * Copyright (C) 2010 Shaun McCance <shaunm@gnome.org>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public
16 * License along with this program; if not, see <http://www.gnu.org/licenses/>.
18 * Author: Shaun McCance <shaunm@gnome.org>
21 #include "yelp-bookmarks.h"
27 static gint signals
[LAST_SIGNAL
] = { 0 };
29 G_DEFINE_INTERFACE (YelpBookmarks
, yelp_bookmarks
, G_TYPE_OBJECT
)
32 yelp_bookmarks_default_init (YelpBookmarksInterface
*iface
)
34 signals
[BOOKMARKS_CHANGED
] =
35 g_signal_new ("bookmarks-changed",
36 G_TYPE_FROM_INTERFACE (iface
),
39 g_cclosure_marshal_VOID__STRING
,
40 G_TYPE_NONE
, 1, G_TYPE_STRING
);
44 yelp_bookmarks_add_bookmark (YelpBookmarks
*bookmarks
,
50 YelpBookmarksInterface
*iface
;
52 g_return_if_fail (YELP_IS_BOOKMARKS (bookmarks
));
54 iface
= YELP_BOOKMARKS_GET_INTERFACE (bookmarks
);
56 if (iface
->add_bookmark
)
57 (* iface
->add_bookmark
) (bookmarks
,
63 yelp_bookmarks_remove_bookmark (YelpBookmarks
*bookmarks
,
67 YelpBookmarksInterface
*iface
;
69 g_return_if_fail (YELP_IS_BOOKMARKS (bookmarks
));
71 iface
= YELP_BOOKMARKS_GET_INTERFACE (bookmarks
);
73 if (iface
->remove_bookmark
)
74 (* iface
->remove_bookmark
) (bookmarks
, doc_uri
, page_id
);
78 yelp_bookmarks_is_bookmarked (YelpBookmarks
*bookmarks
,
82 YelpBookmarksInterface
*iface
;
84 g_return_val_if_fail (YELP_IS_BOOKMARKS (bookmarks
), FALSE
);
86 iface
= YELP_BOOKMARKS_GET_INTERFACE (bookmarks
);
88 if (iface
->is_bookmarked
)
89 return (* iface
->is_bookmarked
) (bookmarks
, doc_uri
, page_id
);