textinput/ptienginev2/src/PtiKeyboardDatabase.cpp
changeset 0 eb1f2e154e89
child 9 e6a39382bb9c
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:   Keyboard database class implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <ecom/ecom.h>
       
    20 #include <PtiKeyboardDatabase.h>
       
    21 #include "PtiUids.hrh"
       
    22 #include <languages.hrh>
       
    23 
       
    24 //
       
    25 // LOCAl METHODS
       
    26 //
       
    27 
       
    28 void KDB_DBCleanup( TAny* aAny )
       
    29 	{
       
    30 	RImplInfoPtrArray* implArray = 
       
    31 		reinterpret_cast< RImplInfoPtrArray*> ( aAny );
       
    32 	implArray->ResetAndDestroy();
       
    33 	implArray->Close();
       
    34 	}
       
    35 				
       
    36 // ---------------------------------------------------------------------------
       
    37 // CPtiKeyboardDatabase::KdbData
       
    38 // 
       
    39 // ---------------------------------------------------------------------------
       
    40 // 				
       
    41 EXPORT_C TInt8* CPtiKeyboardDatabase::KdbData(TInt /*aNativeKdbId*/, TAny* /*aNativeParams*/) const
       
    42     {    
       
    43     return NULL;
       
    44     }
       
    45 		
       
    46 		
       
    47 // ---------------------------------------------------------------------------
       
    48 // CPtiKeyboardDatabase::LanguageCode
       
    49 // 
       
    50 // ---------------------------------------------------------------------------
       
    51 // 	
       
    52 EXPORT_C TInt CPtiKeyboardDatabase::LanguageCode() const
       
    53     {
       
    54     return ELangNone;
       
    55     }	
       
    56 	
       
    57 	
       
    58 // ---------------------------------------------------------------------------
       
    59 // CPtiKeyboardDatabase::LanguageCode
       
    60 // 
       
    61 // ---------------------------------------------------------------------------
       
    62 // 		
       
    63 EXPORT_C TInt CPtiKeyboardDatabase::NativeId() const
       
    64     {
       
    65     return 0;
       
    66     }			
       
    67 	
       
    68 	
       
    69 // ---------------------------------------------------------------------------
       
    70 // Reserved ordinals
       
    71 // 
       
    72 // ---------------------------------------------------------------------------
       
    73 // 			
       
    74 EXPORT_C void CPtiKeyboardDatabase::Reserved_1()
       
    75     {    
       
    76     }
       
    77         
       
    78 EXPORT_C void CPtiKeyboardDatabase::Reserved_2()
       
    79     {    
       
    80     }
       
    81 
       
    82 
       
    83 // ---------------------------------------------------------------------------
       
    84 // CPtiKeybaordDatabaseFactory::CreateMappingTableWithOpaqueL
       
    85 // 
       
    86 // ---------------------------------------------------------------------------
       
    87 // 	
       
    88 EXPORT_C TInt CPtiKeyboardDatabaseFactory::CreateMappingTableWithOpaqueL(TInt aInterfaceUid,
       
    89                                                   RArray<TPtiKeyboardDatabaseMappingOpaque>& aResult)
       
    90     {
       
    91 	TInt res = 0;
       
    92 	TPtiKeyboardDatabaseMappingOpaque map;	
       
    93 	RImplInfoPtrArray infoArray;
       
    94 	TInt i;
       
    95 
       
    96 	CleanupStack::PushL( TCleanupItem( KDB_DBCleanup, &infoArray ) );
       
    97 	REComSession::ListImplementationsL(TUid::Uid(aInterfaceUid), infoArray);
       
    98 	
       
    99 	for (i = 0; i < infoArray.Count(); i++)
       
   100 		{		
       
   101 		map.iUid = infoArray[i]->ImplementationUid().iUid;
       
   102 		map.iOpaque.Copy(infoArray[i]->OpaqueData().Left(KKdbOpaqueDataLen));					
       
   103 			
       
   104 		User::LeaveIfError(aResult.Append(map));
       
   105 		}
       
   106 		
       
   107 	CleanupStack::PopAndDestroy(); // infoArray    
       
   108 
       
   109 	return res;    
       
   110     }
       
   111 		
       
   112 // ---------------------------------------------------------------------------
       
   113 // CPtiKeybaordDatabaseFactory::CreateImplementationL
       
   114 // 
       
   115 // ---------------------------------------------------------------------------
       
   116 // 		
       
   117 EXPORT_C CPtiKeyboardDatabaseFactory* CPtiKeyboardDatabaseFactory::CreateImplementationL(const TUid aImplUid)
       
   118     {
       
   119 	TUid dtorIDKey;
       
   120 	CPtiKeyboardDatabaseFactory* iface = (CPtiKeyboardDatabaseFactory*)REComSession::CreateImplementationL(aImplUid, dtorIDKey);		
       
   121 	if (iface)
       
   122 		{
       
   123 		iface->SetDestructorKeyId(dtorIDKey.iUid);
       
   124 		iface->SetImplementationUid(aImplUid.iUid);
       
   125 		}
       
   126 	return iface;           
       
   127     }
       
   128 
       
   129 // ---------------------------------------------------------------------------
       
   130 // CPtiKeybaordDatabaseFactory::ListImplementationsL
       
   131 // 
       
   132 // ---------------------------------------------------------------------------
       
   133 // 			
       
   134 EXPORT_C void CPtiKeyboardDatabaseFactory::ListImplementationsL(TInt aCoreUid, 
       
   135                                                                 RArray<TInt>& aResult)
       
   136     {
       
   137 	RImplInfoPtrArray infoArray;
       
   138 	TInt i;
       
   139 
       
   140 	CleanupStack::PushL( TCleanupItem( KDB_DBCleanup, &infoArray ) );
       
   141 	REComSession::ListImplementationsL(TUid::Uid(aCoreUid), infoArray);
       
   142 
       
   143 	for (i = 0; i < infoArray.Count(); i++)
       
   144 		{
       
   145 		aResult.AppendL(infoArray[i]->ImplementationUid().iUid);
       
   146 		}
       
   147 
       
   148 	CleanupStack::PopAndDestroy(); // infoArray     
       
   149     }
       
   150         
       
   151 // ---------------------------------------------------------------------------
       
   152 // CPtiKeybaordDatabaseFactory::~CPtiKeybaordDatabaseFactory
       
   153 // 
       
   154 // ---------------------------------------------------------------------------
       
   155 // 	      
       
   156 EXPORT_C CPtiKeyboardDatabaseFactory::~CPtiKeyboardDatabaseFactory()
       
   157     {
       
   158 	REComSession::DestroyedImplementation(TUid::Uid(iDTorId));    
       
   159     }
       
   160 
       
   161 // ---------------------------------------------------------------------------
       
   162 // Reserved ordinals
       
   163 // 
       
   164 // ---------------------------------------------------------------------------
       
   165 // 	        
       
   166 EXPORT_C void CPtiKeyboardDatabaseFactory::Reserved_1()
       
   167     {    
       
   168     }
       
   169 	    
       
   170 	    
       
   171 EXPORT_C void CPtiKeyboardDatabaseFactory::Reserved_2()
       
   172     {     
       
   173     }
       
   174 
       
   175 // End of file
       
   176 
       
   177