~ubuntu-branches/ubuntu/karmic/mergeant/karmic

« back to all changes in this revision

Viewing changes to libmergeant/mg-custom-layout.h

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo R. Montesino
  • Date: 2007-11-29 08:44:48 UTC
  • mfrom: (2.1.4 hardy)
  • Revision ID: james.westby@ubuntu.com-20071129084448-6aon73d22bv6hzfw
Tags: 0.67-3
* Re-enable installation of the mime files in mergeant.install
* mergeant.dirs: create usr/share/mime/packages to make dh_installmime add
  the update-mime-database code snippets

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* mg-custom-layout.h
2
 
 *
3
 
 * Copyright (C) 2004 Vivien Malerba
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or
6
 
 * modify it under the terms of the GNU General Public License as
7
 
 * published by the Free Software Foundation; either version 2 of the
8
 
 * License, or (at your option) any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18
 
 * USA
19
 
 */
20
 
 
21
 
 
22
 
#ifndef __MG_CUSTOM_LAYOUT_H_
23
 
#define __MG_CUSTOM_LAYOUT_H_
24
 
 
25
 
#include <gtk/gtk.h>
26
 
#include "mg-base.h"
27
 
#include "mg-defs.h"
28
 
#include <libgda/libgda.h>
29
 
#include <glade/glade.h>
30
 
#include "mg-work-matrix.h"
31
 
 
32
 
G_BEGIN_DECLS
33
 
 
34
 
#define MG_CUSTOM_LAYOUT_TYPE          (mg_custom_layout_get_type())
35
 
#define MG_CUSTOM_LAYOUT(obj)          G_TYPE_CHECK_INSTANCE_CAST (obj, mg_custom_layout_get_type(), MgCustomLayout)
36
 
#define MG_CUSTOM_LAYOUT_CLASS(klass)  G_TYPE_CHECK_CLASS_CAST (klass, mg_custom_layout_get_type (), MgCustomLayoutClass)
37
 
#define IS_MG_CUSTOM_LAYOUT(obj)       G_TYPE_CHECK_INSTANCE_TYPE (obj, mg_custom_layout_get_type ())
38
 
 
39
 
typedef enum {
40
 
        MG_CUSTOM_LAYOUT_LAYOUT,
41
 
        MG_CUSTOM_LAYOUT_GRID,
42
 
        MG_CUSTOM_LAYOUT_FORM,
43
 
        MG_CUSTOM_LAYOUT_MATRIX
44
 
} MgCustomLayoutType;
45
 
 
46
 
typedef struct
47
 
{
48
 
        MgCustomLayoutType type;
49
 
 
50
 
        /* contents of the layout */
51
 
        union {
52
 
                /* sub layouts, for MG_CUSTOM_LAYOUT_LAYOUT */
53
 
                struct {
54
 
                        GSList           *children; /* list of MgCustomLayout objects, DON'T FREE */
55
 
                        GSList           *connects; /* list of MgCustomLayoutConnect structures, DON'T FREE */
56
 
                } layout;
57
 
                
58
 
                struct {
59
 
                        /* for all the MgWork* widgets */
60
 
                        MgQuery          *query;
61
 
                        guint             mode;
62
 
                        MgBase           *modified;
63
 
 
64
 
                        /* For MgWorkMatrix only */
65
 
                        MgQuery          *query_extra;
66
 
                        MgTarget         *cols_target;
67
 
                        MgTarget         *rows_target;
68
 
                        MgWorkMatrixType  view_type;
69
 
                } work_iface;
70
 
        } contents;
71
 
} MgCustomLayoutData;
72
 
 
73
 
typedef struct {
74
 
        MgCustomLayout *src_layout;
75
 
        MgField        *src_field;
76
 
        MgCustomLayout *dest_layout;
77
 
        MgField        *dest_field;
78
 
} MgCustomLayoutConnect;
79
 
 
80
 
enum
81
 
{
82
 
        MG_CUSTOM_LAYOUT_XML_SAVE_ERROR,
83
 
        MG_CUSTOM_LAYOUT_XML_LOAD_ERROR,
84
 
        MG_CUSTOM_LAYOUT_GLADEXML_ERROR,
85
 
        MG_CUSTOM_LAYOUT_DATA_ERROR
86
 
};
87
 
 
88
 
/* error reporting */
89
 
extern GQuark mg_custom_layout_error_quark (void);
90
 
#define MG_CUSTOM_LAYOUT_ERROR mg_custom_layout_error_quark ()
91
 
 
92
 
/* struct for the object's data */
93
 
struct _MgCustomLayout
94
 
{
95
 
        MgBase                  object;
96
 
        MgCustomLayoutPrivate    *priv;
97
 
};
98
 
 
99
 
/* struct for the object's class */
100
 
struct _MgCustomLayoutClass
101
 
{
102
 
        MgBaseClass          class;
103
 
};
104
 
 
105
 
guint               mg_custom_layout_get_type                 (void);
106
 
GObject            *mg_custom_layout_new                      (MgConf *conf);
107
 
MgCustomLayoutType  mg_custom_layout_get_layout_type          (MgCustomLayout *layout);
108
 
MgCustomLayoutData *mg_custom_layout_get_data                 (MgCustomLayout *layout, GError **error);
109
 
void                mg_custom_layout_data_free                (MgCustomLayoutData *data);
110
 
GladeXML           *mg_custom_layout_get_glade_instance       (MgCustomLayout *layout, 
111
 
                                                               GtkWidget **root_widget, GHashTable **box_widgets, 
112
 
                                                               GError **error);
113
 
GtkWidget          *mg_custom_layout_get_widget               (MgCustomLayout *layout, GError **error);
114
 
 
115
 
MgContext          *mg_custom_layout_get_exec_context         (MgCustomLayout *layout);
116
 
MgContext          *mg_custom_layout_get_data_context         (MgCustomLayout *layout);
117
 
 
118
 
G_END_DECLS
119
 
 
120
 
#endif