1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- 2 3 caja-window-slot-info.h: Interface for caja window slots 4 5 Copyright (C) 2008 Free Software Foundation, Inc. 6 7 This program is free software; you can redistribute it and/or 8 modify it under the terms of the GNU General Public License as 9 published by the Free Software Foundation; either version 2 of the 10 License, or (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 General Public License for more details. 16 17 You should have received a copy of the GNU General Public 18 License along with this program; if not, write to the 19 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 20 Boston, MA 02110-1301, USA. 21 22 Author: Christian Neumair <cneumair@gnome.org> 23 */ 24 25 #ifndef CAJA_WINDOW_SLOT_INFO_H 26 #define CAJA_WINDOW_SLOT_INFO_H 27 28 #include "caja-window-info.h" 29 #include "caja-view.h" 30 31 32 #define CAJA_TYPE_WINDOW_SLOT_INFO (caja_window_slot_info_get_type ()) 33 #define CAJA_WINDOW_SLOT_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAJA_TYPE_WINDOW_SLOT_INFO, CajaWindowSlotInfo)) 34 #define CAJA_IS_WINDOW_SLOT_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAJA_TYPE_WINDOW_SLOT_INFO)) 35 #define CAJA_WINDOW_SLOT_INFO_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CAJA_TYPE_WINDOW_SLOT_INFO, CajaWindowSlotInfoIface)) 36 37 typedef struct _CajaWindowSlotInfoIface CajaWindowSlotInfoIface; 38 39 struct _CajaWindowSlotInfoIface 40 { 41 GTypeInterface g_iface; 42 43 /* signals */ 44 45 /* emitted right after this slot becomes active. 46 * Views should connect to this signal and merge their UI 47 * into the main window. 48 */ 49 void (* active) (CajaWindowSlotInfo *slot); 50 /* emitted right before this slot becomes inactive. 51 * Views should connect to this signal and unmerge their UI 52 * from the main window. 53 */ 54 void (* inactive) (CajaWindowSlotInfo *slot); 55 56 /* returns the window info associated with this slot */ 57 CajaWindowInfo * (* get_window) (CajaWindowSlotInfo *slot); 58 59 /* Returns the number of selected items in the view */ 60 int (* get_selection_count) (CajaWindowSlotInfo *slot); 61 62 /* Returns a list of uris for th selected items in the view, caller frees it */ 63 GList *(* get_selection) (CajaWindowSlotInfo *slot); 64 65 char * (* get_current_location) (CajaWindowSlotInfo *slot); 66 CajaView * (* get_current_view) (CajaWindowSlotInfo *slot); 67 void (* set_status) (CajaWindowSlotInfo *slot, 68 const char *status); 69 char * (* get_title) (CajaWindowSlotInfo *slot); 70 71 void (* open_location) (CajaWindowSlotInfo *slot, 72 GFile *location, 73 CajaWindowOpenMode mode, 74 CajaWindowOpenFlags flags, 75 GList *selection, 76 CajaWindowGoToCallback callback, 77 gpointer user_data); 78 void (* make_hosting_pane_active) (CajaWindowSlotInfo *slot); 79 }; 80 81 82 GType caja_window_slot_info_get_type (void); 83 CajaWindowInfo * caja_window_slot_info_get_window (CajaWindowSlotInfo *slot); 84 #define caja_window_slot_info_open_location(slot, location, mode, flags, selection) \ 85 caja_window_slot_info_open_location_full(slot, location, mode, \ 86 flags, selection, NULL, NULL) 87 88 void caja_window_slot_info_open_location_full 89 (CajaWindowSlotInfo *slot, 90 GFile *location, 91 CajaWindowOpenMode mode, 92 CajaWindowOpenFlags flags, 93 GList *selection, 94 CajaWindowGoToCallback callback, 95 gpointer user_data); 96 void caja_window_slot_info_set_status (CajaWindowSlotInfo *slot, 97 const char *status); 98 void caja_window_slot_info_make_hosting_pane_active (CajaWindowSlotInfo *slot); 99 100 char * caja_window_slot_info_get_current_location (CajaWindowSlotInfo *slot); 101 CajaView * caja_window_slot_info_get_current_view (CajaWindowSlotInfo *slot); 102 int caja_window_slot_info_get_selection_count (CajaWindowSlotInfo *slot); 103 GList * caja_window_slot_info_get_selection (CajaWindowSlotInfo *slot); 104 char * caja_window_slot_info_get_title (CajaWindowSlotInfo *slot); 105 106 #endif /* CAJA_WINDOW_SLOT_INFO_H */ 107