mCtrl 0.8.2

mCtrl/value.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_VALUE_H
00020 #define MCTRL_VALUE_H
00021 
00022 #include <mCtrl/defs.h>
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028 
00136 typedef const void* MC_HVALUETYPE;
00137 
00142 typedef void* MC_HVALUE;
00143 
00144 
00151 #define MC_VALUETYPEID_UNDEFINED        0
00152 
00153 #define MC_VALUETYPEID_INT32            1
00154 
00155 #define MC_VALUETYPEID_UINT32           2
00156 
00157 #define MC_VALUETYPEID_INT64            3
00158 
00159 #define MC_VALUETYPEID_UINT64           4 
00160 
00161 #define MC_VALUETYPEID_STRINGW          5
00162 
00163 #define MC_VALUETYPEID_STRINGA          6
00164 
00165 #define MC_VALUETYPEID_IMMSTRINGW       7
00166 
00167 #define MC_VALUETYPEID_IMMSTRINGA       8
00168 
00169 #define MC_VALUETYPEID_COLORREF         9
00170 
00171 #define MC_VALUETYPEID_HICON           10
00172 
00181 MC_HVALUETYPE MCTRL_API mcValueType_GetBuiltin(int id);
00182 
00183 
00188 
00195 BOOL MCTRL_API mcValue_CreateFromInt32(MC_HVALUE* phValue, INT iValue);
00196 
00203 BOOL MCTRL_API mcValue_CreateFromUInt32(MC_HVALUE* phValue, UINT uValue);
00204 
00211 BOOL MCTRL_API mcValue_CreateFromInt64(MC_HVALUE* phValue, INT64 i64Value);
00212 
00219 BOOL MCTRL_API mcValue_CreateFromUInt64(MC_HVALUE* phValue, UINT64 u64Value);
00220 
00227 BOOL MCTRL_API mcValue_CreateFromStringW(MC_HVALUE* phValue, LPCWSTR lpStr);
00228 
00235 BOOL MCTRL_API mcValue_CreateFromStringA(MC_HVALUE* phValue, LPCSTR lpStr);
00236 
00243 BOOL MCTRL_API mcValue_CreateFromImmStringW(MC_HVALUE* phValue, LPCWSTR lpStr);
00244 
00251 BOOL MCTRL_API mcValue_CreateFromImmStringA(MC_HVALUE* phValue, LPCSTR lpStr);
00252 
00259 BOOL MCTRL_API mcValue_CreateFromColorref(MC_HVALUE* phValue, COLORREF crColor);
00260 
00267 BOOL MCTRL_API mcValue_CreateFromHIcon(MC_HVALUE* phValue, HICON hIcon);
00268 
00276 
00282 INT MCTRL_API mcValue_GetInt32(const MC_HVALUE hValue);
00283 
00289 UINT MCTRL_API mcValue_GetUInt32(const MC_HVALUE hValue);
00290 
00296 INT64 MCTRL_API mcValue_GetInt64(const MC_HVALUE hValue);
00297 
00303 UINT64 MCTRL_API mcValue_GetUInt64(const MC_HVALUE hValue);
00304 
00310 LPCWSTR MCTRL_API mcValue_GetStringW(const MC_HVALUE hValue);
00311 
00317 LPCSTR MCTRL_API mcValue_GetStringA(const MC_HVALUE hValue);
00318 
00324 LPCWSTR MCTRL_API mcValue_GetImmStringW(const MC_HVALUE hValue);
00325 
00331 LPCSTR MCTRL_API mcValue_GetImmStringA(const MC_HVALUE hValue);
00332 
00338 COLORREF MCTRL_API mcValue_GetColorref(const MC_HVALUE hValue);
00339 
00345 HICON MCTRL_API mcValue_GetHIcon(const MC_HVALUE hValue);
00346 
00354 
00362 BOOL MCTRL_API mcValue_Duplicate(MC_HVALUETYPE hType, MC_HVALUE* phDest, const MC_HVALUE hSrc);
00363 
00369 void MCTRL_API mcValue_Destroy(MC_HVALUETYPE hType, MC_HVALUE hValue);
00370 
00378 
00379 #ifdef UNICODE
00380 
00381     #define MC_VALUETYPEID_STRING        MC_VALUETYPEID_STRINGW
00382 
00383     #define MC_VALUETYPEID_IMMSTRING     MC_VALUETYPEID_IMMSTRINGW
00384 
00385     #define mcValue_CreateFromString      mcValue_CreateFromStringW
00386 
00387     #define mcValue_CreateFromImmString   mcValue_CreateFromImmStringW
00388 
00389     #define mcValue_GetString             mcValue_GetStringW
00390 
00391     #define mcValue_GetImmString          mcValue_GetImmStringW
00392 #else
00393     #define MC_VALUETYPEID_STRING         MC_VALUETYPEID_STRINGA
00394     #define MC_VALUETYPEID_IMMSTRING      MC_VALUETYPEID_IMMSTRINGA
00395     #define mcValue_CreateFromString      mcValue_CreateFromStringA
00396     #define mcValue_CreateFromImmString   mcValue_CreateFromImmStringA
00397     #define mcValue_GetString             mcValue_GetStringA
00398     #define mcValue_GetImmString          mcValue_GetImmStringA
00399 #endif
00400 
00404 #ifdef __cplusplus
00405 }  /* extern "C" */
00406 #endif
00407 
00408 #endif  /* MCTRL_VALUE_H */