phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/tsrc/ut_commlaunchercontacthandler/inc/ccappcommlauncherheaders.h
branchRCL_3
changeset 7 b3431bff8c19
parent 0 e686773b3f54
child 18 d4f567ce2e7c
equal deleted inserted replaced
6:e8e3147d53eb 7:b3431bff8c19
    19 #ifndef __CCAPPCOMMLAUNCHERHEADERS_H__
    19 #ifndef __CCAPPCOMMLAUNCHERHEADERS_H__
    20 #define __CCAPPCOMMLAUNCHERHEADERS_H__
    20 #define __CCAPPCOMMLAUNCHERHEADERS_H__
    21 
    21 
    22 // logfile definition
    22 // logfile definition
    23 #define KCommLauncherLogFile CCA_L("commlauncherplugin.txt")
    23 #define KCommLauncherLogFile CCA_L("commlauncherplugin.txt")
    24 #include "ccalogger.h"
       
    25 
    24 
    26 #include <e32base.h>
    25 #include <e32base.h>
    27 #include <centralrepository.h>
    26 #include <centralrepository.h>
    28 #include <vpbkfieldtypeselectorfactory.h>
    27 #include <vpbkfieldtypeselectorfactory.h>
    29 
    28 
       
    29 #include "ccalogger.h"
    30 #include "t_ccappcmscontactfetcher.h"
    30 #include "t_ccappcmscontactfetcher.h"
    31 #include "t_testsingleton.h"
    31 #include "t_testsingleton.h"
       
    32 #include "phonebookPrivateCRKeys.h"
    32 
    33 
    33 class CCmsContactFieldInfo;
    34 class CCmsContactFieldInfo;
    34 class MCCAppContactFieldDataObserver;
    35 class MCCAppContactFieldDataObserver;
    35 
    36 
    36 // used in CCmsContactFieldItem creation
    37 // used in CCmsContactFieldItem creation
    45 // test defines
    46 // test defines
    46 const TInt KTestNormal = 0;
    47 const TInt KTestNormal = 0;
    47 const TInt KTestContactInfoNull = 1;
    48 const TInt KTestContactInfoNull = 1;
    48 _LIT8( KTestString, "TestString" );
    49 _LIT8( KTestString, "TestString" );
    49 
    50 
    50 ////////////////////////////////////////////////
    51 // -----------------------------------------------------------------------------
    51 // MCCAppContactFieldDataObserver
    52 // MCCAppContactFieldDataObserver
    52 // Dummy interface
    53 // dummy class
    53 ////////////////////////////////////////////////
    54 // -----------------------------------------------------------------------------
    54 class MCCAppContactFieldDataObserver
    55 class MCCAppContactFieldDataObserver
    55     {
    56     {
    56 public:
    57 public:
    57 
    58 
    58     class TParameter
    59     class TParameter
    87     virtual void ContactFieldDataObserverHandleErrorL( 
    88     virtual void ContactFieldDataObserverHandleErrorL( 
    88         TInt aState, TInt aError ) = 0;
    89         TInt aState, TInt aError ) = 0;
    89 
    90 
    90     };    
    91     };    
    91 
    92 
    92 ////////////////////////////////////////////////
    93 // -----------------------------------------------------------------------------
    93 // CCmsContactField
    94 // CCmsContactFieldItem
    94 // Dummy class
    95 // dummy class
    95 ////////////////////////////////////////////////
    96 // -----------------------------------------------------------------------------
    96 class CCmsContactFieldItem : public CBase
    97 class CCmsContactFieldItem : public CBase
    97     {
    98     {
    98     public:  
    99     public:  
    99         
   100         
   100         enum TCmsContactField
   101         enum TCmsContactField
   200             ECmsDefaultTypePOC = 128,
   201             ECmsDefaultTypePOC = 128,
   201             ECmsDefaultTypeImpp = 256,
   202             ECmsDefaultTypeImpp = 256,
   202             ECmsDefaultTypeUrl = 512
   203             ECmsDefaultTypeUrl = 512
   203             };
   204             };
   204         
   205         
   205         TPtrC Data() const {};
   206         const TPtrC Data() const {return KNullDesC.operator ()().Left(0);}
   206     };
   207     };
   207 
   208 
   208 ////////////////////////////////////////////////
   209 // -----------------------------------------------------------------------------
   209 // CCmsContactField
   210 // CCmsContactField
   210 // Dummy class
   211 // dummy class
   211 ////////////////////////////////////////////////
   212 // -----------------------------------------------------------------------------
   212 class CCmsContactField : public CBase
   213 class CCmsContactField : public CBase
   213     {
   214     {
   214 public:
   215 public:
   215 
   216 
   216     CCmsContactField( TInt aType )
   217     CCmsContactField( TInt aType ):iType(aType){}
   217         {
   218     const CCmsContactFieldItem& ItemL( TInt /*aIndex*/) const;
   218         iType = aType;
   219     CCmsContactFieldItem::TCmsContactField Type() const;
   219         };
   220     TInt ItemCount() const{ return 1; }
   220 
   221     TInt HasDefaultAttribute() const;
   221     const CCmsContactFieldItem& ItemL( TInt /*aIndex*/) const {};    
   222     
   222     
   223 public: // data
   223     CCmsContactFieldItem::TCmsContactField Type() const
       
   224         {
       
   225         switch ( iType )
       
   226             {
       
   227             // phone
       
   228             case PHONE:
       
   229                 {
       
   230                 return CCmsContactFieldItem::ECmsLandPhoneHome;
       
   231                 break;
       
   232                 }
       
   233             // email
       
   234             case EMAIL:
       
   235                 {
       
   236                 return CCmsContactFieldItem::ECmsEmailWork;
       
   237                 break;
       
   238                 }
       
   239            // voip
       
   240             case VOIP:
       
   241                 {
       
   242                 return CCmsContactFieldItem::ECmsVoipNumberHome;
       
   243                 break;
       
   244                 }
       
   245             // phone
       
   246             case PHONE2:
       
   247                 {
       
   248                 return CCmsContactFieldItem::ECmsMobilePhoneHome;
       
   249                 break;
       
   250                 }
       
   251             // email
       
   252             case EMAIL2:
       
   253                 {
       
   254                 return CCmsContactFieldItem::ECmsEmailGeneric;
       
   255                 break;
       
   256                 }
       
   257            // voip
       
   258             case VOIP2:
       
   259                 {
       
   260                 return CCmsContactFieldItem::ECmsVoipNumberWork;
       
   261                 break;
       
   262                 }
       
   263             // name
       
   264             case NAME:
       
   265                 {
       
   266                 return CCmsContactFieldItem::ECmsLastName;
       
   267                 break;
       
   268                 }
       
   269             // default phone
       
   270             default:
       
   271                 {
       
   272                 return CCmsContactFieldItem::ECmsMobilePhoneWork;
       
   273                 break;
       
   274                 }
       
   275             }
       
   276         };
       
   277     TInt ItemCount() const
       
   278         {
       
   279         return 1;
       
   280         };
       
   281 
       
   282     TInt HasDefaultAttribute() const 
       
   283         { 
       
   284         TInt ret ( KErrNotFound );
       
   285         switch ( iType )
       
   286             {
       
   287             // phone
       
   288             case PHONE:
       
   289                 {
       
   290                 ret = CCmsContactFieldItem::ECmsDefaultTypePhoneNumber;
       
   291                 break;
       
   292                 }
       
   293             // email
       
   294             case EMAIL:
       
   295                 {
       
   296                 ret = CCmsContactFieldItem::ECmsDefaultTypeEmail;
       
   297                 break;
       
   298                 }
       
   299             // voip
       
   300             case VOIP:
       
   301                 {
       
   302                 ret = CCmsContactFieldItem::ECmsDefaultTypeVoIP;
       
   303                 break;
       
   304                 }
       
   305            // mms
       
   306             default:
       
   307                 {
       
   308                 ret = CCmsContactFieldItem::ECmsDefaultTypeMms;
       
   309                 break;
       
   310                 }
       
   311             }
       
   312 
       
   313         return ret;
       
   314         };
       
   315 
       
   316     TInt iDummyDefaultAttributeBitMask;
   224     TInt iDummyDefaultAttributeBitMask;
   317     TInt iDummy;
   225     TInt iDummy;
   318     TInt iType;
   226     TInt iType;
   319     };
   227     CCmsContactFieldItem* iCmsContactFieldItem;
   320 
   228     };
   321     
   229 
   322 ////////////////////////////////////////////////
   230 // -----------------------------------------------------------------------------
   323 // CCmsContactFieldInfo
   231 // CCmsContactFieldInfo
   324 // Dummy class
   232 // dummy class
   325 ////////////////////////////////////////////////
   233 // -----------------------------------------------------------------------------
   326 class CCmsContactFieldInfo : public CBase
   234 class CCmsContactFieldInfo : public CBase
   327     {
   235     {
   328 public:
   236 public:
   329     static CCmsContactFieldInfo* NewL()
   237     virtual ~CCmsContactFieldInfo();
   330         {
   238     static CCmsContactFieldInfo* NewL();
   331         CCmsContactFieldInfo* self = new (ELeave) CCmsContactFieldInfo();
   239     
   332         self->ConstructL();
   240     void AddMoreFields(); 
   333         return self;
   241     const RArray<CCmsContactFieldItem::TCmsContactField>& Fields() const 
   334         };
   242             { 
   335     void ConstructL()
   243             return *iArray;
   336         {
   244             }
   337         iArray = new (ELeave) RArray<CCmsContactFieldItem::TCmsContactField>();
   245 private:
   338         // phone
   246     CCmsContactFieldInfo(){}
   339         iArray->Append( CCmsContactFieldItem::ECmsMobilePhoneHome );
   247     void ConstructL();
   340         // email
   248     
   341         iArray->Append( CCmsContactFieldItem::ECmsEmailWork );
   249 public: // data
   342         // voip
       
   343         iArray->Append( CCmsContactFieldItem::ECmsVoipNumberHome );
       
   344         // not number
       
   345         iArray->Append( CCmsContactFieldItem::ECmsLastName );
       
   346         };
       
   347        
       
   348     void AddMoreFields()
       
   349         {
       
   350         // phone
       
   351         iArray->Append( CCmsContactFieldItem::ECmsLandPhoneHome );
       
   352         iArray->Append( CCmsContactFieldItem::ECmsMobilePhoneGeneric );
       
   353         iArray->Append( CCmsContactFieldItem::ECmsMobilePhoneHome );
       
   354         // email
       
   355         iArray->Append( CCmsContactFieldItem::ECmsEmailGeneric );
       
   356         iArray->Append( CCmsContactFieldItem::ECmsEmailHome );
       
   357         // voip
       
   358         iArray->Append( CCmsContactFieldItem::ECmsVoipNumberWork );
       
   359         // im
       
   360         iArray->Append( CCmsContactFieldItem::ECmsImpp );
       
   361         // url
       
   362         iArray->Append( CCmsContactFieldItem::ECmsUrlHome );
       
   363         }; 
       
   364     const RArray<CCmsContactFieldItem::TCmsContactField>& Fields() const { return *iArray; };
       
   365     ~CCmsContactFieldInfo()
       
   366         {
       
   367         iArray->Close();
       
   368         delete iArray;
       
   369         };
       
   370     TInt iDummy;
   250     TInt iDummy;
   371     RArray<CCmsContactFieldItem::TCmsContactField>* iArray;
   251     RArray<CCmsContactFieldItem::TCmsContactField>* iArray;
   372     };
   252     };
   373 
   253 
   374 #include "../../../inc/ccappcommlauncherprivatecrkeys.h"
   254 #include "../../../inc/ccappcommlauncherprivatecrkeys.h"
   375 #include "../../../inc/ccappcommlaunchercontacthandler.h"
   255 #include "../../../inc/ccappcommlaunchercontacthandler.h"
   376    
   256    
   377 ////////////////////////////////////////////////
   257 
       
   258 // -----------------------------------------------------------------------------
   378 // CCCAppCommLauncherView
   259 // CCCAppCommLauncherView
   379 // Dummy class
   260 // dummy class
   380 ////////////////////////////////////////////////
   261 // -----------------------------------------------------------------------------
   381 class CCCAppCommLauncherView : 
   262 class CCCAppCommLauncherView : public CBase,
   382     public CBase,
   263                                public MCCAppContactHandlerNotifier
   383     public MCCAppContactHandlerNotifier
   264     {
   384     {
   265 public:
   385 public:
   266 
   386 
   267     CCCAppCommLauncherView( /*CCCAppCommLauncherPlugin& aPlugin*/ )
   387     CCCAppCommLauncherView( /*CCCAppCommLauncherPlugin& aPlugin*/ ) /*: iPlugin( &aPlugin )*/
       
   388         {
   268         {
   389         iContactChangedNotifyCalled = EFalse;
   269         iContactChangedNotifyCalled = EFalse;
   390         iContactEnabledFieldsChangedNotifyCalled = EFalse;
   270         iContactEnabledFieldsChangedNotifyCalled = EFalse;
   391         };
   271         };
   392 
   272 
   413     // MCCAppContactHandlerNotifier
   293     // MCCAppContactHandlerNotifier
   414     void ContactFieldFetchingCompletedL(){};
   294     void ContactFieldFetchingCompletedL(){};
   415     // MCCAppContactHandlerNotifier
   295     // MCCAppContactHandlerNotifier
   416     void ContactsChangedL(){};
   296     void ContactsChangedL(){};
   417     // MCCAppContactHandlerNotifier
   297     // MCCAppContactHandlerNotifier
   418     void ContactPresenceChangedL( const CCmsContactField& /*aContactField*/){};
   298     void ContactPresenceChangedL( const CCmsContactField& /*aContactField*/){}
   419         
   299         
   420     TBool ContactChangedNotifyCalled()
   300     TBool ContactChangedNotifyCalled()
   421         {
   301         {
   422         return iContactChangedNotifyCalled;
   302         return iContactChangedNotifyCalled;
   423         };
   303         };
   429         {
   309         {
   430         iContactChangedNotifyCalled = EFalse;
   310         iContactChangedNotifyCalled = EFalse;
   431         iContactEnabledFieldsChangedNotifyCalled = EFalse;
   311         iContactEnabledFieldsChangedNotifyCalled = EFalse;
   432         };
   312         };
   433     
   313     
   434     //CCCAppCommLauncherPlugin& Plugin(){ return *iPlugin; };        
   314 public: // data
   435 
       
   436     //CCCAppCommLauncherPlugin* iPlugin;
       
   437     TBool iContactChangedNotifyCalled;
   315     TBool iContactChangedNotifyCalled;
   438     TBool iContactEnabledFieldsChangedNotifyCalled;
   316     TBool iContactEnabledFieldsChangedNotifyCalled;
   439     };    
   317     };
   440 
   318 
   441 ////////////////////////////////////////////////
   319 // -----------------------------------------------------------------------------
   442 // CCCAppCommLauncherPlugin
   320 // CCCAppCommLauncherPlugin
   443 // Dummy class
   321 // dummy class
   444 ////////////////////////////////////////////////
   322 // -----------------------------------------------------------------------------
   445 class CCCAppCommLauncherPlugin : 
   323 class CCCAppCommLauncherPlugin : public CBase
   446     public CBase
   324     {
   447     {
   325 public:
   448 
   326     
   449 public:
   327     CCCAppCommLauncherPlugin(){}
   450     
   328     ~CCCAppCommLauncherPlugin(){}
   451     CCCAppCommLauncherPlugin()
   329     static CCCAppCommLauncherPlugin* NewL();
   452     {      
   330 public:
   453     };
   331     void SetTitleL( const TDesC& /*aTitle*/ ){}
   454     
   332 
   455     ~CCCAppCommLauncherPlugin() 
   333     };
   456     {      
   334 
   457     };
   335 
   458     
       
   459     /*
       
   460      * Sets the title to the plugin
       
   461      * @param aTitle - title to be set     
       
   462      */
       
   463     void SetTitleL( const TDesC& aTitle )
       
   464     {      
       
   465     };
       
   466 
       
   467     };
       
   468     
       
   469     
       
   470     
       
   471 #endif // __CCAPPCOMMLAUNCHERHEADERS_H__
   336 #endif // __CCAPPCOMMLAUNCHERHEADERS_H__