nautilus-window.h 7.13 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 <gtk/gtk.h>
Ramiro Estrugo's avatar
Ramiro Estrugo committed
33
#include <eel/eel-glib-extensions.h>
34
#include <libnautilus-private/nautilus-bookmark.h>
35
#include <libnautilus-private/nautilus-search-directory.h>
36

37
#include "nautilus-navigation-state.h"
38 39
#include "nautilus-view.h"
#include "nautilus-window-types.h"
Elliot Lee's avatar
Elliot Lee committed
40

41 42 43 44 45 46 47 48 49 50 51
#define NAUTILUS_TYPE_WINDOW nautilus_window_get_type()
#define NAUTILUS_WINDOW(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_WINDOW, NautilusWindow))
#define NAUTILUS_WINDOW_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_WINDOW, NautilusWindowClass))
#define NAUTILUS_IS_WINDOW(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_WINDOW))
#define NAUTILUS_IS_WINDOW_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_WINDOW))
#define NAUTILUS_WINDOW_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_WINDOW, NautilusWindowClass))
Elliot Lee's avatar
Elliot Lee committed
52

53 54 55 56 57
typedef enum {
        NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_DEFAULT,
        NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_ENABLE,
        NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_DISABLE
} NautilusWindowShowHiddenFilesMode;
Elliot Lee's avatar
Elliot Lee committed
58

59 60 61 62 63 64
typedef enum {
        NAUTILUS_WINDOW_NOT_SHOWN,
        NAUTILUS_WINDOW_POSITION_SET,
        NAUTILUS_WINDOW_SHOULD_SHOW
} NautilusWindowShowState;

65
typedef enum {
66 67
	NAUTILUS_WINDOW_OPEN_SLOT_NONE = 0,
	NAUTILUS_WINDOW_OPEN_SLOT_APPEND = 1
68 69
}  NautilusWindowOpenSlotFlags;

70 71 72
#define NAUTILUS_WINDOW_SIDEBAR_PLACES "places"
#define NAUTILUS_WINDOW_SIDEBAR_TREE "tree"

73 74
typedef struct NautilusWindowDetails NautilusWindowDetails;

Elliot Lee's avatar
Elliot Lee committed
75
typedef struct {
76
        GtkApplicationWindowClass parent_spot;
77 78 79

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

80 81 82
        void   (* sync_title) (NautilusWindow *window,
			       NautilusWindowSlot *slot);
        NautilusIconInfo * (* get_icon) (NautilusWindow *window,
83
                                         NautilusWindowSlot *slot);
84

85
        void   (* prompt_for_location) (NautilusWindow *window, const char *initial);
86
        void   (* close) (NautilusWindow *window);
87

Alexander Larsson's avatar
Alexander Larsson committed
88
        /* Signals used only for keybindings */
89 90
        void   (* go_up)  (NautilusWindow *window);
	void   (* reload) (NautilusWindow *window);
Elliot Lee's avatar
Elliot Lee committed
91 92
} NautilusWindowClass;

93
struct NautilusWindow {
94
        GtkApplicationWindow parent_object;
95 96
        
        NautilusWindowDetails *details;
Elliot Lee's avatar
Elliot Lee committed
97 98
};

Alexander Larsson's avatar
Alexander Larsson committed
99
GType            nautilus_window_get_type             (void);
100 101
NautilusWindow * nautilus_window_new                  (GtkApplication    *application,
                                                       GdkScreen         *screen);
Darin Adler's avatar
Darin Adler committed
102
void             nautilus_window_close                (NautilusWindow    *window);
103 104 105 106 107 108

void             nautilus_window_connect_content_view (NautilusWindow    *window,
						       NautilusView      *view);
void             nautilus_window_disconnect_content_view (NautilusWindow    *window,
							  NautilusView      *view);

109
void             nautilus_window_go_to                (NautilusWindow    *window,
110
                                                       GFile             *location);
111 112 113 114
void             nautilus_window_go_to_full           (NautilusWindow    *window,
                                                       GFile             *location,
                                                       NautilusWindowGoToCallback callback,
                                                       gpointer           user_data);
115
void             nautilus_window_new_tab              (NautilusWindow    *window);
116

Alexander Larsson's avatar
Alexander Larsson committed
117
GtkUIManager *   nautilus_window_get_ui_manager       (NautilusWindow    *window);
118
GtkActionGroup * nautilus_window_get_main_action_group (NautilusWindow   *window);
119 120
NautilusNavigationState * 
                 nautilus_window_get_navigation_state (NautilusWindow    *window);
121 122 123 124 125 126 127 128 129 130 131 132 133

void                 nautilus_window_report_load_complete     (NautilusWindow *window,
                                                               NautilusView *view);

NautilusWindowShowHiddenFilesMode
                     nautilus_window_get_hidden_files_mode (NautilusWindow *window);
void                 nautilus_window_set_hidden_files_mode (NautilusWindow *window,
                                                            NautilusWindowShowHiddenFilesMode  mode);
void                 nautilus_window_report_load_underway  (NautilusWindow *window,
                                                            NautilusView *view);
void                 nautilus_window_view_visible          (NautilusWindow *window,
                                                            NautilusView *view);
NautilusWindowSlot * nautilus_window_get_active_slot       (NautilusWindow *window);
134
GList *              nautilus_window_get_slots             (NautilusWindow *window);
William Jon McCann's avatar
William Jon McCann committed
135 136 137 138 139 140 141 142
NautilusWindowSlot * nautilus_window_open_slot             (NautilusWindow *window,
                                                            NautilusWindowOpenSlotFlags flags);
void                 nautilus_window_slot_close            (NautilusWindow *window,
                                                            NautilusWindowSlot *slot);

GtkWidget *          nautilus_window_ensure_location_bar   (NautilusWindow *window);
void                 nautilus_window_sync_location_widgets (NautilusWindow *window);
void                 nautilus_window_grab_focus            (NautilusWindow *window);
143
void                 nautilus_window_sync_search_widgets   (NautilusWindow *window);
144

145 146 147 148 149
void     nautilus_window_hide_sidebar         (NautilusWindow *window);
void     nautilus_window_show_sidebar         (NautilusWindow *window);
void     nautilus_window_back_or_forward      (NautilusWindow *window,
                                               gboolean        back,
                                               guint           distance,
150
                                               NautilusWindowOpenFlags flags);
William Jon McCann's avatar
William Jon McCann committed
151

152

153 154 155 156
gboolean nautilus_window_disable_chrome_mapping (GValue *value,
                                                 GVariant *variant,
                                                 gpointer user_data);

157
NautilusWindowOpenFlags nautilus_event_get_window_open_flags   (void);
158
void     nautilus_window_show_about_dialog    (NautilusWindow *window);
159

Elliot Lee's avatar
Elliot Lee committed
160
#endif