mCtrl  0.9.1
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/value.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
49 typedef void* MC_HTABLE;
50 
51 
57 
59 #define MC_TCMF_VALUE 0x00000001
60 
61 #define MC_TCMF_FOREGROUND 0x00000002
62 
63 #define MC_TCMF_BACKGROUND 0x00000004
64 
65 #define MC_TCMF_FLAGS 0x00000008
66 
75 
77 #define MC_TCF_ALIGNDEFAULT 0x00000000
78 
79 #define MC_TCF_ALIGNLEFT 0x00000001
80 
81 #define MC_TCF_ALIGNCENTER 0x00000003
82 
83 #define MC_TCF_ALIGNRIGHT 0x00000002
84 
85 #define MC_TCF_ALIGNVDEFAULT 0x00000000
86 
87 #define MC_TCF_ALIGNTOP 0x00000004
88 
89 #define MC_TCF_ALIGNVCENTER 0x0000000C
90 
91 #define MC_TCF_ALIGNBOTTOM 0x00000008
92 
104 typedef struct MC_TABLECELL_tag {
106  DWORD fMask;
110  COLORREF crForeground;
112  COLORREF crBackground;
114  DWORD dwFlags;
115 } MC_TABLECELL;
116 
117 
122 
133 MC_HTABLE MCTRL_API mcTable_Create(WORD wColumnCount, WORD wRowCount,
134  DWORD dwReserved);
135 
141 void MCTRL_API mcTable_AddRef(MC_HTABLE hTable);
142 
151 void MCTRL_API mcTable_Release(MC_HTABLE hTable);
152 
159 WORD MCTRL_API mcTable_ColumnCount(MC_HTABLE hTable);
160 
167 WORD MCTRL_API mcTable_RowCount(MC_HTABLE hTable);
168 
182 BOOL MCTRL_API mcTable_Resize(MC_HTABLE hTable, WORD wColumnCount, WORD wRowCount);
183 
193 void MCTRL_API mcTable_Clear(MC_HTABLE hTable);
194 
211 BOOL MCTRL_API mcTable_SetValue(MC_HTABLE hTable, WORD wCol, WORD wRow,
212  MC_HVALUE value);
213 
226 const MC_HVALUE MCTRL_API mcTable_GetValue(MC_HTABLE hTable, WORD wCol, WORD wRow);
227 
241 MC_HVALUE MCTRL_API mcTable_SwapValue(MC_HTABLE hTable, WORD wCol, WORD wRow,
242  MC_HVALUE value);
243 
258 BOOL MCTRL_API mcTable_SetCell(MC_HTABLE hTable, WORD wCol, WORD wRow,
259  MC_TABLECELL* pCell);
260 
273 BOOL MCTRL_API mcTable_GetCell(MC_HTABLE hTable, WORD wCol, WORD wRow,
274  MC_TABLECELL* pCell);
275 
279 #ifdef __cplusplus
280 } /* extern "C" */
281 #endif
282 
283 #endif /* MCTRL_TABLE_H */