1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
6 * Copyright (C) 1999, 2000 Red Hat, Inc.
7 * Copyright (C) 1999, 2000, 2001 Eazel, Inc.
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.
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.
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.
23 * Authors: Elliot Lee <sopwith@redhat.com>
24 * Darin Adler <darin@bentspoon.com>
28 #ifndef NAUTILUS_WINDOW_PRIVATE_H
29 #define NAUTILUS_WINDOW_PRIVATE_H
31 #include "nautilus-window.h"
32 #include "nautilus-spatial-window.h"
33 #include "nautilus-navigation-window.h"
35 #include <bonobo/bonobo-ui-component.h>
36 #include <bonobo/bonobo-ui-container.h>
37 #include <bonobo/bonobo-ui-toolbar-button-item.h>
38 #include <libnautilus-private/nautilus-directory.h>
41 NAUTILUS_LOCATION_CHANGE_STANDARD
,
42 NAUTILUS_LOCATION_CHANGE_BACK
,
43 NAUTILUS_LOCATION_CHANGE_FORWARD
,
44 NAUTILUS_LOCATION_CHANGE_RELOAD
,
45 NAUTILUS_LOCATION_CHANGE_REDIRECT
,
46 NAUTILUS_LOCATION_CHANGE_FALLBACK
47 } NautilusLocationChangeType
;
49 /* FIXME bugzilla.gnome.org 42575: Migrate more fields into here. */
50 struct NautilusWindowDetails
56 GtkWidget
*extra_location_widgets
;
58 GtkUIManager
*ui_manager
;
59 GtkActionGroup
*main_action_group
; /* owned by ui_manager */
60 guint help_message_cid
;
63 guint extensions_menu_merge_id
;
64 GtkActionGroup
*extensions_menu_action_group
;
66 GtkActionGroup
*bookmarks_action_group
;
67 guint refresh_bookmarks_menu_idle_id
;
68 guint bookmarks_merge_id
;
70 /* Current location. */
73 NautilusFile
*viewed_file
;
74 gboolean viewed_file_seen
;
75 gboolean viewed_file_in_trash
;
79 NautilusLocationChangeType location_change_type
;
80 guint location_change_distance
;
81 GFile
*pending_location
;
82 char *pending_scroll_to
;
83 GList
*pending_selection
;
84 NautilusFile
*determine_view_file
;
85 GCancellable
*mount_cancellable
;
90 GtkActionGroup
*view_as_action_group
; /* owned by ui_manager */
91 GtkRadioAction
*view_as_radio_action
;
92 GtkRadioAction
*extra_viewer_radio_action
;
93 guint short_list_merge_id
;
94 guint extra_viewer_merge_id
;
95 GList
*short_list_viewers
;
98 /* Deferred location change. */
99 GFile
*location_to_change_to_at_idle
;
100 guint location_change_at_idle_id
;
102 NautilusWindowShowHiddenFilesMode show_hidden_files_mode
;
103 gboolean search_mode
;
105 GCancellable
*find_mount_cancellable
;
108 struct _NautilusNavigationWindowDetails
{
109 GtkWidget
*content_paned
;
110 GtkWidget
*content_box
;
111 GtkActionGroup
*navigation_action_group
; /* owned by ui_manager */
114 gboolean temporary_navigation_bar
;
115 gboolean temporary_location_bar
;
116 gboolean temporary_search_bar
;
118 GtkWidget
*location_button
;
122 NautilusSidebar
*current_side_panel
;
125 GtkActionGroup
*go_menu_action_group
;
126 guint refresh_go_menu_idle_id
;
127 guint go_menu_merge_id
;
131 GtkWidget
*location_bar
;
133 guint extensions_toolbar_merge_id
;
134 GtkActionGroup
*extensions_toolbar_action_group
;
137 gboolean throbber_active
;
141 #define NAUTILUS_MENU_PATH_BACK_ITEM "/menu/Go/Back"
142 #define NAUTILUS_MENU_PATH_FORWARD_ITEM "/menu/Go/Forward"
143 #define NAUTILUS_MENU_PATH_UP_ITEM "/menu/Go/Up"
145 #define NAUTILUS_MENU_PATH_RELOAD_ITEM "/menu/View/Reload"
146 #define NAUTILUS_MENU_PATH_ZOOM_IN_ITEM "/menu/View/Zoom Items Placeholder/Zoom In"
147 #define NAUTILUS_MENU_PATH_ZOOM_OUT_ITEM "/menu/View/Zoom Items Placeholder/Zoom Out"
148 #define NAUTILUS_MENU_PATH_ZOOM_NORMAL_ITEM "/menu/View/Zoom Items Placeholder/Zoom Normal"
150 #define NAUTILUS_COMMAND_BACK "/commands/Back"
151 #define NAUTILUS_COMMAND_FORWARD "/commands/Forward"
152 #define NAUTILUS_COMMAND_UP "/commands/Up"
154 #define NAUTILUS_COMMAND_RELOAD "/commands/Reload"
155 #define NAUTILUS_COMMAND_BURN_CD "/commands/Burn CD"
156 #define NAUTILUS_COMMAND_STOP "/commands/Stop"
157 #define NAUTILUS_COMMAND_ZOOM_IN "/commands/Zoom In"
158 #define NAUTILUS_COMMAND_ZOOM_OUT "/commands/Zoom Out"
159 #define NAUTILUS_COMMAND_ZOOM_NORMAL "/commands/Zoom Normal"
161 /* window geometry */
162 /* These are very small, and a Nautilus window at this tiny size is *almost*
163 * completely unusable. However, if all the extra bits (sidebar, location bar, etc)
164 * are turned off, you can see an icon or two at this size. See bug 5946.
166 #define NAUTILUS_WINDOW_MIN_WIDTH 200
167 #define NAUTILUS_WINDOW_MIN_HEIGHT 200
169 #define NAUTILUS_SPATIAL_WINDOW_MIN_WIDTH 100
170 #define NAUTILUS_SPATIAL_WINDOW_MIN_HEIGHT 100
171 #define NAUTILUS_SPATIAL_WINDOW_DEFAULT_WIDTH 500
172 #define NAUTILUS_SPATIAL_WINDOW_DEFAULT_HEIGHT 300
174 #define NAUTILUS_NAVIGATION_WINDOW_DEFAULT_WIDTH 800
175 #define NAUTILUS_NAVIGATION_WINDOW_DEFAULT_HEIGHT 550
177 typedef void (*NautilusBookmarkFailedCallback
) (NautilusWindow
*window
,
178 NautilusBookmark
*bookmark
);
180 void nautilus_window_set_status (NautilusWindow
*window
,
182 void nautilus_window_load_view_as_menus (NautilusWindow
*window
);
183 void nautilus_window_load_extension_menus (NautilusWindow
*window
);
184 void nautilus_window_initialize_menus (NautilusWindow
*window
);
185 void nautilus_window_initialize_menus_constructed (NautilusWindow
*window
);
186 void nautilus_menus_append_bookmark_to_menu (NautilusWindow
*window
,
187 NautilusBookmark
*bookmark
,
188 const char *parent_path
,
189 const char *parent_id
,
190 guint index_in_parent
,
191 GtkActionGroup
*action_group
,
193 GCallback refresh_callback
,
194 NautilusBookmarkFailedCallback failed_callback
);
195 #ifdef NEW_UI_COMPLETE
196 void nautilus_window_go_up (NautilusWindow
*window
);
198 void nautilus_window_update_find_menu_item (NautilusWindow
*window
);
199 void nautilus_window_zoom_in (NautilusWindow
*window
);
200 void nautilus_window_zoom_out (NautilusWindow
*window
);
201 void nautilus_window_zoom_to_level (NautilusWindow
*window
,
202 NautilusZoomLevel level
);
203 void nautilus_window_zoom_to_default (NautilusWindow
*window
);
204 void nautilus_window_show_view_as_dialog (NautilusWindow
*window
);
205 void nautilus_window_set_content_view_widget (NautilusWindow
*window
,
206 NautilusView
*content_view
);
207 void nautilus_window_set_viewed_file (NautilusWindow
*window
,
209 void nautilus_send_history_list_changed (void);
210 void nautilus_window_add_current_location_to_history_list (NautilusWindow
*window
);
211 void nautilus_remove_from_history_list_no_notify (GFile
*location
);
212 gboolean
nautilus_add_to_history_list_no_notify (GFile
*location
,
214 gboolean has_custom_name
,
216 GList
* nautilus_get_history_list (void);
217 void nautilus_window_bookmarks_preference_changed_callback (gpointer user_data
);
218 void nautilus_window_update_icon (NautilusWindow
*window
);
219 void nautilus_window_constructed (NautilusWindow
*window
);
221 /* Navigation window menus */
222 void nautilus_navigation_window_initialize_actions (NautilusNavigationWindow
*window
);
223 void nautilus_navigation_window_initialize_menus (NautilusNavigationWindow
*window
);
224 void nautilus_navigation_window_remove_bookmarks_menu_callback (NautilusNavigationWindow
*window
);
226 void nautilus_navigation_window_remove_bookmarks_menu_items (NautilusNavigationWindow
*window
);
227 void nautilus_navigation_window_update_show_hide_menu_items (NautilusNavigationWindow
*window
);
228 void nautilus_navigation_window_update_spatial_menu_item (NautilusNavigationWindow
*window
);
229 void nautilus_navigation_window_remove_go_menu_callback (NautilusNavigationWindow
*window
);
230 void nautilus_navigation_window_remove_go_menu_items (NautilusNavigationWindow
*window
);
232 /* Navigation window toolbar */
233 void nautilus_navigation_window_activate_throbber (NautilusNavigationWindow
*window
);
234 void nautilus_navigation_window_initialize_toolbars (NautilusNavigationWindow
*window
);
235 void nautilus_navigation_window_load_extension_toolbar_items (NautilusNavigationWindow
*window
);
236 void nautilus_navigation_window_set_throbber_active (NautilusNavigationWindow
*window
,
238 void nautilus_navigation_window_go_back (NautilusNavigationWindow
*window
);
239 void nautilus_navigation_window_go_forward (NautilusNavigationWindow
*window
);
242 #endif /* NAUTILUS_WINDOW_PRIVATE_H */