summaryrefslogtreecommitdiff
path: root/src/nautilus-view-frame.h
blob: 39b6340aa93309400a34939450cf67c9716c3945 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */

/*
 *  Nautilus
 *
 *  Copyright (C) 1999, 2000 Red Hat, Inc.
 *  Copyright (C) 1999, 2000, 2001 Eazel, Inc.
 *
 *  Nautilus is free software; you can redistribute it and/or
 *  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.
 *
 *  Nautilus is distributed in the hope that it will be useful,
 *  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
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *  Authors: Elliot Lee <sopwith@redhat.com>
 *           Darin Adler <darin@bentspoon.com>
 *
 */

/* nautilus-view-frame.h: Interface of the object representing a data
 * view. This is actually the widget for the view frame rather than
 * the view frame itself.
 */

#ifndef NAUTILUS_VIEW_FRAME_H
#define NAUTILUS_VIEW_FRAME_H

#include <bonobo/bonobo-ui-container.h>
#include <bonobo/bonobo-zoomable-frame.h>
#include <gtk/gtkhbox.h>
#include <libnautilus-private/nautilus-undo-manager.h>
#include <libnautilus/nautilus-view-component.h>

#define NAUTILUS_TYPE_VIEW_FRAME            (nautilus_view_frame_get_type ())
#define NAUTILUS_VIEW_FRAME(obj)            (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_VIEW_FRAME, NautilusViewFrame))
#define NAUTILUS_VIEW_FRAME_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_VIEW_FRAME, NautilusViewFrameClass))
#define NAUTILUS_IS_VIEW_FRAME(obj)         (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_VIEW_FRAME))
#define NAUTILUS_IS_VIEW_FRAME_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_VIEW_FRAME))

typedef struct NautilusViewFrameDetails NautilusViewFrameDetails;

typedef struct {
        GtkHBox parent;
        NautilusViewFrameDetails *details;
} NautilusViewFrame;

typedef struct {
        GtkHBoxClass parent_spot;
        
        /* These roughly correspond to CORBA calls, but in some cases they are higher level. */

        /* This happens only just after load_view. */
        void               (* view_loaded)                          (NautilusViewFrame *view);

        /* These can happen pretty much any time. */
        void               (* load_underway)                        (NautilusViewFrame *view);
        void               (* failed)                               (NautilusViewFrame *view);

        /* These will only happen after load_underway (guaranteed). */
        void               (* open_location)                        (NautilusViewFrame *view,
                                                                     const char        *location,
                                                                     Nautilus_ViewFrame_OpenMode mode,
                                                                     Nautilus_ViewFrame_OpenFlags flags,
                                                                     GList             *selection); /* list of char * */
        void               (* report_location_change)               (NautilusViewFrame *view,
                                                                     const char        *location,
                                                                     GList             *selection, /* list of char * */
                                                                     const char        *title);
        void               (* report_redirect)                      (NautilusViewFrame *view,
                                                                     const char        *from_location,
                                                                     const char        *to_location,
                                                                     GList             *selection, /* list of char * */
                                                                     const char        *title);
        void               (* change_selection)                     (NautilusViewFrame *view,
                                                                     GList             *selection); /* list of char * */
        void               (* change_status)                        (NautilusViewFrame *view,
                                                                     const char        *status);
        void               (* load_progress_changed)                (NautilusViewFrame *view);
        void               (* load_complete)                        (NautilusViewFrame *view);
        void               (* title_changed)                        (NautilusViewFrame *view);
        void               (* zoom_level_changed)                   (NautilusViewFrame *view);
        void               (* zoom_parameters_changed)              (NautilusViewFrame *view);
	Nautilus_History * (* get_history_list)                     (NautilusViewFrame *view);
        void               (* go_back)                              (NautilusViewFrame *view);
        void               (* close_window)                         (NautilusViewFrame *view);
} NautilusViewFrameClass;

/* basic view management */
GType              nautilus_view_frame_get_type                  (void);
NautilusViewFrame *nautilus_view_frame_new                       (BonoboUIContainer   *ui_container,
                                                                  NautilusUndoManager *undo_manager,
                                                                  Nautilus_WindowType  window_type);
Bonobo_Control	   nautilus_view_frame_get_control		 (NautilusViewFrame   *view);

/* connecting to a Nautilus:View */
void               nautilus_view_frame_load_view                 (NautilusViewFrame   *view,
                                                                  const char          *view_iid);
void               nautilus_view_frame_stop                      (NautilusViewFrame   *view);

/* calls to Nautilus:View functions */
void               nautilus_view_frame_load_location             (NautilusViewFrame   *view,
                                                                  const char          *location);
void               nautilus_view_frame_selection_changed         (NautilusViewFrame   *view,
                                                                  GList               *selection);
void               nautilus_view_frame_title_changed             (NautilusViewFrame   *view,
                                                                  const char          *title);

/* calls to Bonobo:Zoomable functions */
float              nautilus_view_frame_get_zoom_level            (NautilusViewFrame   *view);
void               nautilus_view_frame_set_zoom_level            (NautilusViewFrame   *view,
                                                                  float                zoom_level);
float              nautilus_view_frame_get_min_zoom_level        (NautilusViewFrame   *view);
float              nautilus_view_frame_get_max_zoom_level        (NautilusViewFrame   *view);
gboolean           nautilus_view_frame_get_has_min_zoom_level    (NautilusViewFrame   *view);
gboolean           nautilus_view_frame_get_has_max_zoom_level    (NautilusViewFrame   *view);
gboolean           nautilus_view_frame_get_is_continuous         (NautilusViewFrame   *view);
gboolean           nautilus_view_frame_get_can_zoom_in           (NautilusViewFrame   *view);
gboolean           nautilus_view_frame_get_can_zoom_out          (NautilusViewFrame   *view);

GList *            nautilus_view_frame_get_preferred_zoom_levels (NautilusViewFrame   *view);
void               nautilus_view_frame_zoom_in                   (NautilusViewFrame   *view);
void               nautilus_view_frame_zoom_out                  (NautilusViewFrame   *view);
void               nautilus_view_frame_zoom_to_fit               (NautilusViewFrame   *view);

/* calls to Nautilus::ScrollPositionable */
char *             nautilus_view_frame_get_first_visible_file    (NautilusViewFrame   *view);
void               nautilus_view_frame_scroll_to_file            (NautilusViewFrame   *view,
                                                                  const char          *uri);

/* Other. */
gboolean           nautilus_view_frame_get_is_view_loaded        (NautilusViewFrame   *view);
const char *       nautilus_view_frame_get_view_iid              (NautilusViewFrame   *view);
gboolean           nautilus_view_frame_get_is_zoomable           (NautilusViewFrame   *view);
char *             nautilus_view_frame_get_title                 (NautilusViewFrame   *view);
char *             nautilus_view_frame_get_label                 (NautilusViewFrame   *view);
void               nautilus_view_frame_set_label                 (NautilusViewFrame   *view,
                                                                  const char          *label);

#endif /* NAUTILUS_VIEW_FRAME_H */