mCtrl 0.8.0

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 
00135 typedef const void* MC_VALUETYPE;
00136 
00141 typedef void* MC_VALUE;
00142 
00143 
00150 #define MC_VALUETYPE_ID_UNDEFINED        0
00151 
00152 #define MC_VALUETYPE_ID_INT32            1
00153 
00154 #define MC_VALUETYPE_ID_UINT32           2
00155 
00156 #define MC_VALUETYPE_ID_INT64            3
00157 
00158 #define MC_VALUETYPE_ID_UINT64           4 
00159 
00160 #define MC_VALUETYPE_ID_STRINGW          5
00161 
00162 #define MC_VALUETYPE_ID_STRINGA          6
00163 
00164 #define MC_VALUETYPE_ID_IMMSTRINGW       7
00165 
00166 #define MC_VALUETYPE_ID_IMMSTRINGA       8
00167 
00168 #define MC_VALUETYPE_ID_COLORREF         9
00169 
00171 #ifdef UNICODE
00172 
00176     #define MC_VALUETYPE_ID_STRING        MC_VALUETYPE_ID_STRINGW
00177 
00181     #define MC_VALUETYPE_ID_IMMSTRING     MC_VALUETYPE_ID_IMMSTRINGW
00182 #else
00183     #define MC_VALUETYPE_ID_STRING        MC_VALUETYPE_ID_STRINGA
00184     #define MC_VALUETYPE_ID_IMMSTRING     MC_VALUETYPE_ID_IMMSTRINGA
00185 #endif
00186 
00187 
00188 
00195 MC_VALUETYPE MCTRL_API mcValueType_GetBuiltin(int id);
00196 
00197 
00202 
00209 BOOL MCTRL_API mcValue_CreateFromInt32(MC_VALUE* phValue, INT iValue);
00210 
00217 BOOL MCTRL_API mcValue_CreateFromUInt32(MC_VALUE* phValue, UINT uValue);
00218 
00225 BOOL MCTRL_API mcValue_CreateFromInt64(MC_VALUE* phValue, INT64 i64Value);
00226 
00233 BOOL MCTRL_API mcValue_CreateFromUInt64(MC_VALUE* phValue, UINT64 u64Value);
00234 
00241 BOOL MCTRL_API mcValue_CreateFromStringW(MC_VALUE* phValue, LPCWSTR lpStr);
00242 
00249 BOOL MCTRL_API mcValue_CreateFromStringA(MC_VALUE* phValue, LPCSTR lpStr);
00250 
00257 BOOL MCTRL_API mcValue_CreateFromImmStringW(MC_VALUE* phValue, LPCWSTR lpStr);
00258 
00265 BOOL MCTRL_API mcValue_CreateFromImmStringA(MC_VALUE* phValue, LPCSTR lpStr);
00266 
00273 BOOL MCTRL_API mcValue_CreateFromColorref(MC_VALUE* phValue, COLORREF crColor);
00274 
00277 #ifdef UNICODE
00278 
00282     #define mcValue_CreateFromString      mcValue_CreateFromStringW
00283 
00287     #define mcValue_CreateFromImmString   mcValue_CreateFromImmStringW
00288 #else
00289     #define mcValue_CreateFromString      mcValue_CreateFromStringA
00290     #define mcValue_CreateFromImmString   mcValue_CreateFromImmStringA
00291 #endif
00292 
00293 
00298 
00304 INT MCTRL_API mcValue_GetInt32(const MC_VALUE hValue);
00305 
00311 UINT MCTRL_API mcValue_GetUInt32(const MC_VALUE hValue);
00312 
00318 INT64 MCTRL_API mcValue_GetInt64(const MC_VALUE hValue);
00319 
00325 UINT64 MCTRL_API mcValue_GetUInt64(const MC_VALUE hValue);
00326 
00332 LPCWSTR MCTRL_API mcValue_GetStringW(const MC_VALUE hValue);
00333 
00339 LPCSTR MCTRL_API mcValue_GetStringA(const MC_VALUE hValue);
00340 
00346 LPCWSTR MCTRL_API mcValue_GetImmStringW(const MC_VALUE hValue);
00347 
00353 LPCSTR MCTRL_API mcValue_GetImmStringA(const MC_VALUE hValue);
00354 
00360 COLORREF MCTRL_API mcValue_GetColorref(const MC_VALUE hValue);
00361 
00364 #ifdef UNICODE
00365 
00369     #define mcValue_GetString             mcValue_GetStringW
00370 
00374     #define mcValue_GetImmString          mcValue_GetImmStringW
00375 #else
00376     #define mcValue_GetString             mcValue_GetStringA
00377     #define mcValue_GetImmString          mcValue_GetImmStringA
00378 #endif
00379 
00380 
00385 
00393 BOOL MCTRL_API mcValue_Duplicate(MC_VALUETYPE hType, MC_VALUE* phDest, const MC_VALUE hSrc);
00394 
00400 void MCTRL_API mcValue_Destroy(MC_VALUETYPE hType, MC_VALUE hValue);
00401 
00405 #ifdef __cplusplus
00406 }  /* extern "C" */
00407 #endif
00408 
00409 #endif  /* MCTRL_VALUE_H */