mCtrl  0.8.4
table.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2011 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/value.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
93 typedef void* MC_HTABLE;
94 
95 
103 #define MC_TF_NOCELLFOREGROUND 0x00000001
104 
105 #define MC_TF_NOCELLBACKGROUND 0x00000002
106 
107 #define MC_TF_NOCELLFLAGS 0x00000004
108 
122 MC_HTABLE MCTRL_API mcTable_Create(WORD wColumnCount, WORD wRowCount,
123  MC_HVALUETYPE hType, DWORD dwFlags);
124 
130 void MCTRL_API mcTable_AddRef(MC_HTABLE hTable);
131 
140 void MCTRL_API mcTable_Release(MC_HTABLE hTable);
141 
148 WORD MCTRL_API mcTable_ColumnCount(MC_HTABLE hTable);
149 
156 WORD MCTRL_API mcTable_RowCount(MC_HTABLE hTable);
157 
171 BOOL MCTRL_API mcTable_Resize(MC_HTABLE hTable, WORD wColumnCount, WORD wRowCount);
172 
182 void MCTRL_API mcTable_Clear(MC_HTABLE hTable);
183 
205 BOOL MCTRL_API mcTable_SetCell(MC_HTABLE hTable, WORD wCol, WORD wRow,
206  MC_HVALUETYPE type, MC_HVALUE value);
207 
222 BOOL MCTRL_API mcTable_GetCell(MC_HTABLE hTable, WORD wCol, WORD wRow,
223  MC_HVALUETYPE* phType, MC_HVALUE* phValue);
224 
231 #define MC_TCM_VALUE 0x00000001
232 
233 #define MC_TCM_FOREGROUND 0x00000002
234 
235 #define MC_TCM_BACKGROUND 0x00000004
236 
237 #define MC_TCM_FLAGS 0x00000008
238 
246 #define MC_TCF_ALIGNDEFAULT 0x00000000
247 
248 #define MC_TCF_ALIGNLEFT 0x00000001
249 
250 #define MC_TCF_ALIGNCENTER 0x00000003
251 
252 #define MC_TCF_ALIGNRIGHT 0x00000002
253 
254 #define MC_TCF_ALIGNVDEFAULT 0x00000000
255 
256 #define MC_TCF_ALIGNTOP 0x00000004
257 
258 #define MC_TCF_ALIGNVCENTER 0x0000000C
259 
260 #define MC_TCF_ALIGNBOTTOM 0x00000008
261 
271 typedef struct MC_TABLECELL_tag {
273  DWORD fMask;
279  COLORREF crForeground;
281  COLORREF crBackground;
283  DWORD dwFlags;
284 } MC_TABLECELL;
285 
286 
303 BOOL MCTRL_API mcTable_SetCellEx(MC_HTABLE hTable, WORD wCol, WORD wRow,
304  MC_TABLECELL* pCell);
305 
320 BOOL MCTRL_API mcTable_GetCellEx(MC_HTABLE hTable, WORD wCol, WORD wRow,
321  MC_TABLECELL* pCell);
322 
323 
324 #ifdef __cplusplus
325 } /* extern "C" */
326 #endif
327 
328 #endif /* MCTRL_TABLE_H */