nautilus-view-frame.h 5.56 KB
Newer Older
1
2
3
4
5
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */

/*
 *  Nautilus
 *
Elliot Lee's avatar
Elliot Lee committed
6
 *  Copyright (C) 1999, 2000 Red Hat, Inc.
7
 *  Copyright (C) 1999, 2000 Eazel, Inc.
8
9
10
11
12
 *
 *  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.
Elliot Lee's avatar
Elliot Lee committed
13
 *
14
15
16
17
 *  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.
Elliot Lee's avatar
Elliot Lee committed
18
 *
19
20
21
22
23
 *  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>
Elliot Lee's avatar
Elliot Lee committed
24
25
 *
 */
26
27
28
29
/* ntl-view.h: Interface of the object representing a data
   view. NautilusContentView and NautilusMetaView derive from this
   class. */

Elliot Lee's avatar
Elliot Lee committed
30
31
32
33
34
35
#ifndef __NAUTILUS_VIEW_H__
#define __NAUTILUS_VIEW_H__

#include <gtk/gtkwidget.h>
#include <gtk/gtkbin.h>
#include "ntl-types.h"
36
#include <bonobo.h>
Elliot Lee's avatar
Elliot Lee committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

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

#define NAUTILUS_TYPE_VIEW			(nautilus_view_get_type ())
#define NAUTILUS_VIEW(obj)			(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_VIEW, NautilusView))
#define NAUTILUS_VIEW_CLASS(klass)		(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_VIEW, NautilusViewClass))
#define NAUTILUS_IS_VIEW(obj)			(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_VIEW))
#define NAUTILUS_IS_VIEW_CLASS(klass)		(GTK_CHECK_CLASS_TYPE ((obj), NAUTILUS_TYPE_VIEW))

typedef struct _NautilusView       NautilusView;
typedef struct _NautilusViewClass  NautilusViewClass;

struct _NautilusViewClass
{
53
  GtkBinClass parent_spot;
Elliot Lee's avatar
Elliot Lee committed
54

Maciej Stachowiak's avatar
Maciej Stachowiak committed
55
56
57
58
59
60
61
62
63
64
65
  /* These signals correspond to the Natuilus:ViewFrame CORBA interface. They
     are requests that the underlying view may make of the framework. */

  void (*request_location_change)	(NautilusView *view,
					 Nautilus_NavigationRequestInfo *navinfo);
  void (*request_selection_change)      (NautilusView *view,
				         Nautilus_SelectionRequestInfo *selinfo);
  void (*request_status_change)         (NautilusView *view,
                                         Nautilus_StatusRequestInfo *loc);
  void (*request_progress_change)       (NautilusView *view,
                                         Nautilus_ProgressRequestInfo *loc);
66
67
  void (*notify_zoom_level)             (NautilusView *view,
                                         gdouble       zoom_level);
Elliot Lee's avatar
Elliot Lee committed
68

69
70
  /* Not a signal. Work-around for Gtk+'s lack of a 'constructed' operation */
  void (*view_constructed) (NautilusView *view);
71
72
73

  GtkBinClass *parent_class;
  guint num_construct_args;
Elliot Lee's avatar
Elliot Lee committed
74
75

  gpointer servant_init_func, servant_destroy_func, vepv;
76
  gpointer zoomable_servant_init_func, zoomable_servant_destroy_func, zoomable_vepv;
Elliot Lee's avatar
Elliot Lee committed
77
78
};

79
80
typedef struct _NautilusViewComponentType NautilusViewComponentType;

81
82
83
84
85
86
87
struct _NautilusView
{
  GtkBin parent;

  GtkWidget *main_window;

  char *iid;
88

89
  BonoboObjectClient *client_object;
90
  GtkWidget *client_widget;
Elliot Lee's avatar
Elliot Lee committed
91

92
  BonoboObject *view_frame;
93
  BonoboObject *zoomable_frame;
94

95
  Nautilus_Zoomable zoomable;
96
97
  NautilusViewComponentType *component_class;
  gpointer component_data;
98

99
100
  guint construct_arg_count;

101
  guint timer_id;
102
  guint checking;
103
104
};

Maciej Stachowiak's avatar
Maciej Stachowiak committed
105
GtkType nautilus_view_get_type                  (void);
106
107
gboolean nautilus_view_load_client              (NautilusView              *view,
                                                 const char *               iid);
Maciej Stachowiak's avatar
Maciej Stachowiak committed
108
109
const char *nautilus_view_get_iid               (NautilusView *view);
CORBA_Object nautilus_view_get_client_objref    (NautilusView *view);
110
BonoboObject *nautilus_view_get_control_frame    (NautilusView *view);
Maciej Stachowiak's avatar
Maciej Stachowiak committed
111
112
113
114
115
116
117
118
119
120
121
122
123
CORBA_Object nautilus_view_get_objref           (NautilusView *view);

/* These functions correspond to methods of the Nautilus:View CORBAinterface */

void nautilus_view_notify_location_change       (NautilusView *view,
					         Nautilus_NavigationInfo *nav_context);
void nautilus_view_notify_selection_change      (NautilusView *view,
					         Nautilus_SelectionInfo *sel_context);
void nautilus_view_load_state                   (NautilusView *view, 
                                                 const char *config_path);
void nautilus_view_save_state                   (NautilusView *view, 
                                                 const char *config_path);
void nautilus_view_show_properties              (NautilusView *view);
124
void nautilus_view_stop_location_change         (NautilusView *view);
125
void nautilus_view_set_active_errors            (NautilusView *view, gboolean enabled);
126

127
128
129
130
131
132
133
134
135
136
137
138
139

gboolean  nautilus_view_is_zoomable                (NautilusView *view);
gdouble   nautilus_view_get_zoom_level             (NautilusView *view);
void      nautilus_view_set_zoom_level             (NautilusView *view,
                                                    gdouble       zoom_level);
gdouble   nautilus_view_get_min_zoom_level         (NautilusView *view);
gdouble   nautilus_view_get_max_zoom_level         (NautilusView *view);
gboolean  nautilus_view_get_is_continuous          (NautilusView *view);
void      nautilus_view_zoom_in                    (NautilusView *view);
void      nautilus_view_zoom_out	           (NautilusView *view);
void      nautilus_view_zoom_to_fit	           (NautilusView *view);


140
141
/* This is a "protected" operation */
void    nautilus_view_construct_arg_set(NautilusView *view);
Elliot Lee's avatar
Elliot Lee committed
142
143
144
145
146
147

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __NAUTILUS_VIEW_H__ */