2 * Samba Unix/Linux SMB client library
4 * Copyright (C) Christopher Davis 2014
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _REGEDIT_LIST_H_
21 #define _REGEDIT_LIST_H_
26 struct multilist_accessors
{
27 /* (optional) return the column header for col */
28 const char *(*get_column_header
)(const void *data
, unsigned col
);
30 /* return a pointer to the first row of data */
31 const void *(*get_first_row
)(const void *data
);
33 /* (optional) return a count of all data rows */
34 size_t (*get_row_count
)(const void *data
);
36 /* return the next row or NULL if there aren't any more */
37 const void *(*get_next_row
)(const void *data
, const void *row
);
39 /* (optional) return the previous row or NULL if row is on top. */
40 const void *(*get_prev_row
)(const void *data
, const void *row
);
42 /* (optional) return row n of data */
43 const void *(*get_row_n
)(const void *data
, size_t n
);
45 /* return the label for row and col */
46 const char *(*get_item_label
)(const void *row
, unsigned col
);
48 /* (optional) return a prefix string to be prepended to an item's
50 const char *(*get_item_prefix
)(const void *row
, unsigned col
);
53 struct multilist_column
{
55 unsigned int align_right
:1;
60 struct multilist
*multilist_new(TALLOC_CTX
*ctx
, WINDOW
*window
,
61 const struct multilist_accessors
*cb
,
63 struct multilist_column
*multilist_column_config(struct multilist
*list
,
65 WERROR
multilist_set_window(struct multilist
*list
, WINDOW
*window
);
66 const void *multilist_get_data(struct multilist
*list
);
67 WERROR
multilist_set_data(struct multilist
*list
, const void *data
);
68 void multilist_refresh(struct multilist
*list
);
78 void multilist_driver(struct multilist
*list
, int c
);
79 const void *multilist_get_current_row(struct multilist
*list
);
80 void multilist_set_current_row(struct multilist
*list
, const void *row
);