GnuCash c935c2f+
Loading...
Searching...
No Matches
doclinkcell.h
Go to the documentation of this file.
1/********************************************************************\
2 * doclinkcell.h -- Document link checkbox cell *
3 * *
4 * This program is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU General Public License as *
6 * published by the Free Software Foundation; either version 2 of *
7 * the License, or (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License*
15 * along with this program; if not, contact: *
16 * *
17 * Free Software Foundation Voice: +1-617-542-5942 *
18 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19 * Boston, MA 02110-1301, USA gnu@gnu.org *
20 * *
21\********************************************************************/
22
32/* HISTORY:
33 * Copyright (c) 1998 Linas Vepstas
34 * Copyright (c) 2000 Dave Peticolas
35 * Copyright (c) 2001 Derek Atkins
36 * Copyright (c) 2020 Robert Fewell
37 */
38
39#ifndef DOC_LINK_CELL_H
40#define DOC_LINK_CELL_H
41
42#include <glib.h>
43
44#include "basiccell.h"
45
46#define GLYPH_PAPERCLIP "\360\237\223\216" // Codepoint U+1F4CE
47#define GLYPH_LINK "\360\237\224\227" // Codepoint U+1F517
48
49typedef const char * (*DoclinkcellStringGetter) (char flag);
50typedef gboolean (*DoclinkcellConfirm) (char old_flag, gpointer data);
51
52typedef struct
53{
54 BasicCell cell;
55
56 char flag;
58 char * valid_flags;
59 char * flag_order;
62 DoclinkcellStringGetter get_string;
63 DoclinkcellConfirm confirm_cb;
64 gpointer confirm_data;
65 gboolean read_only;
66 gboolean use_glyphs;
68
69BasicCell * gnc_doclink_cell_new (void);
70
71void gnc_doclink_cell_set_flag (Doclinkcell *cell, char flag);
72char gnc_doclink_cell_get_flag (Doclinkcell *cell);
73
74void gnc_doclink_cell_set_confirm_cb (Doclinkcell *cell,
75 DoclinkcellConfirm confirm_cb,
76 gpointer data);
77
78void gnc_doclink_cell_set_string_getter (Doclinkcell *cell,
79 DoclinkcellStringGetter getter);
80
87void gnc_doclink_cell_set_valid_flags (Doclinkcell *cell, const char *flags,
88 char default_flag);
89void gnc_doclink_cell_set_flag_order (Doclinkcell *cell, const char *flags);
90
91void gnc_doclink_cell_set_read_only (Doclinkcell *cell, gboolean read_only);
92
93void gnc_doclink_cell_set_use_glyphs (Doclinkcell *cell);
94
95gboolean gnc_doclink_get_use_glyphs (Doclinkcell *cell);
96
97const char * gnc_doclink_get_glyph_from_flag (char link_flag);
98
100#endif
void gnc_doclink_cell_set_valid_flags(Doclinkcell *cell, const char *flags, char default_flag)
note that
The Doclinkcell object implements a cell handler that will cycle through a series of single-character...
Definition doclinkcell.h:53
char * valid_flags
The actual flag value.
Definition doclinkcell.h:58
char * flag_order
The list of valid flags.
Definition doclinkcell.h:59
char default_flag
Automatic flag selection order.
Definition doclinkcell.h:60
DoclinkcellStringGetter get_string
Default flag for unknown user input.
Definition doclinkcell.h:62