mCtrl  0.9.5
table.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2013 Martin Mitas
3  *
4  * This library is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation; either version 2.1 of the License, or
7  * (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef MCTRL_TABLE_H
20 #define MCTRL_TABLE_H
21 
22 #include <mCtrl/_defs.h>
23 #include <mCtrl/_common.h>
24 #include <mCtrl/value.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 
50 typedef void* MC_HTABLE;
51 
52 
58 
60 #define MC_TCMF_VALUE 0x00000001
61 
62 #define MC_TCMF_FOREGROUND 0x00000002
63 
64 #define MC_TCMF_BACKGROUND 0x00000004
65 
66 #define MC_TCMF_FLAGS 0x00000008
67 
76 
78 #define MC_TCF_ALIGNDEFAULT 0x00000000
79 
80 #define MC_TCF_ALIGNLEFT 0x00000001
81 
82 #define MC_TCF_ALIGNCENTER 0x00000003
83 
84 #define MC_TCF_ALIGNRIGHT 0x00000002
85 
86 #define MC_TCF_ALIGNVDEFAULT 0x00000000
87 
88 #define MC_TCF_ALIGNTOP 0x00000004
89 
90 #define MC_TCF_ALIGNVCENTER 0x0000000C
91 
92 #define MC_TCF_ALIGNBOTTOM 0x00000008
93 
105 typedef struct MC_TABLECELL_tag {
107  DWORD fMask;
111  COLORREF crForeground;
113  COLORREF crBackground;
115  DWORD dwFlags;
116 } MC_TABLECELL;
117 
118 
123 
134 MC_HTABLE MCTRL_API mcTable_Create(WORD wColumnCount, WORD wRowCount,
135  DWORD dwReserved);
136 
142 void MCTRL_API mcTable_AddRef(MC_HTABLE hTable);
143 
152 void MCTRL_API mcTable_Release(MC_HTABLE hTable);
153 
160 WORD MCTRL_API mcTable_ColumnCount(MC_HTABLE hTable);
161 
168 WORD MCTRL_API mcTable_RowCount(MC_HTABLE hTable);
169 
183 BOOL MCTRL_API mcTable_Resize(MC_HTABLE hTable, WORD wColumnCount, WORD wRowCount);
184 
194 void MCTRL_API mcTable_Clear(MC_HTABLE hTable);
195 
212 BOOL MCTRL_API mcTable_SetValue(MC_HTABLE hTable, WORD wCol, WORD wRow,
213  MC_HVALUE value);
214 
227 const MC_HVALUE MCTRL_API mcTable_GetValue(MC_HTABLE hTable, WORD wCol, WORD wRow);
228 
242 MC_HVALUE MCTRL_API mcTable_SwapValue(MC_HTABLE hTable, WORD wCol, WORD wRow,
243  MC_HVALUE value);
244 
259 BOOL MCTRL_API mcTable_SetCell(MC_HTABLE hTable, WORD wCol, WORD wRow,
260  MC_TABLECELL* pCell);
261 
274 BOOL MCTRL_API mcTable_GetCell(MC_HTABLE hTable, WORD wCol, WORD wRow,
275  MC_TABLECELL* pCell);
276 
280 #ifdef __cplusplus
281 } /* extern "C" */
282 #endif
283 
284 #endif /* MCTRL_TABLE_H */