messagingapp/msgutils/unieditorutils/editorgenutils/src/UniEditorGenUtils.cpp
changeset 56 f42d9a78f435
parent 37 518b245aa84c
equal deleted inserted replaced
55:5b3b2fa8c3ec 56:f42d9a78f435
    20 #include <CoreApplicationUIsSDKCRKeys.h>  // offline CR keys
    20 #include <CoreApplicationUIsSDKCRKeys.h>  // offline CR keys
    21 #include <rcustomerserviceprofilecache.h>
    21 #include <rcustomerserviceprofilecache.h>
    22 #include <MmsEngineDomainCRKeys.h>
    22 #include <MmsEngineDomainCRKeys.h>
    23 #include <MsgMediaResolver.h>
    23 #include <MsgMediaResolver.h>
    24 #include <DRMHelper.h>
    24 #include <DRMHelper.h>
       
    25 #include <ccsdefs.h> // for KDefaultGsmNumberMatchLength
       
    26 #include <telconfigcrkeys.h> // for KCRUidTelephonyConfiguration
    25 
    27 
    26 #include "MessagingVariant.hrh"
    28 #include "MessagingVariant.hrh"
    27 #include "MessagingInternalCRKeys.h"  // Keys
    29 #include "MessagingInternalCRKeys.h"  // Keys
    28 #include "UniEditorGenUtils.h"
    30 #include "UniEditorGenUtils.h"
    29 #include <xqconversions.h>
    31 #include <xqconversions.h>
    45 // @see header
    47 // @see header
    46 // ----------------------------------------------------
    48 // ----------------------------------------------------
    47 UniEditorGenUtils::UniEditorGenUtils() :
    49 UniEditorGenUtils::UniEditorGenUtils() :
    48 mAbsMaxConcatenatedSms(-1),
    50 mAbsMaxConcatenatedSms(-1),
    49 mAbsMaxSmsCharacters(-1),
    51 mAbsMaxSmsCharacters(-1),
    50 mMaxMmsSize(-1)
    52 mMaxMmsSize(-1),
       
    53 mMatchDigitCount(-1)
    51 {
    54 {
    52 
    55 
    53 }
    56 }
    54 
    57 
    55 // ----------------------------------------------------
    58 // ----------------------------------------------------
   600     while ( ++c < length );
   603     while ( ++c < length );
   601   
   604   
   602     return ( aDomain[length-1] != '.' );
   605     return ( aDomain[length-1] != '.' );
   603     }
   606     }
   604 
   607 
       
   608 // ----------------------------------------------------
       
   609 // UniEditorGenUtils::MatchPhoneNumber
       
   610 // @see header
       
   611 // ----------------------------------------------------
       
   612 TBool UniEditorGenUtils::MatchPhoneNumberL(
       
   613         TDesC& aFirstNumber, TDesC& aSecondNumber)
       
   614     {
       
   615     // if matching digit count is already read from CR, then don't do that again
       
   616     if(mMatchDigitCount == -1)
       
   617         {
       
   618         mMatchDigitCount = KDefaultGsmNumberMatchLength;
       
   619         // Read the amount of digits to be used in contact matching
       
   620         // The key is owned by PhoneApp
       
   621         CRepository* repository = CRepository::NewL(KCRUidTelConfiguration);
       
   622         CleanupStack::PushL(repository);
       
   623         if (repository->Get(KTelMatchDigits, mMatchDigitCount) == KErrNone)
       
   624             {
       
   625             // Min is 7
       
   626             mMatchDigitCount = Max(mMatchDigitCount, KDefaultGsmNumberMatchLength);
       
   627             }
       
   628         CleanupStack::PopAndDestroy(); // repository
       
   629         }
       
   630     
       
   631     // start matching
       
   632     if( (aFirstNumber.Length() == 0) || (aSecondNumber.Length() == 0) )
       
   633         {
       
   634         return EFalse;
       
   635         }
       
   636     
       
   637     if (aFirstNumber.Right(mMatchDigitCount).CompareF(
       
   638             aSecondNumber.Right(mMatchDigitCount)) == 0)
       
   639         {
       
   640         return ETrue;
       
   641         }
       
   642     return EFalse;
       
   643     }
       
   644 
   605 // End of file
   645 // End of file