vmbx/vmbxcpplugin/tsrc/src/ut_dummyvoicemailboxentry.cpp
changeset 19 e44a8c097b15
parent 13 e32024264ebb
equal deleted inserted replaced
15:d7fc66ccd6fb 19:e44a8c097b15
    16 */
    16 */
    17 
    17 
    18 // System includes
    18 // System includes
    19 #include <QtTest/QtTest>
    19 #include <QtTest/QtTest>
    20 #include <cvoicemailboxentry.h>
    20 #include <cvoicemailboxentry.h>
       
    21 // For global value
       
    22 #include "ut_vmbxuiengine.h"
    21 
    23 
    22 // CONSTANTS
    24 // CONSTANTS
    23 
    25 
    24 // ============================ MEMBER FUNCTIONS =============================
    26 // ============================ MEMBER FUNCTIONS =============================
    25 
    27 
   146 // ---------------------------------------------------------------------------
   148 // ---------------------------------------------------------------------------
   147 // CVoiceMailboxEntry::GetVmbxNumber
   149 // CVoiceMailboxEntry::GetVmbxNumber
   148 // Get number or address of the entry instance
   150 // Get number or address of the entry instance
   149 // ---------------------------------------------------------------------------
   151 // ---------------------------------------------------------------------------
   150 //
   152 //
   151 EXPORT_C TInt CVoiceMailboxEntry::GetVmbxNumber( TPtrC& aVmbxNumber ) const
   153 TInt CVoiceMailboxEntry::GetVmbxNumber( TPtrC& aVmbxNumber ) const
   152     {
   154     {
   153     qDebug("DummyVoiceMailboxEntry::GetVmbxNumber >");
   155     qDebug("DummyVoiceMailboxEntry::GetVmbxNumber >");
   154     TInt result( KErrNotFound );
   156     aVmbxNumber.Set(globalNumber.utf16());
   155     if ( ivmbxNumber )
   157     qDebug("DummyVoiceMailboxEntry::GetVmbxNumber %d", globalExpRet);
   156         {
   158     return globalExpRet;
   157         aVmbxNumber.Set( ivmbxNumber->Des() );
       
   158         qDebug("DummyVoiceMailboxEntry::GetVmbxNumber");
       
   159         result = KErrNone;
       
   160         }
       
   161     else
       
   162         {
       
   163         qDebug("DummyVoiceMailboxEntry::GetVmbxNumber:KNullDesC");
       
   164         aVmbxNumber.Set( KNullDesC );
       
   165         }
       
   166     qDebug("DummyVoiceMailboxEntry::GetVmbxNumber <");
       
   167     return result;
       
   168     }
   159     }
   169 
   160 
   170 // ---------------------------------------------------------------------------
   161 // ---------------------------------------------------------------------------
   171 // CVoiceMailboxEntry::SetVmbxNumber
   162 // CVoiceMailboxEntry::SetVmbxNumber
   172 // Set number or address of the entry instance
   163 // Set number or address of the entry instance
   173 // ---------------------------------------------------------------------------
   164 // ---------------------------------------------------------------------------
   174 //
   165 //
   175 EXPORT_C TInt CVoiceMailboxEntry::SetVmbxNumber( const TDesC& aVmbxNumber )
   166 TInt CVoiceMailboxEntry::SetVmbxNumber( const TDesC& aVmbxNumber )
   176     {
   167     {
   177     qDebug("DummyVoiceMailboxEntry::SetVmbxNumber >");
   168     qDebug("DummyVoiceMailboxEntry::SetVmbxNumber >");
   178     TInt result( KErrNoMemory );
   169     globalNumber = QString::fromUtf16(aVmbxNumber.Ptr(), aVmbxNumber.Length());
   179     if ( aVmbxNumber.Length() > KVmbxMaxNumberLength )
   170     qDebug("DummyVoiceMailboxEntry::SetVmbxNumber %d", globalExpRet);
   180         {
   171     return globalExpRet;
   181         result = KErrArgument;
       
   182         }
       
   183     else
       
   184         {
       
   185         delete ivmbxNumber;
       
   186         ivmbxNumber = aVmbxNumber.Alloc(); // Returns NULL if fails.
       
   187         if ( ivmbxNumber )
       
   188             {
       
   189             result = KErrNone;
       
   190             }
       
   191         }
       
   192     qDebug("DummyVoiceMailboxEntry::SetVmbxNumber <"); 
       
   193     return result;
       
   194     }
   172     }
   195 
   173 
   196 // ---------------------------------------------------------------------------
   174 // ---------------------------------------------------------------------------
   197 // CVoiceMailboxEntry::GetVmbxAlsLineType
   175 // CVoiceMailboxEntry::GetVmbxAlsLineType
   198 // Get Brand Id of the entry instance
   176 // Get Brand Id of the entry instance
   199 // ---------------------------------------------------------------------------
   177 // ---------------------------------------------------------------------------
   200 //
   178 //
   201 EXPORT_C TInt CVoiceMailboxEntry::GetBrandId( TPtrC8& aBrandId ) const
   179 TInt CVoiceMailboxEntry::GetBrandId( TPtrC8& aBrandId ) const
   202     {
   180     {
   203     qDebug("DummyVoiceMailboxEntry::GetBrandId >");
   181     qDebug("DummyVoiceMailboxEntry::GetBrandId >");
   204     TInt result( KErrNotFound ); 
   182     TInt result( KErrNotFound ); 
   205     if ( iVmbxBrandId )
   183     if ( iVmbxBrandId )
   206         {
   184         {