1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ |
---|
2 | |
---|
3 | /* |
---|
4 | * Nautilus |
---|
5 | * |
---|
6 | * Copyright (C) 1999, 2000 Red Hat, Inc. |
---|
7 | * Copyright (C) 1999, 2000, 2001 Eazel, Inc. |
---|
8 | * |
---|
9 | * Nautilus is free software; you can redistribute it and/or |
---|
10 | * modify it under the terms of the GNU General Public License as |
---|
11 | * published by the Free Software Foundation; either version 2 of the |
---|
12 | * License, or (at your option) any later version. |
---|
13 | * |
---|
14 | * Nautilus 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 | * General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with this program; if not, write to the Free Software |
---|
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
22 | * |
---|
23 | * Authors: Elliot Lee <sopwith@redhat.com> |
---|
24 | * Darin Adler <darin@bentspoon.com> |
---|
25 | * |
---|
26 | */ |
---|
27 | |
---|
28 | /* nautilus-view-frame.h: Interface of the object representing a data |
---|
29 | * view. This is actually the widget for the view frame rather than |
---|
30 | * the view frame itself. |
---|
31 | */ |
---|
32 | |
---|
33 | #ifndef NAUTILUS_VIEW_FRAME_H |
---|
34 | #define NAUTILUS_VIEW_FRAME_H |
---|
35 | |
---|
36 | #include <bonobo/bonobo-ui-container.h> |
---|
37 | #include <bonobo/bonobo-zoomable-frame.h> |
---|
38 | #include <eel/eel-generous-bin.h> |
---|
39 | #include <libnautilus-private/nautilus-undo-manager.h> |
---|
40 | #include <libnautilus/nautilus-view-component.h> |
---|
41 | |
---|
42 | #define NAUTILUS_TYPE_VIEW_FRAME (nautilus_view_frame_get_type ()) |
---|
43 | #define NAUTILUS_VIEW_FRAME(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_VIEW_FRAME, NautilusViewFrame)) |
---|
44 | #define NAUTILUS_VIEW_FRAME_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_VIEW_FRAME, NautilusViewFrameClass)) |
---|
45 | #define NAUTILUS_IS_VIEW_FRAME(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_VIEW_FRAME)) |
---|
46 | #define NAUTILUS_IS_VIEW_FRAME_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_VIEW_FRAME)) |
---|
47 | |
---|
48 | typedef struct NautilusViewFrameDetails NautilusViewFrameDetails; |
---|
49 | |
---|
50 | typedef struct { |
---|
51 | EelGenerousBin parent; |
---|
52 | NautilusViewFrameDetails *details; |
---|
53 | } NautilusViewFrame; |
---|
54 | |
---|
55 | typedef struct { |
---|
56 | EelGenerousBinClass parent_spot; |
---|
57 | |
---|
58 | /* These roughly correspond to CORBA calls, but in some cases they are higher level. */ |
---|
59 | |
---|
60 | /* This happens only just after load_view. */ |
---|
61 | void (* view_loaded) (NautilusViewFrame *view); |
---|
62 | |
---|
63 | /* These can happen pretty much any time. */ |
---|
64 | void (* load_underway) (NautilusViewFrame *view); |
---|
65 | void (* failed) (NautilusViewFrame *view); |
---|
66 | |
---|
67 | /* These will only happen after load_underway (guaranteed). */ |
---|
68 | void (* open_location_in_this_window) (NautilusViewFrame *view, |
---|
69 | const char *location); |
---|
70 | void (* open_location_prefer_existing_window) (NautilusViewFrame *view, |
---|
71 | const char *location); |
---|
72 | void (* open_location_force_new_window) (NautilusViewFrame *view, |
---|
73 | const char *location, |
---|
74 | GList *selection); /* list of char * */ |
---|
75 | void (* report_location_change) (NautilusViewFrame *view, |
---|
76 | const char *location, |
---|
77 | GList *selection, /* list of char * */ |
---|
78 | const char *title); |
---|
79 | void (* report_redirect) (NautilusViewFrame *view, |
---|
80 | const char *from_location, |
---|
81 | const char *to_location, |
---|
82 | GList *selection, /* list of char * */ |
---|
83 | const char *title); |
---|
84 | void (* change_selection) (NautilusViewFrame *view, |
---|
85 | GList *selection); /* list of char * */ |
---|
86 | void (* change_status) (NautilusViewFrame *view, |
---|
87 | const char *status); |
---|
88 | void (* load_progress_changed) (NautilusViewFrame *view); |
---|
89 | void (* load_complete) (NautilusViewFrame *view); |
---|
90 | void (* title_changed) (NautilusViewFrame *view); |
---|
91 | void (* zoom_level_changed) (NautilusViewFrame *view); |
---|
92 | void (* zoom_parameters_changed) (NautilusViewFrame *view); |
---|
93 | Nautilus_History * (* get_history_list) (NautilusViewFrame *view); |
---|
94 | void (* go_back) (NautilusViewFrame *view); |
---|
95 | void (* close_window) (NautilusViewFrame *view); |
---|
96 | } NautilusViewFrameClass; |
---|
97 | |
---|
98 | /* basic view management */ |
---|
99 | GtkType nautilus_view_frame_get_type (void); |
---|
100 | NautilusViewFrame *nautilus_view_frame_new (BonoboUIContainer *ui_container, |
---|
101 | NautilusUndoManager *undo_manager); |
---|
102 | Bonobo_Control nautilus_view_frame_get_control (NautilusViewFrame *view); |
---|
103 | |
---|
104 | /* connecting to a Nautilus:View */ |
---|
105 | void nautilus_view_frame_load_view (NautilusViewFrame *view, |
---|
106 | const char *view_iid); |
---|
107 | void nautilus_view_frame_stop (NautilusViewFrame *view); |
---|
108 | |
---|
109 | /* calls to Nautilus:View functions */ |
---|
110 | void nautilus_view_frame_load_location (NautilusViewFrame *view, |
---|
111 | const char *location); |
---|
112 | void nautilus_view_frame_selection_changed (NautilusViewFrame *view, |
---|
113 | GList *selection); |
---|
114 | void nautilus_view_frame_title_changed (NautilusViewFrame *view, |
---|
115 | const char *title); |
---|
116 | |
---|
117 | /* calls to Bonobo:Zoomable functions */ |
---|
118 | float nautilus_view_frame_get_zoom_level (NautilusViewFrame *view); |
---|
119 | void nautilus_view_frame_set_zoom_level (NautilusViewFrame *view, |
---|
120 | float zoom_level); |
---|
121 | float nautilus_view_frame_get_min_zoom_level (NautilusViewFrame *view); |
---|
122 | float nautilus_view_frame_get_max_zoom_level (NautilusViewFrame *view); |
---|
123 | gboolean nautilus_view_frame_get_has_min_zoom_level (NautilusViewFrame *view); |
---|
124 | gboolean nautilus_view_frame_get_has_max_zoom_level (NautilusViewFrame *view); |
---|
125 | gboolean nautilus_view_frame_get_is_continuous (NautilusViewFrame *view); |
---|
126 | GList * nautilus_view_frame_get_preferred_zoom_levels (NautilusViewFrame *view); |
---|
127 | void nautilus_view_frame_zoom_in (NautilusViewFrame *view); |
---|
128 | void nautilus_view_frame_zoom_out (NautilusViewFrame *view); |
---|
129 | void nautilus_view_frame_zoom_to_fit (NautilusViewFrame *view); |
---|
130 | |
---|
131 | /* Other. */ |
---|
132 | gboolean nautilus_view_frame_get_is_view_loaded (NautilusViewFrame *view); |
---|
133 | const char * nautilus_view_frame_get_view_iid (NautilusViewFrame *view); |
---|
134 | gboolean nautilus_view_frame_get_is_zoomable (NautilusViewFrame *view); |
---|
135 | char * nautilus_view_frame_get_title (NautilusViewFrame *view); |
---|
136 | char * nautilus_view_frame_get_label (NautilusViewFrame *view); |
---|
137 | void nautilus_view_frame_set_label (NautilusViewFrame *view, |
---|
138 | const char *label); |
---|
139 | |
---|
140 | #endif /* NAUTILUS_VIEW_FRAME_H */ |
---|