nautilus-spatial-window.h 7.02 KB
Newer Older
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
2 3 4 5

/*
 *  Nautilus
 *
Elliot Lee's avatar
Elliot Lee committed
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 11 12 13
 *  modify it under the terms of the GNU General Public License as
 *  published by the Free Software Foundation; either version 2 of the
 *  License, or (at your option) any later version.
 *
14
 *  Nautilus is distributed in the hope that it will be useful,
15 16 17 18 19
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  General Public License for more details.
 *
 *  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 22
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
23
 *  Authors: Elliot Lee <sopwith@redhat.com>
24
 *           Darin Adler <darin@bentspoon.com>
25 26
 *
 */
27
/* nautilus-window.h: Interface of the main window object */
28

29 30
#ifndef NAUTILUS_WINDOW_H
#define NAUTILUS_WINDOW_H
Elliot Lee's avatar
Elliot Lee committed
31

32
#include <bonobo/bonobo-window.h>
Ramiro Estrugo's avatar
Ramiro Estrugo committed
33
#include <eel/eel-glib-extensions.h>
34 35
#include <libnautilus-private/nautilus-bookmark.h>
#include <libnautilus-private/nautilus-view-identifier.h>
36 37 38
#include "nautilus-applicable-views.h"
#include "nautilus-view-frame.h"
#include "nautilus-sidebar.h"
39
#include "nautilus-application.h"
Elliot Lee's avatar
Elliot Lee committed
40

41 42
#define NAUTILUS_TYPE_WINDOW              (nautilus_window_get_type())
#define NAUTILUS_WINDOW(obj)	          (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_WINDOW, NautilusWindow))
Elliot Lee's avatar
Elliot Lee committed
43
#define NAUTILUS_WINDOW_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_WINDOW, NautilusWindowClass))
44
#define NAUTILUS_IS_WINDOW(obj)	          (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_WINDOW))
Elliot Lee's avatar
Elliot Lee committed
45 46
#define NAUTILUS_IS_WINDOW_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_WINDOW))

47 48 49 50
#ifndef NAUTILUS_WINDOW_DEFINED
#define NAUTILUS_WINDOW_DEFINED
typedef struct NautilusWindow NautilusWindow;
#endif
Elliot Lee's avatar
Elliot Lee committed
51 52

typedef struct {
53
        BonoboWindowClass parent_spot;
54 55 56 57 58 59 60 61

	/* Function pointers for overriding, without corresponding signals */

	/* add_current_location_to_history_list is a function pointer that
	 * subclasses may override if they wish to add something other than
	 * NautilusWindow's idea of the "current location" to the history
	 * list, or nothing at all.
	 */
62
        void (* add_current_location_to_history_list) (NautilusWindow *window);
Elliot Lee's avatar
Elliot Lee committed
63 64
} NautilusWindowClass;

65 66 67 68 69 70
typedef enum {
        NAUTILUS_WINDOW_NOT_SHOWN,
        NAUTILUS_WINDOW_POSITION_SET,
        NAUTILUS_WINDOW_SHOULD_SHOW
} NautilusWindowShowState;

71 72
typedef struct NautilusWindowDetails NautilusWindowDetails;

73
struct NautilusWindow {
74
        BonoboWindow parent_object;
75 76 77 78 79 80 81 82 83
        
        NautilusWindowDetails *details;
        
        /** UI stuff **/
        NautilusSidebar *sidebar;
        GtkWidget *content_hbox;
        GtkWidget *view_as_option_menu;
        GtkWidget *navigation_bar;
        
Darin Adler's avatar
Darin Adler committed
84
        guint status_bar_clear_id;
85 86
        guint save_geometry_idle_id;
	  
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
        /** CORBA-related elements **/
        NautilusApplication *application;
        
        /** State information **/
        
        /* Information about current location/selection */
        
        /* Back/Forward chain, and history list. 
         * The data in these lists are NautilusBookmark pointers. 
         */
        GList *back_list, *forward_list;
        
        NautilusBookmark *current_location_bookmark; 
        NautilusBookmark *last_location_bookmark;
        
        /* Current views stuff */
        NautilusViewFrame *content_view;
        GList *sidebar_panels;
        
106
        /* Widgets to keep track of (for state changes, etc) */      
107 108 109 110
        GtkWidget *zoom_control;
        
        /* Pending changes */
        NautilusViewFrame *new_content_view;
111 112 113

        /* Window showed state (for saved_window_positions) */
        NautilusWindowShowState show_state;
Elliot Lee's avatar
Elliot Lee committed
114 115
};

Darin Adler's avatar
Darin Adler committed
116
GtkType          nautilus_window_get_type             (void);
117 118
void		 nautilus_window_ui_freeze	      (NautilusWindow	 *window);
void		 nautilus_window_ui_thaw	      (NautilusWindow	 *window);
Darin Adler's avatar
Darin Adler committed
119
void             nautilus_window_close                (NautilusWindow    *window);
120 121 122
char *           nautilus_window_get_location         (NautilusWindow    *window);
void             nautilus_window_go_to                (NautilusWindow    *window,
                                                       const char        *location);
123
gboolean         nautilus_window_get_search_mode      (NautilusWindow    *window);
124 125
void             nautilus_window_set_search_mode      (NautilusWindow    *window,
                                                       gboolean           search_mode);
126
void             nautilus_window_go_home              (NautilusWindow    *window);
Darin Adler's avatar
Darin Adler committed
127 128 129 130 131 132 133 134 135 136 137 138
void             nautilus_window_display_error        (NautilusWindow    *window,
                                                       const char        *error_msg);
void             nautilus_window_allow_back           (NautilusWindow    *window,
                                                       gboolean           allow);
void             nautilus_window_allow_forward        (NautilusWindow    *window,
                                                       gboolean           allow);
void             nautilus_window_allow_up             (NautilusWindow    *window,
                                                       gboolean           allow);
void             nautilus_window_allow_reload         (NautilusWindow    *window,
                                                       gboolean           allow);
void             nautilus_window_allow_stop           (NautilusWindow    *window,
                                                       gboolean           allow);
139 140 141
void		 nautilus_window_clear_back_list      (NautilusWindow    *window);
void		 nautilus_window_clear_forward_list   (NautilusWindow    *window);
void		 nautilus_forget_history	      (void);
Darin Adler's avatar
Darin Adler committed
142
void             nautilus_bookmarks_exiting           (void);
143
void		 nautilus_window_reload		      (NautilusWindow	 *window);
144
gint 		 nautilus_window_get_base_page_index  (NautilusWindow 	 *window);
145 146 147
void 		 nautilus_window_hide_location_bar    (NautilusWindow 	 *window);
void 		 nautilus_window_show_location_bar    (NautilusWindow 	 *window);
gboolean	 nautilus_window_location_bar_showing (NautilusWindow    *window);
148 149 150
void 		 nautilus_window_hide_toolbar         (NautilusWindow 	 *window);
void 		 nautilus_window_show_toolbar         (NautilusWindow 	 *window);
gboolean	 nautilus_window_toolbar_showing      (NautilusWindow    *window);
151 152
void 		 nautilus_window_hide_sidebar         (NautilusWindow 	 *window);
void 		 nautilus_window_show_sidebar         (NautilusWindow 	 *window);
153 154 155 156
gboolean	 nautilus_window_sidebar_showing      (NautilusWindow    *window);
void 		 nautilus_window_hide_status_bar      (NautilusWindow 	 *window);
void 		 nautilus_window_show_status_bar      (NautilusWindow 	 *window);
gboolean	 nautilus_window_status_bar_showing   (NautilusWindow    *window);
157
void		 nautilus_window_save_geometry	  (NautilusWindow 	 *window);
158

Elliot Lee's avatar
Elliot Lee committed
159
#endif