]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * Copyright (c) 2000, Red Hat, Inc. | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * A copy of the GNU General Public License can be found at | |
10 | * http://www.gnu.org/ | |
11 | * | |
12 | * Written by Robert Collins <rbtcollins@hotmail.com> | |
13 | * | |
14 | */ | |
15 | ||
16 | #ifndef _CHOOSE_H_ | |
17 | #define _CHOOSE_H_ | |
18 | ||
19 | #include "ini.h" | |
20 | ||
21 | #define CATEGORY_EXPANDED 0 | |
22 | #define CATEGORY_COLLAPSED 1 | |
23 | ||
24 | ||
25 | struct _header | |
26 | { | |
27 | char *text; | |
28 | int slen; | |
29 | int width; | |
30 | int x; | |
31 | }; | |
32 | ||
33 | typedef class _view view; | |
34 | ||
35 | class pick_line | |
36 | { | |
37 | public: | |
38 | void set_line (Package *_pkg); | |
39 | void set_line (Category *_cat); | |
40 | void paint (HDC hdc, int x, int y, int row, int show_cat); | |
41 | Package *get_pkg (void) { return pkg; }; | |
42 | Category *get_category (void) { return cat; }; | |
43 | int click (int x); | |
44 | private: | |
45 | Package *pkg; | |
46 | Category *cat; | |
47 | }; | |
48 | ||
49 | class _view | |
50 | { | |
51 | public: | |
52 | int num_columns; | |
53 | views get_view_mode () { return view_mode; }; | |
54 | void set_view_mode(views _mode); | |
55 | struct _header *headers; | |
56 | _view (views mode, HDC dc); | |
57 | char *mode_caption (); | |
58 | void insert_pkg (Package *); | |
59 | void insert_category (Category *, int); | |
60 | void clear_view (void); | |
61 | int click (int row, int x); | |
62 | int current_col; | |
63 | int new_col; | |
64 | int src_col; | |
65 | int cat_col; | |
66 | int pkg_col; | |
67 | int last_col; | |
68 | pick_line * lines; | |
69 | int nlines; | |
70 | ||
71 | private: | |
72 | views view_mode; | |
73 | void set_headers (void); | |
74 | void init_headers (HDC dc); | |
75 | void insert_at (int, pick_line); | |
76 | void insert_under (int linen, pick_line line); | |
77 | ||
78 | }; | |
79 | ||
80 | #endif /* _CHOOSE_H_ */ |