2008-05-05 Paolo Borelli <pborelli@katamail.com>
[nautilus.git] / src / nautilus-window.h
blobd4ae6d4287f6bb2f0054f5add554699dbf36ecde
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
3 /*
4 * Nautilus
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>
27 /* nautilus-window.h: Interface of the main window object */
29 #ifndef NAUTILUS_WINDOW_H
30 #define NAUTILUS_WINDOW_H
32 #include <gtk/gtkuimanager.h>
33 #include <gtk/gtkwindow.h>
34 #include <eel/eel-glib-extensions.h>
35 #include <libnautilus-private/nautilus-bookmark.h>
36 #include <libnautilus-private/nautilus-window-info.h>
37 #include <libnautilus-private/nautilus-search-directory.h>
38 #include "nautilus-application.h"
39 #include "nautilus-information-panel.h"
40 #include "nautilus-side-pane.h"
42 #define NAUTILUS_TYPE_WINDOW (nautilus_window_get_type())
43 #define NAUTILUS_WINDOW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_WINDOW, NautilusWindow))
44 #define NAUTILUS_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_WINDOW, NautilusWindowClass))
45 #define NAUTILUS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_WINDOW, NautilusWindowClass))
46 #define NAUTILUS_IS_WINDOW(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_WINDOW))
47 #define NAUTILUS_IS_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_WINDOW))
49 #ifndef NAUTILUS_WINDOW_DEFINED
50 #define NAUTILUS_WINDOW_DEFINED
51 typedef struct NautilusWindow NautilusWindow;
52 #endif
54 typedef struct {
55 GtkWindowClass parent_spot;
57 NautilusWindowType window_type;
58 const char *bookmarks_placeholder;
60 /* Function pointers for overriding, without corresponding signals */
62 /* add_current_location_to_history_list is a function pointer that
63 * subclasses may override if they wish to add something other than
64 * NautilusWindow's idea of the "current location" to the history
65 * list, or nothing at all.
67 void (* add_current_location_to_history_list) (NautilusWindow *window);
69 char * (* get_title) (NautilusWindow *window);
70 gboolean (* set_title) (NautilusWindow *window, const char *title);
71 NautilusIconInfo * (* get_icon) (NautilusWindow *window);
73 void (* load_view_as_menu) (NautilusWindow *window);
74 void (* set_content_view_widget) (NautilusWindow *window,
75 NautilusView *new_view);
76 void (* set_throbber_active) (NautilusWindow *window,
77 gboolean active);
78 void (* set_allow_up) (NautilusWindow *window, gboolean allow);
79 void (* reload) (NautilusWindow *window);
80 void (* prompt_for_location) (NautilusWindow *window, const char *initial);
81 void (* set_search_mode) (NautilusWindow *window, gboolean search_enabled, NautilusSearchDirectory *search_directory);
82 void (* get_default_size) (NautilusWindow *window, guint *default_width, guint *default_height);
83 void (* show_window) (NautilusWindow *window);
84 void (* close) (NautilusWindow *window);
86 /* Signals used only for keybindings */
87 gboolean (* go_up) (NautilusWindow *window, gboolean close);
88 } NautilusWindowClass;
90 typedef enum {
91 NAUTILUS_WINDOW_NOT_SHOWN,
92 NAUTILUS_WINDOW_POSITION_SET,
93 NAUTILUS_WINDOW_SHOULD_SHOW
94 } NautilusWindowShowState;
96 typedef struct NautilusWindowDetails NautilusWindowDetails;
98 struct NautilusWindow {
99 GtkWindow parent_object;
101 NautilusWindowDetails *details;
103 /** CORBA-related elements **/
104 NautilusApplication *application;
106 /** State information **/
108 /* Information about current location/selection */
109 NautilusBookmark *current_location_bookmark;
110 NautilusBookmark *last_location_bookmark;
112 /* Current views stuff */
113 NautilusView *content_view;
115 /* Pending changes */
116 NautilusView *new_content_view;
119 GType nautilus_window_get_type (void);
120 void nautilus_window_show_window (NautilusWindow *window);
121 void nautilus_window_close (NautilusWindow *window);
122 char * nautilus_window_get_location_uri (NautilusWindow *window);
123 GFile * nautilus_window_get_location (NautilusWindow *window);
124 void nautilus_window_go_to (NautilusWindow *window,
125 GFile *location);
126 void nautilus_window_go_to_with_selection (NautilusWindow *window,
127 GFile *location,
128 GList *new_selection);
129 void nautilus_window_go_home (NautilusWindow *window);
130 void nautilus_window_go_up (NautilusWindow *window,
131 gboolean close_behind);
132 void nautilus_window_prompt_for_location (NautilusWindow *window,
133 const char *initial);
134 void nautilus_window_set_search_mode (NautilusWindow *window,
135 gboolean search_mode,
136 NautilusSearchDirectory *search_directory);
137 void nautilus_window_launch_cd_burner (NautilusWindow *window);
138 void nautilus_window_update_title (NautilusWindow *window);
139 void nautilus_window_display_error (NautilusWindow *window,
140 const char *error_msg);
141 void nautilus_window_reload (NautilusWindow *window);
143 void nautilus_window_allow_reload (NautilusWindow *window,
144 gboolean allow);
145 void nautilus_window_allow_up (NautilusWindow *window,
146 gboolean allow);
147 void nautilus_window_allow_stop (NautilusWindow *window,
148 gboolean allow);
149 void nautilus_window_allow_burn_cd (NautilusWindow *window,
150 gboolean allow);
151 GtkUIManager * nautilus_window_get_ui_manager (NautilusWindow *window);
152 void nautilus_window_add_extra_location_widget (NautilusWindow *window,
153 GtkWidget *widget);
154 gboolean nautilus_window_has_menubar_and_statusbar (NautilusWindow *window);
156 #endif