summaryrefslogtreecommitdiff
path: root/src/nautilus-view-frame.h
blob: dd1dd828bb7a034a9b2739fa194e69eeb55bcd96 (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
148
149
/* -*- 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 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.
 *
 *  Author: Elliot Lee <sopwith@redhat.com>
 *
 */

/* nautilus-view-frame.h: Interface of the object representing a data
   view. */

#ifndef NAUTILUS_VIEW_FRAME_H
#define NAUTILUS_VIEW_FRAME_H

#include <libnautilus-extensions/nautilus-generous-bin.h>
#include <bonobo/bonobo-object-client.h>
#include <bonobo/bonobo-ui-handler.h>
#include <libnautilus/nautilus-view-component.h>
#include <libnautilus-extensions/nautilus-undo-manager.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 NautilusViewComponentType NautilusViewComponentType;

typedef struct {
        NautilusGenerousBin parent;
        NautilusViewFrameDetails *details;

        BonoboUIHandler *ui_handler;
        NautilusUndoManager *undo_manager;
     
        char *iid;
        
        BonoboObjectClient *client_object;
        GtkWidget *client_widget;
        
        BonoboObject *view_frame;
        BonoboObject *zoomable_frame;
        BonoboObject *history_frame;
        
        Nautilus_Zoomable zoomable;
        NautilusViewComponentType *component_class;
        gpointer component_data;
} NautilusViewFrame;

typedef struct {
        NautilusGenerousBinClass parent_spot;
        
        /* These signals correspond to the Nautilus::ViewFrame CORBA interface. They
         * are requests that the underlying view may make of the shell via the frame.
         */
        void (* open_location)	               (NautilusViewFrame *view,
                                                const char *location);
        void (* open_location_in_new_window)   (NautilusViewFrame *view,
                                                const char *location);
        void (* open_in_new_window_and_select) (NautilusViewFrame *view,
                                                const char *location,
                                                GList *selection); /* list of char * */
        void (* report_location_change)	       (NautilusViewFrame *view,
                                                const char *location);
        void (* report_selection_change)       (NautilusViewFrame *view,
                                                GList *selection); /* list of char * */
        void (* report_status)                 (NautilusViewFrame *view,
                                                const char *status);
        void (* report_load_underway)          (NautilusViewFrame *view);
        void (* report_load_progress)          (NautilusViewFrame *view,
                                                double fraction_done);
        void (* report_load_complete)          (NautilusViewFrame *view);
        void (* report_load_failed)            (NautilusViewFrame *view);

        /* These are higher-level signals. We are moving more work into
         * this class, so we no longer have one signal for each CORBA
         * signal.
         */
        void (* title_changed)                 (NautilusViewFrame *view);

        /* Part of Nautilus::ZoomableFrame CORBA interface. */
        void (* zoom_level_changed)            (NautilusViewFrame *view,
                                                double zoom_level);

        /* Error handling for when client goes away. */
        void (* client_gone)                   (NautilusViewFrame *view);

	/* Get a CORBA copy of the history list */
	Nautilus_HistoryList *
             (* get_history_list)	       (NautilusViewFrame *view);

} NautilusViewFrameClass;

GtkType               nautilus_view_frame_get_type                  (void);
NautilusViewFrame *   nautilus_view_frame_new                       (BonoboUIHandler     *ui_handler,
                                                                     NautilusUndoManager *undo_manager);
gboolean              nautilus_view_frame_load_client               (NautilusViewFrame   *view,
                                                                     const char          *iid);
const char *          nautilus_view_frame_get_iid                   (NautilusViewFrame   *view);
char *                nautilus_view_frame_get_title                 (NautilusViewFrame   *view);

/* Nautilus:View */
void                  nautilus_view_frame_load_location             (NautilusViewFrame   *view,
                                                                     const char          *location);
void                  nautilus_view_frame_stop_loading              (NautilusViewFrame   *view);
void                  nautilus_view_frame_selection_changed         (NautilusViewFrame   *view,
                                                                     GList               *selection);

/* Nautilus:Zoomable */
gboolean              nautilus_view_frame_is_zoomable               (NautilusViewFrame   *view);
gdouble               nautilus_view_frame_get_zoom_level            (NautilusViewFrame   *view);
void                  nautilus_view_frame_set_zoom_level            (NautilusViewFrame   *view,
                                                                     double               zoom_level);
gdouble               nautilus_view_frame_get_min_zoom_level        (NautilusViewFrame   *view);
gdouble               nautilus_view_frame_get_max_zoom_level        (NautilusViewFrame   *view);
gboolean              nautilus_view_frame_get_is_continuous         (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);

/* Other. */
char *                nautilus_view_frame_get_label                 (NautilusViewFrame   *view);
void                  nautilus_view_frame_set_label                 (NautilusViewFrame   *view,
                                                                     const char          *label);
void                  nautilus_view_frame_activate                  (NautilusViewFrame   *view);
Nautilus_HistoryList *nautilus_view_frame_get_history_list          (NautilusViewFrame   *view);
void                  nautilus_view_frame_title_changed             (NautilusViewFrame   *view);

#endif /* NAUTILUS_VIEW_FRAME_H */