phonebookui/Phonebook2/ccapplication/ccapp/tsrc/ut_cmscontactfetcher/inc/ccapputilheaders.h
branchRCL_3
changeset 21 b3431bff8c19
parent 0 e686773b3f54
child 64 c1e8ba0c2b16
equal deleted inserted replaced
15:e8e3147d53eb 21:b3431bff8c19
    52 
    52 
    53 //  P&S KEYS and categories
    53 //  P&S KEYS and categories
    54 const TUid KTestPropertyCat={0x10012349};  
    54 const TUid KTestPropertyCat={0x10012349};  
    55 enum TTestPropertyKeys 
    55 enum TTestPropertyKeys 
    56     {
    56     {
    57 	ETestCaseStateProperty = 1,
    57     ETestCaseStateProperty = 1,
    58     ETestParameterTypeProperty
    58     ETestParameterTypeProperty
    59     };    
    59     };    
       
    60 
       
    61 enum TCmsContactStore
       
    62     {    
       
    63     ECmsContactStorePbk = 0,
       
    64     ECmsContactStoreSim,
       
    65     ECmsContactStoreSdn
       
    66     };
       
    67 
       
    68 enum TCmsContactIdentifierType
       
    69     {    
       
    70     ECmsPackedContactLinkArray = 0
       
    71     };
    60 
    72 
    61 // used in CCmsContactFieldItem creation
    73 // used in CCmsContactFieldItem creation
    62 const TInt PHONE = 1;
    74 const TInt PHONE = 1;
    63 const TInt EMAIL = 2;
    75 const TInt EMAIL = 2;
    64 const TInt VOIP = 3;
    76 const TInt VOIP = 3;
    66 const TInt PHONE2 = 5;
    78 const TInt PHONE2 = 5;
    67 const TInt EMAIL2 = 6;
    79 const TInt EMAIL2 = 6;
    68 const TInt VOIP2 = 7;
    80 const TInt VOIP2 = 7;
    69 const TInt NAME = 8;
    81 const TInt NAME = 8;
    70 
    82 
    71 ///////////////////////////////////////////////////
    83 // -----------------------------------------------------------------------------
    72 // Dummy class interface
    84 // Dummy class 
    73 // MCCAParameter
    85 // MCCAParameter
    74 ///////////////////////////////////////////////////
    86 // -----------------------------------------------------------------------------
    75 class MCCAParameter
    87 class MCCAParameter
    76     {
    88     {
    77 
    89 
    78     public:
    90     public:
    79 
    91 
   121      */
   133      */
   122     virtual HBufC& ContactDataL() = 0;
   134     virtual HBufC& ContactDataL() = 0;
   123 
   135 
   124 
   136 
   125     };
   137     };
   126 ///////////////////////////////////////////////////
   138 // -----------------------------------------------------------------------------
   127 // Dummy class 
   139 // Dummy class 
   128 // CCCAParameter
   140 // CCCAParameter
   129 ///////////////////////////////////////////////////
   141 // -----------------------------------------------------------------------------
   130 class CCCAParameter : public CBase, 
   142 class CCCAParameter : public CBase, 
   131 					  public MCCAParameter
   143                       public MCCAParameter
   132     {
   144     {
   133 
   145 
   134 public:
   146 public:
   135     CCCAParameter()
   147     CCCAParameter()
   136         {
   148         {
   178     private:
   190     private:
   179     void ConstructL()
   191     void ConstructL()
   180         {
   192         {
   181         // get property using category and key
   193         // get property using category and key
   182         TInt type( MCCAParameter::EContactNone );
   194         TInt type( MCCAParameter::EContactNone );
   183         TInt err = RProperty::Get( KTestPropertyCat, ETestParameterTypeProperty, type );
   195         TInt err = RProperty::Get( 
       
   196                 KTestPropertyCat, ETestParameterTypeProperty, type );
   184 
   197 
   185         if ( KErrNone == err )
   198         if ( KErrNone == err )
   186             {
   199             {
   187             switch ( type )
   200             switch ( type )
   188                 {
   201                 {
   220 
   233 
   221     TContactDataFlags iContactDataFlag;    
   234     TContactDataFlags iContactDataFlag;    
   222     HBufC* iContactData;    
   235     HBufC* iContactData;    
   223 
   236 
   224     };
   237     };
   225 
   238     
   226 
   239     
   227 /** 
   240 // -----------------------------------------------------------------------------
   228 * Contact identifier.
   241 // Dummy class 
   229 */
   242 // CCmsContactBase
   230 enum TCmsContactIdentifierType
   243 // -----------------------------------------------------------------------------
   231     {    
       
   232     ECmsPackedContactLinkArray = 0
       
   233     };
       
   234     
       
   235     
       
   236 ///////////////////////////////////////////////////
       
   237 // Dummy class 
       
   238 // CCCAParameter
       
   239 ///////////////////////////////////////////////////
       
   240 class CCmsContactBase : public CBase
   244 class CCmsContactBase : public CBase
   241     {
   245     {
   242     public:
   246     public:
   243         CCmsContactBase(  )
   247         CCmsContactBase(  )
   244             {
   248             {
   248             
   252             
   249             };
   253             };
   250     };
   254     };
   251 
   255 
   252     
   256     
   253 // dummy class
   257 // -----------------------------------------------------------------------------
       
   258 // Dummy class 
       
   259 // CCmsContactField
       
   260 // -----------------------------------------------------------------------------
   254 class CCmsContactField : public CCmsContactBase
   261 class CCmsContactField : public CCmsContactBase
   255     {
   262     {
   256     public:
   263     public:
   257 
   264 
   258         CCmsContactField( TInt aType )
   265         CCmsContactField( TInt aType )
   330         TInt iDummyDefaultAttributeBitMask;
   337         TInt iDummyDefaultAttributeBitMask;
   331         TInt iDummy;
   338         TInt iDummy;
   332         TInt iType;
   339         TInt iType;
   333     };
   340     };
   334 
   341 
   335 ///////////////////////////////////////////////////
   342 // -----------------------------------------------------------------------------
   336 // Dummy class 
   343 // Dummy class 
   337 // CCCAParameter
   344 // CCmsContactFieldInfo
   338 ///////////////////////////////////////////////////
   345 // -----------------------------------------------------------------------------
   339 class CCmsContactFieldInfo : public CCmsContactBase
   346 class CCmsContactFieldInfo : public CCmsContactBase
   340     {
   347     {
   341 public:
   348 public:
   342     static CCmsContactFieldInfo* NewL()
   349     static CCmsContactFieldInfo* NewL()
   343         {
   350         {
   348     void ConstructL()
   355     void ConstructL()
   349         {
   356         {
   350         iArray = new (ELeave) RArray<CCmsContactFieldItem::TCmsContactField>();
   357         iArray = new (ELeave) RArray<CCmsContactFieldItem::TCmsContactField>();
   351         TInt testCase( 0 );
   358         TInt testCase( 0 );
   352         // get property using category and key
   359         // get property using category and key
   353         TInt err = RProperty::Get( KTestPropertyCat, ETestCaseStateProperty, testCase );
   360         TInt err = RProperty::Get( 
       
   361                 KTestPropertyCat, ETestCaseStateProperty, testCase );
   354 
   362 
   355         if ( KTestOneContactFieldItem == testCase
   363         if ( KTestOneContactFieldItem == testCase
   356              || KTestCompleteOpenWithError == testCase
   364              || KTestCompleteOpenWithError == testCase
   357              || KTestCompleteFetchWithError == testCase  )   
   365              || KTestCompleteFetchWithError == testCase  )   
   358             {
   366             {
   391     TInt iDummy;
   399     TInt iDummy;
   392     RArray<CCmsContactFieldItem::TCmsContactField>* iArray;
   400     RArray<CCmsContactFieldItem::TCmsContactField>* iArray;
   393     };
   401     };
   394    
   402    
   395 
   403 
   396 ///////////////////////////////////////////////////
   404 // -----------------------------------------------------------------------------
   397 // Dummy class 
   405 // Dummy class 
   398 // CCCAParameter
   406 // RCmsSession
   399 ///////////////////////////////////////////////////
   407 // -----------------------------------------------------------------------------
   400 class RCmsSession : public CBase
   408 class RCmsSession : public CBase
   401     {
   409     {
   402     public:
   410     public:
   403         RCmsSession()
   411         RCmsSession()
   404             {
   412             {
   413         void Close()
   421         void Close()
   414             {
   422             {
   415             };
   423             };
   416     };
   424     };
   417 
   425 
   418 ///////////////////////////////////////////////////
   426 // -----------------------------------------------------------------------------
   419 // Dummy class 
   427 // Dummy class 
   420 // RCmsContact
   428 // RCmsContact
   421 ///////////////////////////////////////////////////
   429 // -----------------------------------------------------------------------------
   422 enum TCmsContactStore
       
   423     {    
       
   424     ECmsContactStorePbk = 0,
       
   425     ECmsContactStoreSim,
       
   426     ECmsContactStoreSdn
       
   427     };
       
   428 
   430 
   429 class RCmsContact : public CBase 
   431 class RCmsContact : public CBase 
   430     {
   432     {
   431     public:  // New functions
   433     public:  // New functions
   432         
   434         RCmsContact() : iTopContact( ETrue ){}
   433         TInt Open( RCmsSession& /*aSession*/,
   435         TInt Open( RCmsSession& /*aSession*/,
   434                             TInt32 aContactId )
   436                             TInt32 aContactId )
   435             {
   437             {
   436             iDesDummy.AppendNum( aContactId );
   438             iDesDummy.AppendNum( aContactId );
   437             return KErrNone;
   439             return KErrNone;
   480           HBufC8* GetContactIdentifierL()
   482           HBufC8* GetContactIdentifierL()
   481               {
   483               {
   482               return NULL;
   484               return NULL;
   483               };
   485               };
   484 
   486 
   485           TBool IsServiceAvailable( VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector /*aContactAction*/ ) const
   487           TBool IsServiceAvailable( 
       
   488                   VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector 
       
   489                   /*aContactAction*/ ) const
   486               {
   490               {
   487               return ETrue;
   491               return ETrue;
   488               };
   492               };
   489           
   493           
   490           void OrderNotificationsL( 
   494           void OrderNotificationsL( 
   491                       MCmsNotificationHandlerAPI* /*aHandler*/,
   495                       MCmsNotificationHandlerAPI* /*aHandler*/,
   492                       CCmsContactFieldItem::TCmsContactNotification /*aNotificationType*/ )
   496                       CCmsContactFieldItem::TCmsContactNotification 
       
   497                       /*aNotificationType*/ )
   493               {
   498               {
   494               };
   499               };
   495                       
   500                       
   496           TCmsContactStore ContactStore() const
   501           TCmsContactStore ContactStore() const
   497               {
   502               {
   498               const_cast<TBool&>(iContactStore_called) = ETrue;
   503               const_cast<TBool&>(iContactStore_called) = ETrue;
       
   504               return ECmsContactStorePbk;
   499               };
   505               };
   500           
   506           
   501           void CancelNotifications( 
   507           void CancelNotifications( 
   502                       CCmsContactFieldItem::TCmsContactNotification /*aNotificationType*/ ) {};
   508                       CCmsContactFieldItem::TCmsContactNotification 
       
   509                       /*aNotificationType*/ ) {};
   503                      
   510                      
   504           void DeleteL(){};
   511           void DeleteL(){};
   505           
   512           
   506           ~RCmsContact(){};
   513           ~RCmsContact(){};
   507           
   514           
   508           TInt GetContactActionFieldCount(
   515           TInt GetContactActionFieldCount(
   509                   VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector /*aContactAction*/)
   516                   VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector 
   510               {
   517                   /*aContactAction*/)
   511               return ETrue; //SendReceive( ECmsGetContactActionFieldCount, TIpcArgs( aContactAction ) );
   518               {
       
   519               return ETrue; 
       
   520               }
       
   521           
       
   522           void SetVoiceCallDefault( TRequestStatus& aStatus ) const
       
   523               {
       
   524               aStatus = KRequestPending;
       
   525               }
       
   526           TBool IsTopContact()
       
   527               {
       
   528               return iTopContact;
   512               }
   529               }
   513 
   530 
   514     public:
   531     public:
   515                             
   532                             
   516     TRequestStatus* iStatus;
   533     TRequestStatus* iStatus;
   517     TBuf8<128> iDes8Dummy;                    
   534     TBuf8<128> iDes8Dummy;                    
   518     TBuf<128> iDesDummy;
   535     TBuf<128> iDesDummy;
   519     
   536     
   520     TBool iContactStore_called;
   537     TBool iContactStore_called;
       
   538     TBool iTopContact;
   521     };    
   539     };    
   522 
   540 
   523 #include "ccacmscontactfetcherwrapper.h"
   541 #include "ccacmscontactfetcherwrapper.h"
   524 
   542 
   525 #endif // __CCACLIENTHEADERS_H__
   543 #endif // __CCACLIENTHEADERS_H__