mCtrl  0.9.7
table.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2014 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 
75 typedef void* MC_HTABLE;
76 
77 
89 #define MC_TABLE_HEADER 0xffff
90 
91 
97 
100 #define MC_TCMF_TEXT 0x00000001
101 
103 #define MC_TCMF_VALUE 0x00000002
104 
105 #define MC_TCMF_PARAM 0x00000004
106 
107 #define MC_TCMF_FLAGS 0x00000008
108 
117 
119 #define MC_TCF_ALIGNDEFAULT 0x00000000
120 
121 #define MC_TCF_ALIGNLEFT 0x00000001
122 
123 #define MC_TCF_ALIGNCENTER 0x00000003
124 
125 #define MC_TCF_ALIGNRIGHT 0x00000002
126 
127 #define MC_TCF_ALIGNVDEFAULT 0x00000000
128 
129 #define MC_TCF_ALIGNTOP 0x00000004
130 
131 #define MC_TCF_ALIGNVCENTER 0x0000000C
132 
133 #define MC_TCF_ALIGNBOTTOM 0x00000008
134 
146 typedef struct MC_TABLECELLW_tag {
148  DWORD fMask;
150  WCHAR* pszText;
156  LPARAM lParam;
158  DWORD dwFlags;
159 } MC_TABLECELLW;
160 
161 
170 typedef struct MC_TABLECELLA_tag {
172  DWORD fMask;
174  char* pszText;
180  LPARAM lParam;
182  DWORD dwFlags;
183 } MC_TABLECELLA;
184 
185 
190 
201 MC_HTABLE MCTRL_API mcTable_Create(WORD wColumnCount, WORD wRowCount,
202  DWORD dwReserved);
203 
209 void MCTRL_API mcTable_AddRef(MC_HTABLE hTable);
210 
219 void MCTRL_API mcTable_Release(MC_HTABLE hTable);
220 
227 WORD MCTRL_API mcTable_ColumnCount(MC_HTABLE hTable);
228 
235 WORD MCTRL_API mcTable_RowCount(MC_HTABLE hTable);
236 
250 BOOL MCTRL_API mcTable_Resize(MC_HTABLE hTable, WORD wColumnCount, WORD wRowCount);
251 
265 void MCTRL_API mcTable_Clear(MC_HTABLE hTable, DWORD dwWhat);
266 
276 BOOL MCTRL_API mcTable_SetCellW(MC_HTABLE hTable, WORD wCol, WORD wRow,
277  MC_TABLECELLW* pCell);
278 
288 BOOL MCTRL_API mcTable_SetCellA(MC_HTABLE hTable, WORD wCol, WORD wRow,
289  MC_TABLECELLA* pCell);
290 
303 BOOL MCTRL_API mcTable_GetCellW(MC_HTABLE hTable, WORD wCol, WORD wRow,
304  MC_TABLECELLW* pCell);
305 
318 BOOL MCTRL_API mcTable_GetCellA(MC_HTABLE hTable, WORD wCol, WORD wRow,
319  MC_TABLECELLA* pCell);
320 
328 
330 #define MC_TABLECELL MCTRL_NAME_AW(MC_TABLECELL)
331 
332 #define mcTable_SetCell MCTRL_NAME_AW(mcTable_SetCell)
333 
334 #define mcTable_GetCell MCTRL_NAME_AW(mcTable_GetCell)
335 
338 #ifdef __cplusplus
339 } /* extern "C" */
340 #endif
341 
342 #endif /* MCTRL_TABLE_H */
#define MCTRL_API
Definition: _defs.h:46
BOOL mcTable_GetCellW(MC_HTABLE hTable, WORD wCol, WORD wRow, MC_TABLECELLW *pCell)
Get contents of a cell (Unicode variant).
MC_HVALUE hValue
Definition: table.h:178
DWORD fMask
Definition: table.h:148
Structure describing a table cell (Unicode variant).
Definition: table.h:146
Structure describing a table cell (ANSI variant).
Definition: table.h:170
MC_HVALUE hValue
Definition: table.h:154
BOOL mcTable_SetCellA(MC_HTABLE hTable, WORD wCol, WORD wRow, MC_TABLECELLA *pCell)
Set contents of a cell (ANSI variant).
DWORD fMask
Definition: table.h:172
WORD mcTable_RowCount(MC_HTABLE hTable)
Retrieve count of table rows.
char * pszText
Definition: table.h:174
BOOL mcTable_GetCellA(MC_HTABLE hTable, WORD wCol, WORD wRow, MC_TABLECELLA *pCell)
Get contents of a cell (ANSI variant).
void mcTable_Release(MC_HTABLE hTable)
Decrement reference counter of the table.
BOOL mcTable_Resize(MC_HTABLE hTable, WORD wColumnCount, WORD wRowCount)
Resize the table.
int cchTextMax
Definition: table.h:176
void mcTable_Clear(MC_HTABLE hTable, DWORD dwWhat)
Clear the table.
DWORD dwFlags
Definition: table.h:182
void mcTable_AddRef(MC_HTABLE hTable)
Increment reference counter of the table.
BOOL mcTable_SetCellW(MC_HTABLE hTable, WORD wCol, WORD wRow, MC_TABLECELLW *pCell)
Set contents of a cell (Unicode variant).
int cchTextMax
Definition: table.h:152
MC_HTABLE mcTable_Create(WORD wColumnCount, WORD wRowCount, DWORD dwReserved)
Create new table.
LPARAM lParam
Definition: table.h:180
WCHAR * pszText
Definition: table.h:150
DWORD dwFlags
Definition: table.h:158
WORD mcTable_ColumnCount(MC_HTABLE hTable)
Retrieve count of table columns.
Polymorphic data (MC_HVALUETYPE and MC_HVALUE).
void * MC_HVALUE
Definition: value.h:119
void * MC_HTABLE
Opaque table handle.
Definition: table.h:75
LPARAM lParam
Definition: table.h:156
Common definitions.
Common constants and types.