mCtrl  0.11.1
table.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2015 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 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
58 typedef void* MC_HTABLE;
59 
60 
72 #define MC_TABLE_HEADER 0xffff
73 
74 
80 
82 #define MC_TCMF_TEXT 0x00000001
83 
84 #define MC_TCMF_PARAM 0x00000004
85 
86 #define MC_TCMF_FLAGS 0x00000008
87 
96 
98 #define MC_TCF_ALIGNDEFAULT 0x00000000
99 
100 #define MC_TCF_ALIGNLEFT 0x00000001
101 
102 #define MC_TCF_ALIGNCENTER 0x00000003
103 
104 #define MC_TCF_ALIGNRIGHT 0x00000002
105 
106 #define MC_TCF_ALIGNVDEFAULT 0x00000000
107 
108 #define MC_TCF_ALIGNTOP 0x00000004
109 
110 #define MC_TCF_ALIGNVCENTER 0x0000000C
111 
112 #define MC_TCF_ALIGNBOTTOM 0x00000008
113 
115 #define MC_TCF_ALIGNMASKHORZ (MC_TCF_ALIGNDEFAULT | MC_TCF_ALIGNLEFT | \
116  MC_TCF_ALIGNCENTER | MC_TCF_ALIGNRIGHT)
117 
118 #define MC_TCF_ALIGNMASKVERT (MC_TCF_ALIGNVDEFAULT | MC_TCF_ALIGNTOP | \
119  MC_TCF_ALIGNVCENTER | MC_TCF_ALIGNBOTTOM)
120 
131 typedef struct MC_TABLECELLW_tag {
133  DWORD fMask;
135  WCHAR* pszText;
139  LPARAM lParam;
141  DWORD dwFlags;
142 } MC_TABLECELLW;
143 
144 
153 typedef struct MC_TABLECELLA_tag {
155  DWORD fMask;
157  char* pszText;
161  LPARAM lParam;
163  DWORD dwFlags;
164 } MC_TABLECELLA;
165 
166 
171 
182 MC_HTABLE MCTRL_API mcTable_Create(WORD wColumnCount, WORD wRowCount,
183  DWORD dwReserved);
184 
190 void MCTRL_API mcTable_AddRef(MC_HTABLE hTable);
191 
200 void MCTRL_API mcTable_Release(MC_HTABLE hTable);
201 
208 WORD MCTRL_API mcTable_ColumnCount(MC_HTABLE hTable);
209 
216 WORD MCTRL_API mcTable_RowCount(MC_HTABLE hTable);
217 
231 BOOL MCTRL_API mcTable_Resize(MC_HTABLE hTable, WORD wColumnCount, WORD wRowCount);
232 
246 void MCTRL_API mcTable_Clear(MC_HTABLE hTable, DWORD dwWhat);
247 
257 BOOL MCTRL_API mcTable_SetCellW(MC_HTABLE hTable, WORD wCol, WORD wRow,
258  MC_TABLECELLW* pCell);
259 
269 BOOL MCTRL_API mcTable_SetCellA(MC_HTABLE hTable, WORD wCol, WORD wRow,
270  MC_TABLECELLA* pCell);
271 
284 BOOL MCTRL_API mcTable_GetCellW(MC_HTABLE hTable, WORD wCol, WORD wRow,
285  MC_TABLECELLW* pCell);
286 
299 BOOL MCTRL_API mcTable_GetCellA(MC_HTABLE hTable, WORD wCol, WORD wRow,
300  MC_TABLECELLA* pCell);
301 
309 
311 #define MC_TABLECELL MCTRL_NAME_AW(MC_TABLECELL)
312 
313 #define mcTable_SetCell MCTRL_NAME_AW(mcTable_SetCell)
314 
315 #define mcTable_GetCell MCTRL_NAME_AW(mcTable_GetCell)
316 
319 #ifdef __cplusplus
320 } /* extern "C" */
321 #endif
322 
323 #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).
DWORD fMask
Definition: table.h:133
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:155
WORD mcTable_RowCount(MC_HTABLE hTable)
Retrieve count of table rows.
char * pszText
Definition: table.h:157
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:159
void mcTable_Clear(MC_HTABLE hTable, DWORD dwWhat)
Clear the table.
DWORD dwFlags
Definition: table.h:163
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:137
MC_HTABLE mcTable_Create(WORD wColumnCount, WORD wRowCount, DWORD dwReserved)
Create new table.
LPARAM lParam
Definition: table.h:161
WCHAR * pszText
Definition: table.h:135
DWORD dwFlags
Definition: table.h:141
Structure describing a table cell (ANSI variant).
Definition: table.h:153
Structure describing a table cell (Unicode variant).
Definition: table.h:131
WORD mcTable_ColumnCount(MC_HTABLE hTable)
Retrieve count of table columns.
void * MC_HTABLE
Opaque table handle.
Definition: table.h:58
LPARAM lParam
Definition: table.h:139
Common definitions.
Common constants and types.