1 
2 /*
3  *  Nautilus
4  *
5  *  Copyright (C) 1999, 2000 Red Hat, Inc.
6  *  Copyright (C) 1999, 2000, 2001 Eazel, Inc.
7  *
8  *  Nautilus is free software; you can redistribute it and/or
9  *  modify it under the terms of the GNU General Public License as
10  *  published by the Free Software Foundation; either version 2 of the
11  *  License, or (at your option) any later version.
12  *
13  *  Nautilus is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  *  General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
20  *
21  *  Authors: Elliot Lee <sopwith@redhat.com>
22  *           Darin Adler <darin@bentspoon.com>
23  *
24  */
25 /* nautilus-window.h: Interface of the main window object */
26 
27 #pragma once
28 
29 #include <gtk/gtk.h>
30 #include <libhandy-1/handy.h>
31 
32 #include "nautilus-types.h"
33 
34 G_BEGIN_DECLS
35 
36 #define NAUTILUS_TYPE_WINDOW (nautilus_window_get_type ())
37 G_DECLARE_FINAL_TYPE (NautilusWindow, nautilus_window, NAUTILUS, WINDOW, HdyApplicationWindow);
38 
39 typedef gboolean (* NautilusWindowGoToCallback) (NautilusWindow *window,
40                                                  GFile *location,
41                                                  GError *error,
42                                                  gpointer user_data);
43 
44 typedef void (* NautilusWindowHandleExported) (NautilusWindow *window,
45                                                const char *handle,
46                                                guint xid,
47                                                gpointer user_data);
48 
49 /* window geometry */
50 /* Min values are very small, and a Nautilus window at this tiny size is *almost*
51  * completely unusable. However, if all the extra bits (sidebar, location bar, etc)
52  * are turned off, you can see an icon or two at this size. See bug 5946.
53  */
54 
55 #define NAUTILUS_WINDOW_MIN_WIDTH		200
56 #define NAUTILUS_WINDOW_MIN_HEIGHT		200
57 #define NAUTILUS_WINDOW_DEFAULT_WIDTH		890
58 #define NAUTILUS_WINDOW_DEFAULT_HEIGHT		550
59 
60 NautilusWindow * nautilus_window_new                  (GdkScreen         *screen);
61 void             nautilus_window_close                (NautilusWindow    *window);
62 
63 void nautilus_window_open_location_full               (NautilusWindow          *window,
64                                                        GFile                   *location,
65                                                        NautilusWindowOpenFlags  flags,
66                                                        GList                   *selection,
67                                                        NautilusWindowSlot      *target_slot);
68 
69 void             nautilus_window_new_tab              (NautilusWindow    *window);
70 NautilusWindowSlot * nautilus_window_get_active_slot       (NautilusWindow *window);
71 void                 nautilus_window_set_active_slot       (NautilusWindow    *window,
72                                                             NautilusWindowSlot *slot);
73 GList *              nautilus_window_get_slots             (NautilusWindow *window);
74 void                 nautilus_window_slot_close            (NautilusWindow *window,
75                                                             NautilusWindowSlot *slot);
76 
77 void                 nautilus_window_sync_location_widgets (NautilusWindow *window);
78 
79 void     nautilus_window_hide_sidebar         (NautilusWindow *window);
80 void     nautilus_window_show_sidebar         (NautilusWindow *window);
81 void nautilus_window_reset_menus (NautilusWindow *window);
82 
83 GtkWidget *         nautilus_window_get_notebook (NautilusWindow *window);
84 
85 void     nautilus_window_show_about_dialog    (NautilusWindow *window);
86 
87 GtkWidget *nautilus_window_get_toolbar (NautilusWindow *window);
88 
89 /* sync window GUI with current slot. Used when changing slots,
90  * and when updating the slot state.
91  */
92 void nautilus_window_sync_allow_stop       (NautilusWindow *window,
93 					    NautilusWindowSlot *slot);
94 void nautilus_window_sync_title            (NautilusWindow *window,
95 					    NautilusWindowSlot *slot);
96 
97 void nautilus_window_show_operation_notification (NautilusWindow *window,
98                                                   gchar          *main_label,
99                                                   GFile          *folder_to_open);
100 void nautilus_window_start_dnd (NautilusWindow *window,
101                                 GdkDragContext *context);
102 void nautilus_window_end_dnd (NautilusWindow *window,
103                               GdkDragContext *context);
104 
105 void nautilus_window_search (NautilusWindow *window,
106                              NautilusQuery  *query);
107 
108 void nautilus_window_initialize_slot (NautilusWindow          *window,
109                                       NautilusWindowSlot      *slot,
110                                       NautilusWindowOpenFlags  flags);
111 
112 gboolean nautilus_window_export_handle (NautilusWindow *window,
113                                         NautilusWindowHandleExported callback,
114                                         gpointer user_data);
115 void nautilus_window_unexport_handle (NautilusWindow *window);
116 
117 G_END_DECLS
118