mds_plat/metadata_engine_api/inc/mdenumberproperty.inl
changeset 60 79f826a55db2
parent 0 c53acadfccc6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mds_plat/metadata_engine_api/inc/mdenumberproperty.inl	Wed Oct 06 15:08:08 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CMdENumberPropertys' compatible wrapper to CMdEProperty
+*
+*/
+
+
+#include <mdepropertydef.h>
+
+#define MDE_DEFINE_NUMBER_PROPERTY(PropertyType) \
+template<> inline T##PropertyType CMdENumberProperty< T##PropertyType >::Value() const \
+    { \
+    T##PropertyType value = NULL; \
+    TRAPD( err, value = PropertyType##ValueL() ); \
+	if( err != KErrNone ) \
+		{ \
+		_LIT( KCMdEPropertyGetValuePanic, "CMdE##PropertyType##Property::Value" ); \
+		User::Panic( KCMdEPropertyGetValuePanic, KErrNotSupported ); \
+		} \
+    return value; \
+    } \
+    template<> inline void CMdENumberProperty<T##PropertyType>::SetValueL(T##PropertyType aValue) \
+    { \
+    TRAPD( err, Set##PropertyType##ValueL( aValue ) ); \
+	if( err != KErrNone ) \
+		{ \
+		_LIT( KCMdEPropertySetValuePanic, "CMdE##PropertyType##Property::SetValueL" ); \
+		User::Panic( KCMdEPropertySetValuePanic, KErrNotSupported ); \
+		} \
+    }
+
+MDE_DEFINE_NUMBER_PROPERTY(Bool)
+MDE_DEFINE_NUMBER_PROPERTY(Int8)
+MDE_DEFINE_NUMBER_PROPERTY(Uint8)
+MDE_DEFINE_NUMBER_PROPERTY(Int16)
+MDE_DEFINE_NUMBER_PROPERTY(Uint16)
+MDE_DEFINE_NUMBER_PROPERTY(Int32)
+MDE_DEFINE_NUMBER_PROPERTY(Uint32)
+MDE_DEFINE_NUMBER_PROPERTY(Int64)
+MDE_DEFINE_NUMBER_PROPERTY(Real32)
+MDE_DEFINE_NUMBER_PROPERTY(Real64)
+MDE_DEFINE_NUMBER_PROPERTY(Time)
+
+#undef MDE_DEFINE_NUMBER_PROPERTY