phonebookengines/cntsimutility/tsrc/ut_cntsimutility/ut_mock_implementations.cpp
changeset 81 640d30f4fb64
equal deleted inserted replaced
77:c18f9fa7f42e 81:640d30f4fb64
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #include <QtTest/QtTest>
       
    43 #include <QObject>
       
    44 #include <qdebug.h>
       
    45 #include <qtcontacts.h>
       
    46 
       
    47 #include <mmtsy_names.h>
       
    48 #include "ut_cntsimutility.h"
       
    49 #include "cntsimutility.h"
       
    50  #include "centralrepository.h"
       
    51 #include <etelmm.h>
       
    52 #include <secui.h>
       
    53 #include <simutils.h>
       
    54 #include <e32property.h>
       
    55 RTelServer::RTelServer(  )
       
    56     {
       
    57     
       
    58     }
       
    59 TInt RTelServer::Connect( 
       
    60         TInt aMessageSlots )
       
    61     {
       
    62     if(true == TestCntSimUtility::returnErrorInStub_1)
       
    63         {
       
    64         return KErrGeneral;
       
    65         }
       
    66     return KErrNone;
       
    67     }
       
    68 
       
    69 
       
    70 TInt RTelServer::EnumeratePhones( 
       
    71         TInt & aNoOfPhones ) const
       
    72     {
       
    73 
       
    74     }
       
    75 
       
    76 TInt RTelServer::GetPhoneInfo( 
       
    77         const TInt aIndex,
       
    78         TPhoneInfo & aInfo ) const
       
    79     {
       
    80 
       
    81     if(true == TestCntSimUtility::returnErrorInStub_1)
       
    82         {
       
    83         return KErrGeneral;
       
    84         }
       
    85     return KErrNone;
       
    86     }
       
    87 
       
    88 
       
    89 TInt RTelServer::GetTsyName( 
       
    90         const TInt aIndexOfPhone,
       
    91         TDes & aTsyName ) const
       
    92     {
       
    93     }
       
    94 
       
    95 
       
    96 
       
    97 TInt RTelServer::LoadPhoneModule( 
       
    98         const TDesC & aFileName ) const
       
    99     {
       
   100 
       
   101     if(true == TestCntSimUtility::returnErrorInStub_1)
       
   102         {
       
   103         return KErrGeneral;
       
   104         }
       
   105     return KErrNone;
       
   106     }
       
   107 
       
   108 
       
   109 TInt RTelServer::UnloadPhoneModule( 
       
   110         const TDesC & aFileName ) const
       
   111     {
       
   112     }
       
   113 
       
   114 
       
   115 TInt RTelServer::IsSupportedByModule( 
       
   116         const TDesC & aTsyName,
       
   117         const TInt aMixin,
       
   118         TBool & aResult ) const
       
   119     {
       
   120     
       
   121     }
       
   122 
       
   123 
       
   124 TInt RTelServer::GetTsyVersionNumber( 
       
   125         const TDesC & aTsyName,
       
   126         TVersion & aVersion ) const
       
   127     {
       
   128     
       
   129     }
       
   130 
       
   131 
       
   132 
       
   133 TInt RTelServer::SetPriorityClient(  ) const
       
   134     {
       
   135     
       
   136     }
       
   137 
       
   138 
       
   139 TInt RTelServer::SetExtendedErrorGranularity( 
       
   140         const TErrorGranularity aGranularity ) const
       
   141     {
       
   142    
       
   143     }
       
   144 TInt RTelServer::__DbgMarkHeap(  )
       
   145     {
       
   146   
       
   147     }
       
   148 
       
   149 TInt RTelServer::__DbgCheckHeap( 
       
   150         TInt aCount )
       
   151     {
       
   152     
       
   153     }
       
   154 
       
   155 TInt RTelServer::__DbgMarkEnd( 
       
   156         TInt aCount )
       
   157     {
       
   158     
       
   159     }
       
   160 TInt RTelServer::__DbgFailNext( 
       
   161         TInt aCount )
       
   162     {
       
   163     
       
   164     }
       
   165 TInt RTelServer::__DbgFailNextAvailable( 
       
   166         TBool & aResult )
       
   167     {
       
   168     
       
   169     }
       
   170 TInt RTelServer::SetPriorityClientV2(  ) const
       
   171     {
       
   172     
       
   173     }
       
   174 RMobilePhone::RMobilePhone()
       
   175     {
       
   176     
       
   177     
       
   178     }
       
   179 TInt RMobilePhone::GetMultimodeCaps( 
       
   180         TUint32 & aCaps ) const
       
   181     {
       
   182    
       
   183     }
       
   184 void RMobilePhone::SetFdnSetting(TRequestStatus& aReqStatus, TMobilePhoneFdnSetting aFdnSetting) const
       
   185     {
       
   186         TRequestStatus* req = & aReqStatus;
       
   187         if(true == TestCntSimUtility::returnErrorInStub_1)
       
   188             {
       
   189             User::RequestComplete(req, KErrGeneral);
       
   190             }
       
   191         else
       
   192             {
       
   193             User::RequestComplete(req, KErrNone);    
       
   194             }
       
   195         
       
   196 
       
   197     
       
   198     }
       
   199 void RMobilePhone::NotifyFdnStatusChange(TRequestStatus& aReqStatus, TMobilePhoneFdnStatus& aFdnStatus) const
       
   200     {
       
   201     
       
   202     }
       
   203 
       
   204 TInt RMobilePhone::GetCurrentMode( 
       
   205         TMobilePhoneNetworkMode & aNetworkMode ) const
       
   206     {
       
   207    
       
   208     }
       
   209 
       
   210 
       
   211 TInt RMobilePhone::GetIccAccessCaps(TUint32 &acaps) const
       
   212     {
       
   213     if(true == TestCntSimUtility::returnErrorInStub_2)
       
   214            {
       
   215         return  KErrGeneral;
       
   216            }
       
   217     acaps = RMobilePhone::KCapsUSimAccessSupported;
       
   218     return  KErrNone;
       
   219     }
       
   220 void RMobilePhone::GetServiceTable(TRequestStatus& aReqStatus, TMobilePhoneServiceTable aTable, TDes8& aTableData) const
       
   221     {
       
   222 
       
   223     TRequestStatus* req = &aReqStatus;
       
   224     if(true == TestCntSimUtility::returnErrorInStub_1)
       
   225         {
       
   226         User::RequestComplete(req, KErrGeneral);
       
   227         }
       
   228     else
       
   229         {
       
   230         User::RequestComplete(req, KErrNone);    
       
   231         }
       
   232 
       
   233     }
       
   234 TInt RMobilePhone::GetFdnStatus(TMobilePhoneFdnStatus& aFdnStatus) const
       
   235 {
       
   236     if(false == TestCntSimUtility::returnErrorInStub_1)
       
   237         {
       
   238         aFdnStatus = RMobilePhone::EFdnActive ;
       
   239         return KErrNone;
       
   240     
       
   241         }
       
   242 
       
   243     aFdnStatus = RMobilePhone::EFdnNotActive ;
       
   244     return KErrGeneral;
       
   245 }
       
   246 void RMobilePhone::GetFdnStatus(TRequestStatus& aReqStatus, TMobilePhoneFdnStatus& aFdnStatus) const
       
   247 {
       
   248 
       
   249 }
       
   250 
       
   251 void RMobilePhone::GetSignalStrength( 
       
   252         TRequestStatus & aReqStatus,
       
   253         TInt32 & aSignalStrength,
       
   254         TInt8 & aBar ) const
       
   255     {
       
   256    
       
   257     }
       
   258 
       
   259 
       
   260 void RMobilePhone::NotifySignalStrengthChange( 
       
   261         TRequestStatus & aReqStatus,
       
   262         TInt32 & aSignalStrength,
       
   263         TInt8 & aBar ) const
       
   264     {
       
   265     }
       
   266 void RMobilePhone::GetSubscriberId(TRequestStatus& aReqStatus, TMobilePhoneSubscriberId& aId) const
       
   267     {
       
   268 
       
   269     TRequestStatus* req = & aReqStatus;
       
   270     if(true == TestCntSimUtility::returnErrorInStub_1)
       
   271         {
       
   272         User::RequestComplete(req, KErrGeneral);
       
   273         }
       
   274     else
       
   275         {
       
   276         User::RequestComplete(req, KErrNone);    
       
   277         }
       
   278 
       
   279     }
       
   280 void RMobilePhone::ConstructL()
       
   281     {
       
   282     
       
   283     }
       
   284 void RMobilePhone::Destruct()
       
   285     {
       
   286     
       
   287     }
       
   288 
       
   289 RMobilePhoneBookStore::RMobilePhoneBookStore ()
       
   290     {
       
   291     
       
   292     }
       
   293 
       
   294 void RMobilePhoneBookStore::Close ()
       
   295     {
       
   296     
       
   297     }
       
   298 
       
   299 RMobilePhoneBookStore::TMobilePhoneBookInfoV5::TMobilePhoneBookInfoV5()
       
   300     {
       
   301     
       
   302     }
       
   303 RMobilePhone::TMobilePhoneServiceTableV1::TMobilePhoneServiceTableV1()
       
   304     {
       
   305     
       
   306     }
       
   307 RMmCustomAPI::RMmCustomAPI()
       
   308     {
       
   309     
       
   310     }
       
   311 CSecuritySettings::CSecuritySettings()
       
   312             {
       
   313 
       
   314             }
       
   315 CSecuritySettings::~CSecuritySettings()
       
   316             {
       
   317 
       
   318             }
       
   319 CSecuritySettings* CSecuritySettings::NewL()
       
   320     {
       
   321     CSecuritySettings* self = new( ELeave ) CSecuritySettings;
       
   322         CleanupStack::PushL( self );
       
   323         //self->ConstructL()
       
   324         CleanupStack::Pop( self );
       
   325         return self;
       
   326     }
       
   327 TBool CSecuritySettings::AskPin2L()
       
   328     {
       
   329     return ETrue;
       
   330     }
       
   331 // ----
       
   332 
       
   333 
       
   334 
       
   335 CRepository * CRepository::NewL( 
       
   336         TUid aRepositoryUid )
       
   337     {
       
   338     
       
   339 
       
   340     CRepository* self = new( ELeave ) CRepository;
       
   341     CleanupStack::PushL( self );
       
   342     //self->ConstructL()
       
   343     CleanupStack::Pop( self );
       
   344     return self;
       
   345     }
       
   346 
       
   347 
       
   348 
       
   349 CRepository * CRepository::NewLC( 
       
   350         TUid aRepositoryUid )
       
   351     {
       
   352    
       
   353 
       
   354     CRepository* self = new( ELeave ) CRepository;
       
   355     CleanupStack::PushL( self );
       
   356     //self->ConstructL()
       
   357     return self;
       
   358     }
       
   359 
       
   360 
       
   361 
       
   362 CRepository::~CRepository(  )
       
   363     {
       
   364     
       
   365     }
       
   366 
       
   367 TInt CRepository::Get( 
       
   368         TUint32 aKey,
       
   369         TInt & aValue )
       
   370     {
       
   371     if(true == TestCntSimUtility::returnErrorInStub_1)
       
   372            {
       
   373            return KErrGeneral;
       
   374            }
       
   375        return KErrNone;
       
   376     
       
   377     }
       
   378 TInt CRepository::Get(TUint32 aKey,TDes16 &aValue)
       
   379     {
       
   380     if(true == TestCntSimUtility::returnErrorInStub_1)
       
   381            {
       
   382            return KErrGeneral;
       
   383            }
       
   384        return KErrNone;
       
   385     }
       
   386 
       
   387 TInt CRepository::Set(TUint32 aKey, const TDesC16& aValue)
       
   388     {
       
   389     if(true == TestCntSimUtility::returnErrorInStub_1)
       
   390            {
       
   391            return KErrGeneral;
       
   392            }
       
   393        return KErrNone;
       
   394     }
       
   395 TInt CRepository::Set(TUint32 aKey, TInt aValue)
       
   396     {
       
   397     if(true == TestCntSimUtility::returnErrorInStub_1)
       
   398            {
       
   399            return KErrGeneral;
       
   400            }
       
   401        return KErrNone;
       
   402     }
       
   403 
       
   404 TInt RProperty::Get(TUid aCategory, TUint aKey, TInt& aValue)
       
   405     {
       
   406     if(true == TestCntSimUtility::returnErrorInStub_1)
       
   407              {
       
   408              return KErrGeneral;
       
   409              aValue = ESimNotSupported;
       
   410              
       
   411              }
       
   412     aValue = ESimUsable;
       
   413     return KErrNone;
       
   414     }
       
   415 TSecUi::TSecUi(  )
       
   416     {
       
   417     
       
   418     }
       
   419 
       
   420 
       
   421 void TSecUi::ConstructL(  )
       
   422     {
       
   423     
       
   424     }
       
   425 
       
   426 
       
   427 
       
   428 void TSecUi::InitializeLibL(  )
       
   429     {
       
   430    
       
   431     }
       
   432 
       
   433 
       
   434 
       
   435 void TSecUi::UnInitializeLib(  )
       
   436     {
       
   437     }
       
   438 
       
   439 
       
   440 
       
   441 TBool TSecUi::CanBeFreed(  )
       
   442     {
       
   443     }
       
   444 
       
   445 
       
   446 
       
   447 void TSecUi::IncreaseClientCount(  )
       
   448     {
       
   449     }
       
   450 
       
   451 
       
   452 void TSecUi::DecreaseClientCount(  )
       
   453     {
       
   454     }
       
   455 
       
   456 
       
   457 RPhone::RPhone()
       
   458     {
       
   459     
       
   460       
       
   461 }
       
   462 void RPhone::Close()
       
   463     {
       
   464     
       
   465     }
       
   466 void RPhone::ConstructL()
       
   467     {
       
   468     
       
   469     }
       
   470 
       
   471 void RPhone::Destruct()
       
   472     {
       
   473     
       
   474     }
       
   475 RMobilePhoneStore::RMobilePhoneStore()
       
   476     {
       
   477     
       
   478     
       
   479     }
       
   480 
       
   481 void RMobilePhoneStore::GetInfo(TRequestStatus& aReqStatus, TDes8& aInfo) const
       
   482     {
       
   483     TRequestStatus* req = & aReqStatus;
       
   484     if(true == TestCntSimUtility::returnErrorInStub_1)
       
   485         {
       
   486         User::RequestComplete(req, KErrGeneral);
       
   487         }
       
   488     else
       
   489         {
       
   490         User::RequestComplete(req, KErrNone);    
       
   491         }
       
   492     
       
   493 
       
   494     
       
   495     
       
   496     }
       
   497 void RMmCustomAPI::GetPndCacheStatus( TRequestStatus& aStatus,
       
   498             RMmCustomAPI::TPndCacheStatus& aPndStatus,
       
   499             const TName& aPndName ) const
       
   500     {
       
   501     TRequestStatus* req = & aStatus;
       
   502     if(true == TestCntSimUtility::returnErrorInStub_1)
       
   503         {
       
   504         aPndStatus == RMmCustomAPI::ECacheNotReady;
       
   505         User::RequestComplete(req, KErrGeneral);
       
   506         }
       
   507     else
       
   508         {
       
   509         aPndStatus = RMmCustomAPI::ECacheReady; 
       
   510         User::RequestComplete(req, KErrNone);    
       
   511         }
       
   512     }
       
   513 void RMmCustomAPI::NotifyPndCacheReady( TRequestStatus& aStatus,
       
   514         TName& aPndName )
       
   515     {
       
   516     
       
   517     }
       
   518 int RMmCustomAPI::Open(RMobilePhone& aPhone)
       
   519     {
       
   520 
       
   521     if(true == TestCntSimUtility::returnErrorInStub_1)
       
   522         {
       
   523         return KErrGeneral;
       
   524         }
       
   525     return KErrNone;
       
   526     }
       
   527 RMobilePhoneBookStore::TMobilePhoneBookInfoV2::TMobilePhoneBookInfoV2()
       
   528     {
       
   529     
       
   530     }
       
   531 RMobilePhoneBookStore::TMobilePhoneBookInfoV1::TMobilePhoneBookInfoV1()
       
   532         {
       
   533         
       
   534         }
       
   535 RMobilePhoneBookStore::TMobilePhoneStoreInfoV1::TMobilePhoneStoreInfoV1()
       
   536     {
       
   537     
       
   538     }
       
   539 
       
   540 RTelSubSessionBase::RTelSubSessionBase()
       
   541     {
       
   542     
       
   543     }
       
   544 RMobilePhone::TMultimodeType::TMultimodeType()
       
   545     {
       
   546     
       
   547     }
       
   548 TInt RMobilePhoneBookStore::Open(RMobilePhone & aPhone, const TDesC& aStore)
       
   549     {
       
   550 
       
   551     if(true == TestCntSimUtility::returnErrorInStub_1)
       
   552         {
       
   553         return KErrGeneral;
       
   554         }
       
   555     return KErrNone;
       
   556     }
       
   557 TInt RPhone::Open(RTelServer& aServer, TDesC16 const & aDes)
       
   558     {
       
   559 
       
   560     if(true == TestCntSimUtility::returnErrorInStub_1)
       
   561         {
       
   562         return KErrGeneral;
       
   563         }
       
   564     return KErrNone;
       
   565     }