Introspection: fix problems with boxed type.
[gnumeric.git] / src / clipboard.h
blob8cd115853cd989a8de89d241d74cdbc129dd08ca
1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 #ifndef _GNM_CLIPBOARD_H_
3 # define _GNM_CLIPBOARD_H_
5 #include "gnumeric.h"
6 #include <goffice/goffice.h>
8 G_BEGIN_DECLS
10 typedef enum {
11 PASTE_CONTENTS = 1 << 0, /* either CONTENTS or AS_VALUES */
12 PASTE_AS_VALUES = 1 << 1, /* can be applied, not both */
13 PASTE_FORMATS = 1 << 2,
14 PASTE_COMMENTS = 1 << 3,
15 PASTE_OBJECTS = 1 << 4,
17 /* Operations that can be performed at paste time on a cell */
18 PASTE_OPER_ADD = 1 << 5,
19 PASTE_OPER_SUB = 1 << 6,
20 PASTE_OPER_MULT = 1 << 7,
21 PASTE_OPER_DIV = 1 << 8,
23 /* Whether the paste transposes or not */
24 PASTE_TRANSPOSE = 1 << 9,
26 PASTE_LINK = 1 << 10,
28 /* If copying a range that includes blank cells, this
29 prevents pasting blank cells over existing data */
30 PASTE_SKIP_BLANKS = 1 << 11,
32 /* Do not paste merged regions (probably not needed) */
33 PASTE_DONT_MERGE = 1 << 12,
35 /* Internal flag : see cmd_merge_cells_undo for details */
36 PASTE_IGNORE_COMMENTS_AT_ORIGIN = 1 << 13,
38 /* Update the row height when pasting? (for large fonts, etc.) */
39 PASTE_UPDATE_ROW_HEIGHT = 1 << 14,
41 PASTE_EXPR_LOCAL_RELOCATE = 1 << 15,
43 /* Avoid flagging dependencies. */
44 PASTE_NO_RECALC = 1 << 16,
46 /* Whether the paste flips or not */
47 PASTE_FLIP_H = 1 << 17,
48 PASTE_FLIP_V = 1 << 18,
50 PASTE_ALL_TYPES = (PASTE_CONTENTS | PASTE_FORMATS | PASTE_COMMENTS | PASTE_OBJECTS),
51 PASTE_DEFAULT = PASTE_ALL_TYPES
52 } GnmPasteFlags;
54 #define PASTE_OPER_MASK (PASTE_OPER_ADD | PASTE_OPER_SUB | PASTE_OPER_MULT | PASTE_OPER_DIV)
56 typedef struct {
57 GnmCellPos const offset; /* must be first element */
58 GnmValue *val;
59 GnmExprTop const *texpr;
60 } GnmCellCopy;
62 GType gnm_cell_copy_get_type (void);
64 struct _GnmCellRegion {
65 Sheet *origin_sheet; /* can be NULL */
66 const GODateConventions *date_conv; /* can be NULL */
67 GnmCellPos base;
68 int cols, rows;
69 ColRowStateList *col_state, *row_state;
70 GHashTable *cell_content;
71 GnmStyleList *styles;
72 GSList *merged;
73 GSList *objects;
74 gboolean not_as_contents;
76 unsigned ref_count;
79 struct _GnmPasteTarget {
80 Sheet *sheet;
81 GnmRange range;
82 GnmPasteFlags paste_flags;
85 GType gnm_paste_target_get_type (void);
87 GnmPasteTarget *gnm_paste_target_new (Sheet *sheet, GnmRange *r, GnmPasteFlags flags);
89 GnmCellRegion *clipboard_copy_range (Sheet *sheet, GnmRange const *r);
90 GOUndo *clipboard_copy_range_undo (Sheet *sheet, GnmRange const *r);
91 GOUndo *clipboard_copy_ranges_undo (Sheet *sheet, GSList *ranges);
92 GnmCellRegion *clipboard_copy_obj (Sheet *sheet, GSList *objects);
93 gboolean clipboard_paste_region (GnmCellRegion const *cr,
94 GnmPasteTarget const *pt,
95 GOCmdContext *cc);
96 GnmPasteTarget *paste_target_init (GnmPasteTarget *pt,
97 Sheet *sheet, GnmRange const *r,
98 GnmPasteFlags flags);
100 GType gnm_cell_region_get_type (void);
101 GnmCellRegion *gnm_cell_region_new (Sheet *origin_sheet);
102 GnmCellRegion *cellregion_ref (GnmCellRegion *cr);
103 void cellregion_unref (GnmCellRegion *cr);
104 GString *cellregion_to_string (GnmCellRegion const *cr,
105 gboolean only_visible,
106 GODateConventions const *date_conv);
107 int cellregion_cmd_size (GnmCellRegion const *cr);
108 void cellregion_invalidate_sheet (GnmCellRegion *cr, Sheet *sheet);
110 GnmCellCopy *gnm_cell_copy_new (GnmCellRegion *cr,
111 int col_offset, int row_offset);
113 void clipboard_init (void);
114 void clipboard_shutdown (void);
117 G_END_DECLS
119 #endif /* _GNM_CLIPBOARD_H_ */