2007-12-11 A. Walton <awalton@svn.gnome.org>
[nautilus.git] / libnautilus-private / nautilus-window-info.h
blobff05e73c0388c1e1ba498500e09676effec1fe87
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
3 nautilus-window-info.h: Interface for nautilus windows
5 Copyright (C) 2004 Red Hat Inc.
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
12 This program 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 General Public License for more details.
17 You should have received a copy of the GNU General Public
18 License along with this program; if not, write to the
19 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
22 Author: Alexander Larsson <alexl@redhat.com>
25 #ifndef NAUTILUS_WINDOW_INFO_H
26 #define NAUTILUS_WINDOW_INFO_H
28 #include <glib-object.h>
29 #include <libnautilus-private/nautilus-view.h>
30 #include <gtk/gtkuimanager.h>
31 #include "../src/nautilus-bookmark-list.h"
33 G_BEGIN_DECLS
35 typedef enum
37 NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_DEFAULT,
38 NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_ENABLE,
39 NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_DISABLE
40 } NautilusWindowShowHiddenFilesMode;
43 typedef enum {
44 NAUTILUS_WINDOW_OPEN_ACCORDING_TO_MODE,
45 NAUTILUS_WINDOW_OPEN_IN_SPATIAL,
46 NAUTILUS_WINDOW_OPEN_IN_NAVIGATION
47 } NautilusWindowOpenMode;
49 typedef enum {
50 /* used in spatial mode */
51 NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND = 1<<0,
52 /* used in navigation mode */
53 NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW = 1<<1
54 } NautilusWindowOpenFlags;
56 typedef enum {
57 NAUTILUS_WINDOW_SPATIAL,
58 NAUTILUS_WINDOW_NAVIGATION,
59 NAUTILUS_WINDOW_DESKTOP
60 } NautilusWindowType;
62 #define NAUTILUS_TYPE_WINDOW_INFO (nautilus_window_info_get_type ())
63 #define NAUTILUS_WINDOW_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_WINDOW_INFO, NautilusWindowInfo))
64 #define NAUTILUS_IS_WINDOW_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_WINDOW_INFO))
65 #define NAUTILUS_WINDOW_INFO_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NAUTILUS_TYPE_WINDOW_INFO, NautilusWindowInfoIface))
67 #ifndef NAUTILUS_WINDOW_DEFINED
68 #define NAUTILUS_WINDOW_DEFINED
69 /* Using NautilusWindow for the vtable to make implementing this in
70 * NautilusWindow easier */
71 typedef struct NautilusWindow NautilusWindow;
72 #endif
74 typedef NautilusWindow NautilusWindowInfo;
76 typedef struct _NautilusWindowInfoIface NautilusWindowInfoIface;
78 struct _NautilusWindowInfoIface
80 GTypeInterface g_iface;
82 /* signals: */
84 void (* loading_uri) (NautilusWindowInfo *window,
85 const char *uri);
86 /* Emitted when the view in the window changes the selection */
87 void (* selection_changed) (NautilusWindowInfo *window);
88 void (* title_changed) (NautilusWindowInfo *window,
89 const char *title);
90 void (* hidden_files_mode_changed)(NautilusWindowInfo *window);
92 /* VTable: */
93 /* A view calls this once after a load_location, once it starts loading the
94 * directory. Might be called directly, or later on the mainloop.
95 * This can also be called at any other time if the view needs to
96 * re-load the location. But the view needs to call load_complete first if
97 * its currently loading. */
98 void (* report_load_underway) (NautilusWindowInfo *window,
99 NautilusView *view);
100 /* A view calls this once after reporting load_underway, when the location
101 has been fully loaded, or when the load was stopped
102 (by an error or by the user). */
103 void (* report_load_complete) (NautilusWindowInfo *window,
104 NautilusView *view);
105 /* This can be called at any time when there has been a catastrophic failure of
106 the view. It will result in the view being removed. */
107 void (* report_view_failed) (NautilusWindowInfo *window,
108 NautilusView *view);
109 void (* report_selection_changed) (NautilusWindowInfo *window);
111 /* Returns the number of selected items in the view */
112 int (* get_selection_count) (NautilusWindowInfo *window);
114 /* Returns a list of uris for th selected items in the view, caller frees it */
115 GList *(* get_selection) (NautilusWindowInfo *window);
117 char * (* get_current_location) (NautilusWindowInfo *window);
118 void (* set_status) (NautilusWindowInfo *window,
119 const char *status);
120 char * (* get_title) (NautilusWindowInfo *window);
121 GList *(* get_history) (NautilusWindowInfo *window);
122 NautilusBookmarkList *
123 (* get_bookmark_list) (NautilusWindowInfo *window);
124 NautilusWindowType
125 (* get_window_type) (NautilusWindowInfo *window);
126 NautilusWindowShowHiddenFilesMode
127 (* get_hidden_files_mode) (NautilusWindowInfo *window);
128 void (* set_hidden_files_mode) (NautilusWindowInfo *window,
129 NautilusWindowShowHiddenFilesMode mode);
131 void (* open_location) (NautilusWindowInfo *window,
132 GFile *location,
133 NautilusWindowOpenMode mode,
134 NautilusWindowOpenFlags flags,
135 GList *selection);
136 void (* show_window) (NautilusWindowInfo *window);
137 void (* close_window) (NautilusWindowInfo *window);
138 GtkUIManager * (* get_ui_manager) (NautilusWindowInfo *window);
141 GType nautilus_window_info_get_type (void);
142 void nautilus_window_info_report_load_underway (NautilusWindowInfo *window,
143 NautilusView *view);
144 void nautilus_window_info_report_load_complete (NautilusWindowInfo *window,
145 NautilusView *view);
146 void nautilus_window_info_report_view_failed (NautilusWindowInfo *window,
147 NautilusView *view);
148 void nautilus_window_info_report_selection_changed (NautilusWindowInfo *window);
149 void nautilus_window_info_open_location (NautilusWindowInfo *window,
150 GFile *location,
151 NautilusWindowOpenMode mode,
152 NautilusWindowOpenFlags flags,
153 GList *selection);
154 void nautilus_window_info_show_window (NautilusWindowInfo *window);
155 void nautilus_window_info_close (NautilusWindowInfo *window);
156 void nautilus_window_info_set_status (NautilusWindowInfo *window,
157 const char *status);
158 NautilusWindowType nautilus_window_info_get_window_type (NautilusWindowInfo *window);
159 char * nautilus_window_info_get_title (NautilusWindowInfo *window);
160 GList * nautilus_window_info_get_history (NautilusWindowInfo *window);
161 NautilusBookmarkList * nautilus_window_info_get_bookmark_list (NautilusWindowInfo *window);
162 char * nautilus_window_info_get_current_location (NautilusWindowInfo *window);
163 int nautilus_window_info_get_selection_count (NautilusWindowInfo *window);
164 GList * nautilus_window_info_get_selection (NautilusWindowInfo *window);
165 NautilusWindowShowHiddenFilesMode nautilus_window_info_get_hidden_files_mode (NautilusWindowInfo *window);
166 void nautilus_window_info_set_hidden_files_mode (NautilusWindowInfo *window,
167 NautilusWindowShowHiddenFilesMode mode);
168 GtkUIManager * nautilus_window_info_get_ui_manager (NautilusWindowInfo *window);
171 G_END_DECLS
173 #endif /* NAUTILUS_WINDOW_INFO_H */