WHATSNEW: Add release notes for Samba 4.1.14.
[Samba.git] / source3 / utils / regedit_treeview.h
blob39314418c6b1274fb29a85de3ed3181d40b4661a
1 /*
2 * Samba Unix/Linux SMB client library
3 * Registry Editor
4 * Copyright (C) Christopher Davis 2012
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_TREEVIEW_H_
21 #define _REGEDIT_TREEVIEW_H_
23 #include "includes.h"
24 #include <ncurses.h>
25 #include <menu.h>
26 #include <panel.h>
28 struct registry_key;
30 struct tree_node {
32 char *name;
33 char *label;
34 struct registry_key *key;
36 struct tree_node *parent;
37 struct tree_node *child_head;
38 struct tree_node *previous;
39 struct tree_node *next;
42 struct tree_view {
44 struct tree_node *root;
45 WINDOW *window;
46 PANEL *panel;
47 MENU *menu;
48 ITEM **current_items;
49 ITEM *empty[2];
52 struct tree_node *tree_node_new(TALLOC_CTX *ctx, struct tree_node *parent,
53 const char *name, struct registry_key *key);
54 void tree_node_append(struct tree_node *left, struct tree_node *right);
55 struct tree_node *tree_node_pop(struct tree_node **plist);
56 struct tree_node *tree_node_first(struct tree_node *list);
57 struct tree_node *tree_node_last(struct tree_node *list);
58 void tree_node_append_last(struct tree_node *list, struct tree_node *node);
59 void tree_node_free_recursive(struct tree_node *list);
60 size_t tree_node_print_path(WINDOW *label, struct tree_node *node);
61 struct tree_view *tree_view_new(TALLOC_CTX *ctx, struct tree_node *root,
62 int nlines, int ncols,
63 int begin_y, int begin_x);
64 void tree_view_resize(struct tree_view *view, int nlines, int ncols,
65 int begin_y, int begin_x);
66 void tree_view_show(struct tree_view *view);
67 void tree_view_clear(struct tree_view *view);
68 WERROR tree_view_update(struct tree_view *view, struct tree_node *list);
69 bool tree_node_has_children(struct tree_node *node);
70 WERROR tree_node_load_children(struct tree_node *node);
72 #endif