summaryrefslogtreecommitdiff
path: root/src/nautilus-view-frame.h
blob: e9d85d6b4826a469c7b48a5dc760a3bee2026eff (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
150
151
152
153
154
155
/* -*- 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.
 *
 *  This library 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.
 *
 *  This library 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 library; 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>

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#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 ((obj), NAUTILUS_TYPE_VIEW_FRAME))

typedef struct NautilusViewComponentType NautilusViewComponentType;

typedef struct {
        NautilusGenerousBin parent;

        BonoboUIHandler *ui_handler;
        NautilusUndoManager *undo_manager;
     
        char *iid;
        
        BonoboObjectClient *client_object;
        GtkWidget *client_widget;
        
        BonoboObject *view_frame;
        BonoboObject *zoomable_frame;
        
        Nautilus_Zoomable zoomable;
        NautilusViewComponentType *component_class;
        gpointer component_data;
        
        guint construct_arg_count;
        
        guint timer_id;
        guint checking;

        char *label;
} 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 (* 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);
        void (* set_title)                   (NautilusViewFrame *view,
                                              const char *title);

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

        /* Error handling for when client goes away. */
        void (* client_gone)                (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);
CORBA_Object       nautilus_view_frame_get_client_objref  (NautilusViewFrame   *view);
BonoboObject *     nautilus_view_frame_get_control_frame  (NautilusViewFrame   *view);
CORBA_Object       nautilus_view_frame_get_objref         (NautilusViewFrame   *view);

/* These functions correspond to methods of the Nautilus:View CORBAinterface. */
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);
void               nautilus_view_frame_zoom_in            (NautilusViewFrame   *view);
void               nautilus_view_frame_zoom_out           (NautilusViewFrame   *view);
void	      	   nautilus_view_frame_zoom_default       (NautilusViewFrame   *view);
void               nautilus_view_frame_zoom_to_fit        (NautilusViewFrame   *view);

/* Other. */
void               nautilus_view_frame_set_active_errors  (NautilusViewFrame   *view,
                                                           gboolean             enabled);
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);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* NAUTILUS_VIEW_FRAME_H */