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, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: Shaun McCance <shaunm@gnome.org>
23 #include "yelp-bookmarks.h"
29 static gint signals
[LAST_SIGNAL
] = { 0 };
31 G_DEFINE_INTERFACE (YelpBookmarks
, yelp_bookmarks
, G_TYPE_OBJECT
)
34 yelp_bookmarks_default_init (YelpBookmarksInterface
*iface
)
36 signals
[BOOKMARKS_CHANGED
] =
37 g_signal_new ("bookmarks-changed",
38 G_TYPE_FROM_INTERFACE (iface
),
41 g_cclosure_marshal_VOID__STRING
,
42 G_TYPE_NONE
, 1, G_TYPE_STRING
);
46 yelp_bookmarks_add_bookmark (YelpBookmarks
*bookmarks
,
52 YelpBookmarksInterface
*iface
;
54 g_return_if_fail (YELP_IS_BOOKMARKS (bookmarks
));
56 iface
= YELP_BOOKMARKS_GET_INTERFACE (bookmarks
);
58 if (iface
->add_bookmark
)
59 (* iface
->add_bookmark
) (bookmarks
,
65 yelp_bookmarks_remove_bookmark (YelpBookmarks
*bookmarks
,
69 YelpBookmarksInterface
*iface
;
71 g_return_if_fail (YELP_IS_BOOKMARKS (bookmarks
));
73 iface
= YELP_BOOKMARKS_GET_INTERFACE (bookmarks
);
75 if (iface
->remove_bookmark
)
76 (* iface
->remove_bookmark
) (bookmarks
, doc_uri
, page_id
);
80 yelp_bookmarks_is_bookmarked (YelpBookmarks
*bookmarks
,
84 YelpBookmarksInterface
*iface
;
86 g_return_if_fail (YELP_IS_BOOKMARKS (bookmarks
));
88 iface
= YELP_BOOKMARKS_GET_INTERFACE (bookmarks
);
90 if (iface
->is_bookmarked
)
91 return (* iface
->is_bookmarked
) (bookmarks
, doc_uri
, page_id
);