mCtrl 0.8.2

mCtrl/table.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2010-2011 Martin Mitas
00003  *
00004  * This library is free software; you can redistribute it and/or modify it
00005  * under the terms of the GNU Lesser General Public License as published by
00006  * the Free Software Foundation; either version 2.1 of the License, or
00007  * (at your option) any later version.
00008  * 
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU Lesser General Public License for more details.
00013  * 
00014  * You should have received a copy of the GNU Lesser General Public License
00015  * along with this library; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00017  */
00018 
00019 #ifndef MCTRL_TABLE_H
00020 #define MCTRL_TABLE_H
00021 
00022 #include <mCtrl/defs.h>
00023 #include <mCtrl/value.h>
00024 
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028 
00029 
00093 typedef void* MC_HTABLE;
00094 
00095 
00103 #define MC_TF_NOCELLFOREGROUND      0x00000001
00104 
00105 #define MC_TF_NOCELLBACKGROUND      0x00000002
00106 
00107 #define MC_TF_NOCELLFLAGS           0x00000004
00108 
00122 MC_HTABLE MCTRL_API mcTable_Create(WORD wColumnCount, WORD wRowCount,
00123                                    MC_HVALUETYPE hType, DWORD dwFlags);
00124 
00130 void MCTRL_API mcTable_AddRef(MC_HTABLE hTable);
00131 
00140 void MCTRL_API mcTable_Release(MC_HTABLE hTable);
00141 
00148 WORD MCTRL_API mcTable_ColumnCount(MC_HTABLE hTable);
00149 
00156 WORD MCTRL_API mcTable_RowCount(MC_HTABLE hTable);
00157 
00171 BOOL MCTRL_API mcTable_Resize(MC_HTABLE hTable, WORD wColumnCount, WORD wRowCount);
00172 
00182 void MCTRL_API mcTable_Clear(MC_HTABLE hTable);
00183 
00205 BOOL MCTRL_API mcTable_SetCell(MC_HTABLE hTable, WORD wCol, WORD wRow, 
00206                                MC_HVALUETYPE type, MC_HVALUE value);
00207 
00222 BOOL MCTRL_API mcTable_GetCell(MC_HTABLE hTable, WORD wCol, WORD wRow, 
00223                                MC_HVALUETYPE* phType, MC_HVALUE* phValue);
00224 
00232 #define MC_TCM_VALUE                0x00000001
00233 
00234 #define MC_TCM_FOREGROUND           0x00000002
00235 
00236 #define MC_TCM_BACKGROUND           0x00000004
00237 
00238 #define MC_TCM_FLAGS                0x00000008
00239 
00248 #define MC_TCF_ALIGNDEFAULT         0x00000000
00249 
00250 #define MC_TCF_ALIGNLEFT            0x00000001
00251 
00252 #define MC_TCF_ALIGNCENTER          0x00000003
00253 
00254 #define MC_TCF_ALIGNRIGHT           0x00000002
00255 
00256 #define MC_TCF_ALIGNVDEFAULT        0x00000000
00257 
00258 #define MC_TCF_ALIGNTOP             0x00000004
00259 
00260 #define MC_TCF_ALIGNVCENTER         0x0000000C
00261 
00262 #define MC_TCF_ALIGNBOTTOM          0x00000008
00263 
00273 typedef struct MC_TABLECELL_tag {
00275     DWORD fMask;
00277     MC_HVALUETYPE hType;
00279     MC_HVALUE hValue;
00281     COLORREF crForeground;
00283     COLORREF crBackground;
00285     DWORD dwFlags;
00286 } MC_TABLECELL;
00287 
00288 
00305 BOOL MCTRL_API mcTable_SetCellEx(MC_HTABLE hTable, WORD wCol, WORD wRow,
00306                                  MC_TABLECELL* pCell);
00307 
00322 BOOL MCTRL_API mcTable_GetCellEx(MC_HTABLE hTable, WORD wCol, WORD wRow,
00323                                  MC_TABLECELL* pCell);
00324 
00325 
00326 #ifdef __cplusplus
00327 }  /* extern "C" */
00328 #endif
00329 
00330 #endif  /* MCTRL_TABLE_H */