imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_rproperty.cpp
branchRCL_3
changeset 28 3104fc151679
parent 27 2b7283837edb
child 29 9a48e301e94b
equal deleted inserted replaced
27:2b7283837edb 28:3104fc151679
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: s_rproperty.cpp
       
    15 *
       
    16 */
       
    17 #include <e32property.h>
       
    18 #include <e32base.h>
       
    19 
       
    20 
       
    21 TInt gKey = KErrNotFound;
       
    22 TInt gValue = KErrNotFound; 
       
    23 TRequestStatus gRequest = 0;
       
    24 /*
       
    25 	IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, TInt aPreallocate=0);
       
    26 	IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0);
       
    27 	IMPORT_C static TInt Define(TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0);
       
    28 	IMPORT_C static TInt Delete(TUid aCategory, TUint aKey);
       
    29 	IMPORT_C static TInt Delete(TUint aKey);
       
    30 	IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes8& aValue);
       
    31 #ifndef __KERNEL_MODE__
       
    32 	IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes16& aValue);
       
    33 #endif
       
    34 	IMPORT_C static TInt Set(TUid aCategory, TUint aKey, TInt aValue);
       
    35 	IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC8& aValue);
       
    36 #ifndef __KERNEL_MODE__
       
    37 	IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC16& aValue);
       
    38 #endif
       
    39 
       
    40 	IMPORT_C void Cancel();
       
    41 
       
    42 	IMPORT_C TInt Get(TInt& aValue);
       
    43 	IMPORT_C TInt Get(TDes8& aValue);
       
    44 #ifndef __KERNEL_MODE__
       
    45 	IMPORT_C TInt Get(TDes16& aValue);
       
    46 #endif
       
    47 	IMPORT_C TInt Set(TInt aValue);
       
    48 	IMPORT_C TInt Set(const TDesC8& aValue);
       
    49 #ifndef __KERNEL_MODE__
       
    50 	IMPORT_C TInt Set(const TDesC16& aValue);
       
    51 */
       
    52 
       
    53 TInt RProperty::Attach(TUid aCategory, TUint aKey, TOwnerType aType )
       
    54     {
       
    55     return KErrNone;
       
    56     }
       
    57 
       
    58 TInt RProperty::Set(TUid aCategory, TUint aKey, TInt aValue)
       
    59     {
       
    60     gKey = aKey;
       
    61     gValue = aValue;
       
    62 
       
    63     return KErrNone;
       
    64     }
       
    65 
       
    66 TInt RProperty::Get( TInt& aValue )
       
    67     {
       
    68     aValue = gValue;
       
    69 
       
    70     return KErrNone;
       
    71     }
       
    72 
       
    73 TInt RProperty::Get(TUid aCategory, TUint aKey, TInt& aValue)
       
    74     {
       
    75     if( aKey == gKey )
       
    76         {
       
    77         aValue = gValue;
       
    78         return KErrNone;
       
    79         }
       
    80 
       
    81     return KErrNotFound;
       
    82     }
       
    83            
       
    84 void RProperty::Subscribe(TRequestStatus& aRequest)
       
    85     {
       
    86     }
       
    87 
       
    88 void RProperty::Cancel()
       
    89     {
       
    90     }
       
    91 
       
    92 TInt RProperty::Define(TUid aCategory, TUint aKey, TInt aAttr, TInt aPreallocate/*=0*/)
       
    93 	{
       
    94 	return KErrNone;	
       
    95 	}
       
    96 	
       
    97 void RHandleBase::Close()
       
    98 {
       
    99 	
       
   100 }