~ubuntu-branches/ubuntu/quantal/gnome-documents/quantal

« back to all changes in this revision

Viewing changes to libgd/libgd/gd-main-view-generic.h

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-08-22 10:01:18 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20120822100118-3837rqfy72e1op72
Tags: 3.5.90-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2011 Red Hat, Inc.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU Lesser General Public License as published by 
 
6
 * the Free Software Foundation; either version 2 of the License, or (at your
 
7
 * option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful, but
 
10
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
11
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
 
12
 * License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Lesser General Public License 
 
15
 * along with this program; if not, write to the Free Software Foundation,
 
16
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
17
 *
 
18
 * Author: Cosimo Cecchi <cosimoc@redhat.com>
 
19
 *
 
20
 */
 
21
 
 
22
#ifndef __GD_MAIN_VIEW_GENERIC_H__
 
23
#define __GD_MAIN_VIEW_GENERIC_H__
 
24
 
 
25
#include <glib-object.h>
 
26
 
 
27
#include <gtk/gtk.h>
 
28
 
 
29
G_BEGIN_DECLS
 
30
 
 
31
typedef enum {
 
32
  GD_MAIN_COLUMN_ID,
 
33
  GD_MAIN_COLUMN_URI,
 
34
  GD_MAIN_COLUMN_PRIMARY_TEXT,
 
35
  GD_MAIN_COLUMN_SECONDARY_TEXT,
 
36
  GD_MAIN_COLUMN_ICON,
 
37
  GD_MAIN_COLUMN_MTIME,
 
38
  GD_MAIN_COLUMN_SELECTED,
 
39
 
 
40
  GD_MAIN_COLUMN_LAST
 
41
} GdMainColumns;
 
42
 
 
43
#define GD_TYPE_MAIN_VIEW_GENERIC gd_main_view_generic_get_type()
 
44
 
 
45
#define GD_MAIN_VIEW_GENERIC(obj) \
 
46
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
 
47
   GD_TYPE_MAIN_VIEW_GENERIC, GdMainViewGeneric))
 
48
 
 
49
#define GD_MAIN_VIEW_GENERIC_CLASS(klass) \
 
50
  (G_TYPE_CHECK_CLASS_CAST ((klass), \
 
51
   GD_TYPE_MAIN_VIEW_GENERIC, GdMainViewGenericIface))
 
52
 
 
53
#define GD_IS_MAIN_VIEW_GENERIC(obj) \
 
54
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
 
55
   GD_TYPE_MAIN_VIEW_GENERIC))
 
56
 
 
57
#define GD_IS_MAIN_VIEW_GENERIC_CLASS(klass) \
 
58
  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
 
59
   GD_TYPE_MAIN_VIEW_GENERIC))
 
60
 
 
61
#define GD_MAIN_VIEW_GENERIC_GET_IFACE(obj) \
 
62
  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \
 
63
   GD_TYPE_MAIN_VIEW_GENERIC, GdMainViewGenericIface))
 
64
 
 
65
typedef struct _GdMainViewGeneric GdMainViewGeneric;
 
66
typedef struct _GdMainViewGenericIface GdMainViewGenericIface;
 
67
 
 
68
struct _GdMainViewGenericIface
 
69
{
 
70
  GTypeInterface base_iface;
 
71
 
 
72
  /* vtable */
 
73
  void          (* set_model)            (GdMainViewGeneric  *self,
 
74
                                          GtkTreeModel       *model);
 
75
 
 
76
  GtkTreePath * (* get_path_at_pos)      (GdMainViewGeneric *self,
 
77
                                          gint               x, 
 
78
                                          gint               y);
 
79
  void          (* scroll_to_path)       (GdMainViewGeneric *self,
 
80
                                          GtkTreePath       *path);
 
81
  void          (* set_selection_mode)   (GdMainViewGeneric *self,
 
82
                                          gboolean           selection_mode);
 
83
};
 
84
 
 
85
GType gd_main_view_generic_get_type (void) G_GNUC_CONST;
 
86
 
 
87
void gd_main_view_generic_set_model (GdMainViewGeneric *self,
 
88
                                     GtkTreeModel *model);
 
89
 
 
90
void gd_main_view_generic_scroll_to_path (GdMainViewGeneric *self,
 
91
                                          GtkTreePath *path);
 
92
void gd_main_view_generic_set_selection_mode (GdMainViewGeneric *self,
 
93
                                              gboolean selection_mode);
 
94
GtkTreePath * gd_main_view_generic_get_path_at_pos (GdMainViewGeneric *self,
 
95
                                                    gint x,
 
96
                                                    gint y);
 
97
 
 
98
/* private */
 
99
void _gd_main_view_generic_dnd_common (GtkTreeModel *model,
 
100
                                       gboolean selection_mode,
 
101
                                       GtkTreePath *path,
 
102
                                       GtkSelectionData *data);
 
103
 
 
104
G_END_DECLS
 
105
 
 
106
#endif /* __GD_MAIN_VIEW_GENERIC_H__ */