1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */ |
---|
2 | |
---|
3 | /* |
---|
4 | * libnautilus: A library for nautilus view implementations. |
---|
5 | * |
---|
6 | * Copyright (C) 1999, 2000 Red Hat, Inc. |
---|
7 | * Copyright (C) 2000 Eazel, Inc. |
---|
8 | * |
---|
9 | * This library is free software; you can redistribute it and/or |
---|
10 | * modify it under the terms of the GNU Library General Public |
---|
11 | * License as published by the Free Software Foundation; either |
---|
12 | * version 2 of the License, or (at your option) any later version. |
---|
13 | * |
---|
14 | * This library is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
17 | * Library General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU Library General Public |
---|
20 | * License along with this library; if not, write to the Free |
---|
21 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
22 | * |
---|
23 | * Authors: Elliot Lee <sopwith@redhat.com> |
---|
24 | * Maciej Stachowiak <mjs@eazel.com> |
---|
25 | * Darin Adler <darin@bentspoon.com> |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | #ifndef NAUTILUS_VIEW_H |
---|
30 | #define NAUTILUS_VIEW_H |
---|
31 | |
---|
32 | #include <libnautilus/nautilus-view-component.h> |
---|
33 | #include <bonobo/bonobo-control.h> |
---|
34 | |
---|
35 | G_BEGIN_DECLS |
---|
36 | |
---|
37 | #define NAUTILUS_TYPE_VIEW (nautilus_view_get_type ()) |
---|
38 | #define NAUTILUS_VIEW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_VIEW, NautilusView)) |
---|
39 | #define NAUTILUS_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_VIEW, NautilusViewClass)) |
---|
40 | #define NAUTILUS_IS_VIEW(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_VIEW)) |
---|
41 | #define NAUTILUS_IS_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_VIEW)) |
---|
42 | |
---|
43 | typedef struct NautilusViewDetails NautilusViewDetails; |
---|
44 | |
---|
45 | typedef struct { |
---|
46 | BonoboObject parent_spot; |
---|
47 | NautilusViewDetails *details; |
---|
48 | } NautilusView; |
---|
49 | |
---|
50 | typedef struct { |
---|
51 | BonoboObjectClass parent_spot; |
---|
52 | POA_Nautilus_View__epv epv; |
---|
53 | |
---|
54 | void (* load_location) (NautilusView *view, |
---|
55 | const char *location_uri); |
---|
56 | void (* stop_loading) (NautilusView *view); |
---|
57 | |
---|
58 | /* These signals need to be enabled with nautilus_view_set_listener_mask */ |
---|
59 | void (* title_changed) (NautilusView *view, |
---|
60 | const char *title); |
---|
61 | void (* history_changed) (NautilusView *view, |
---|
62 | const Nautilus_History *history); |
---|
63 | void (* selection_changed) (NautilusView *view, |
---|
64 | GList *selection); |
---|
65 | } NautilusViewClass; |
---|
66 | |
---|
67 | GtkType nautilus_view_get_type (void); |
---|
68 | NautilusView * nautilus_view_new (GtkWidget *widget); |
---|
69 | NautilusView * nautilus_view_new_from_bonobo_control (BonoboControl *bonobo_control); |
---|
70 | BonoboControl * nautilus_view_get_bonobo_control (NautilusView *view); |
---|
71 | |
---|
72 | /* Calls to the Nautilus shell via the view frame. See the IDL for detailed comments. */ |
---|
73 | void nautilus_view_open_location_in_this_window (NautilusView *view, |
---|
74 | const char *location_uri); |
---|
75 | void nautilus_view_open_location_prefer_existing_window (NautilusView *view, |
---|
76 | const char *location_uri); |
---|
77 | void nautilus_view_open_location_force_new_window (NautilusView *view, |
---|
78 | const char *location_uri, |
---|
79 | GList *selection); /* list of URI char *s */ |
---|
80 | void nautilus_view_report_location_change (NautilusView *view, |
---|
81 | const char *location_uri, |
---|
82 | GList *selection, /* list of URI char *s */ |
---|
83 | const char *title); |
---|
84 | void nautilus_view_report_redirect (NautilusView *view, |
---|
85 | const char *from_location_uri, |
---|
86 | const char *to_location_uri, |
---|
87 | GList *selection, /* list of URI char *s */ |
---|
88 | const char *title); |
---|
89 | void nautilus_view_report_selection_change (NautilusView *view, |
---|
90 | GList *selection); /* list of URI char *s */ |
---|
91 | void nautilus_view_report_status (NautilusView *view, |
---|
92 | const char *status); |
---|
93 | void nautilus_view_report_load_underway (NautilusView *view); |
---|
94 | void nautilus_view_report_load_progress (NautilusView *view, |
---|
95 | double fraction_done); |
---|
96 | void nautilus_view_report_load_complete (NautilusView *view); |
---|
97 | void nautilus_view_report_load_failed (NautilusView *view); |
---|
98 | void nautilus_view_set_title (NautilusView *view, |
---|
99 | const char *title); |
---|
100 | void nautilus_view_go_back (NautilusView *view); |
---|
101 | void nautilus_view_close_window (NautilusView *view); |
---|
102 | |
---|
103 | /* Some utility functions useful for doing the CORBA work directly. |
---|
104 | * Not needed by most components, but shared with the view frame code, |
---|
105 | * which is why they are public. |
---|
106 | */ |
---|
107 | Nautilus_URIList * nautilus_uri_list_from_g_list (GList *list); |
---|
108 | GList * nautilus_g_list_from_uri_list (const Nautilus_URIList *uri_list); |
---|
109 | |
---|
110 | /* Simpler API for setting up and getting the UI component. */ |
---|
111 | BonoboUIComponent *nautilus_view_set_up_ui (NautilusView *view, |
---|
112 | const char *datadir, |
---|
113 | const char *ui_xml_file_name, |
---|
114 | const char *application_name); |
---|
115 | |
---|
116 | |
---|
117 | typedef enum { |
---|
118 | NAUTILUS_VIEW_LISTEN_TITLE = 1<<0, |
---|
119 | NAUTILUS_VIEW_LISTEN_HISTORY = 1<<1, |
---|
120 | NAUTILUS_VIEW_LISTEN_SELECTION = 1<<2 |
---|
121 | } NautilusViewListenerMask; |
---|
122 | |
---|
123 | Bonobo_PropertyBag nautilus_view_get_ambient_properties (NautilusView *view, |
---|
124 | CORBA_Environment *opt_ev); |
---|
125 | void nautilus_view_set_listener_mask (NautilusView *view, |
---|
126 | NautilusViewListenerMask mask); |
---|
127 | |
---|
128 | /* `protected' functions for use by subclasses only. */ |
---|
129 | NautilusView * nautilus_view_construct (NautilusView *view, |
---|
130 | GtkWidget *widget); |
---|
131 | NautilusView * nautilus_view_construct_from_bonobo_control (NautilusView *view, |
---|
132 | BonoboControl *bonobo_control); |
---|
133 | |
---|
134 | G_END_DECLS |
---|
135 | |
---|
136 | #endif /* NAUTILUS_VIEW_H */ |
---|