summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/printcell_helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib/printcell_helper.h')
-rw-r--r--apps/plugins/lib/printcell_helper.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/apps/plugins/lib/printcell_helper.h b/apps/plugins/lib/printcell_helper.h
new file mode 100644
index 0000000000..adc98e5a5f
--- /dev/null
+++ b/apps/plugins/lib/printcell_helper.h
@@ -0,0 +1,45 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2021 William Wilgus
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _PRINTCELL_LIST_H_
23#define _PRINTCELL_LIST_H_
24#define PRINTCELL_MAXLINELEN MAX_PATH
25
26/* sets the printcell function enabled */
27void printcell_enable(struct gui_synclist *gui_list, bool enable, bool separator);
28
29/* sets title and calculates cell widths each column is identified by '$' character
30 ex 3 columns title = "Col1$Col2$Col3" also accepts $*WIDTH$
31 ex 3 columns varying width title = "$*64$Col1$*128$Col2$Col3
32 returns number of columns
33*/
34int printcell_set_columns(struct gui_synclist *gui_list,
35 char * title, enum themable_icons icon);
36
37/* increments the current selected column negative increment is allowed
38 returns the selected column
39 range: -1(no selection) to ncols - 1 */
40int printcell_increment_column(struct gui_synclist *gui_list, int increment, bool wrap);
41
42/* return the text of currently selected column buffer should be sized
43 * for max item len, buf[PRINTCELL_MAXLINELEN] is a safe bet */
44char *printcell_get_selected_column_text(struct gui_synclist *gui_list, char *buf, size_t bufsz);
45#endif /*_PRINTCELL_LIST_H_*/