xref: /reactos/base/setup/usetup/genlist.h (revision 8a978a17)
1 /*
2  *  ReactOS kernel
3  *  Copyright (C) 2004 ReactOS Team
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License along
16  *  with this program; if not, write to the Free Software Foundation, Inc.,
17  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 /*
20  * COPYRIGHT:       See COPYING in the top level directory
21  * PROJECT:         ReactOS text-mode setup
22  * FILE:            base/setup/usetup/genlist.h
23  * PURPOSE:         Generic list functions
24  * PROGRAMMER:
25  */
26 
27 #pragma once
28 
29 // #include "../lib/utils/genlist.h"
30 
31 typedef NTSTATUS
32 (NTAPI *PGET_ENTRY_DESCRIPTION)(
33     IN PGENERIC_LIST_ENTRY Entry,
34     OUT PSTR Buffer,
35     IN SIZE_T cchBufferSize);
36 
37 typedef struct _GENERIC_LIST_UI
38 {
39     PGENERIC_LIST List;
40 
41     PLIST_ENTRY FirstShown;
42     PLIST_ENTRY LastShown;
43     PGENERIC_LIST_ENTRY BackupEntry;
44 
45     PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc;
46 
47     SHORT Left;
48     SHORT Top;
49     SHORT Right;
50     SHORT Bottom;
51     BOOL Redraw;
52 
53     CHAR CurrentItemText[256];
54 
55 } GENERIC_LIST_UI, *PGENERIC_LIST_UI;
56 
57 VOID
58 InitGenericListUi(
59     IN OUT PGENERIC_LIST_UI ListUi,
60     IN PGENERIC_LIST List,
61     IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc);
62 
63 VOID
64 RestoreGenericListUiState(
65     IN PGENERIC_LIST_UI ListUi);
66 
67 VOID
68 DrawGenericList(
69     IN PGENERIC_LIST_UI ListUi,
70     IN SHORT Left,
71     IN SHORT Top,
72     IN SHORT Right,
73     IN SHORT Bottom);
74 
75 VOID
76 DrawGenericListCurrentItem(
77     IN PGENERIC_LIST List,
78     IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc,
79     IN SHORT Left,
80     IN SHORT Top);
81 
82 VOID
83 ScrollDownGenericList(
84     IN PGENERIC_LIST_UI ListUi);
85 
86 VOID
87 ScrollUpGenericList(
88     IN PGENERIC_LIST_UI ListUi);
89 
90 VOID
91 ScrollPageDownGenericList(
92     IN PGENERIC_LIST_UI ListUi);
93 
94 VOID
95 ScrollPageUpGenericList(
96     IN PGENERIC_LIST_UI ListUi);
97 
98 VOID
99 ScrollToPositionGenericList(
100     IN PGENERIC_LIST_UI ListUi,
101     IN ULONG uIndex);
102 
103 VOID
104 RedrawGenericList(
105     IN PGENERIC_LIST_UI ListUi);
106 
107 VOID
108 GenericListKeyPress(
109     IN PGENERIC_LIST_UI ListUi,
110     IN CHAR AsciiChar);
111 
112 /* EOF */
113