1 /*
2  *  nemo-location-widget-provider.c - Interface for Nemo
3                  extensions that provide extra widgets for a location
4  *
5  *  Copyright (C) 2005 Red Hat, Inc.
6  *
7  *  This library is free software; you can redistribute it and/or
8  *  modify it under the terms of the GNU Library General Public
9  *  License as published by the Free Software Foundation; either
10  *  version 2 of the License, or (at your option) any later version.
11  *
12  *  This library is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  *  Library General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Library General Public
18  *  License along with this library; if not, write to the Free
19  *  Software Foundation, Inc., 51 Franklin Street, Suite 500, MA 02110-1335, USA.
20  *
21  *  Author:  Alexander Larsson <alexl@redhat.com>
22  *
23  */
24 
25 #include <config.h>
26 #include "nemo-location-widget-provider.h"
27 
28 #include <glib-object.h>
29 
30 
G_DEFINE_INTERFACE(NemoLocationWidgetProvider,nemo_location_widget_provider,G_TYPE_OBJECT)31 G_DEFINE_INTERFACE (NemoLocationWidgetProvider, nemo_location_widget_provider, G_TYPE_OBJECT)
32 
33 /**
34  * SECTION:nemo-location-widget-provider
35  * @Title: NemoLocationWidgetProvider
36  * @Short_description: Allows a custom widget to be added to a Nemo view.
37 
38  * This is an interface to allow the provision of a custom location widget
39  * embedded at the top of the Nemo view.  It receives the current location, and
40  * can then determine whether or not the location is appropriate for a widget, and
41  * its contents.
42  *
43  * Be aware that this extension is queried for a new widget any time a view loads a
44  * new location, or reloads the current one.
45  **/
46 
47 static void
48 nemo_location_widget_provider_default_init (NemoLocationWidgetProviderInterface *klass)
49 {
50 }
51 
52 /**
53  * nemo_location_widget_provider_get_widget:
54  * @provider: a #NemoLocationWidgetProvider
55  * @uri: the URI of the location
56  * @window: parent #GtkWindow
57  *
58  * Returns: (transfer none): the location widget for @provider at @uri
59  */
60 GtkWidget *
nemo_location_widget_provider_get_widget(NemoLocationWidgetProvider * provider,const char * uri,GtkWidget * window)61 nemo_location_widget_provider_get_widget (NemoLocationWidgetProvider     *provider,
62 					      const char                         *uri,
63 					      GtkWidget                          *window)
64 {
65 	g_return_val_if_fail (NEMO_IS_LOCATION_WIDGET_PROVIDER (provider), NULL);
66 
67 	return NEMO_LOCATION_WIDGET_PROVIDER_GET_IFACE (provider)->get_widget
68 		(provider, uri, window);
69 
70 }
71