ipsservices/ipssossettings/src/ipssetdataapi.cpp
branchRCL_3
changeset 16 b5fbb9b25d57
parent 8 e1b6206813b4
child 22 d620048b4810
--- a/ipsservices/ipssossettings/src/ipssetdataapi.cpp	Tue Apr 27 16:20:14 2010 +0300
+++ b/ipsservices/ipssossettings/src/ipssetdataapi.cpp	Tue May 11 15:57:15 2010 +0300
@@ -30,6 +30,7 @@
 #include <etel.h>                       // RTelServer
 #include <etelmm.h>                     // RMobilePhone
 #include <cemailaccounts.h>
+#include <txtrich.h>
 
 #include "ipssetdatastorer.h"
 #include "ipssetdata.h"
@@ -45,7 +46,7 @@
 #include "ipssetwizardadapter.h"
 
 #include "ipssetwizardsettingscenrepkeys.h" 
-
+#include "ipssetdatasignature.h"
 
 const TInt KIpsDataApiMaxPassLen = 256;
 const TInt KWizardDataPopIndicator = 0;
@@ -735,6 +736,31 @@
     
     CleanupStack::PopAndDestroy( 2, settingsData ); // dataManager
     }
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+EXPORT_C HBufC* CIpsSetDataApi::SignatureTextL( const TMsvEntry& aService )
+    {
+    FUNC_LOG;
+    HBufC* signatureText( NULL );
+    CIpsSetData* settingsData = CIpsSetData::NewLC();
+    CIpsSetDataManager* dataManager = CIpsSetDataManager::NewLC( iSession );
+    dataManager->LoadEmailSettingsL( aService, *settingsData );
+    // the IncludeSignature returns zero in case that inclusion is ON..
+    if ( !settingsData->IncludeSignature() )
+        {
+        CRichText* rText = settingsData->Signature().iRichText;
+        if ( rText )
+            {
+            signatureText = HBufC::NewL( KIpsSetUiMaxSettingsSignatureLength );
+            TPtr sPtr = signatureText->Des();
+            rText->Extract( sPtr, 0, KIpsSetUiMaxSettingsSignatureLength );
+            }
+        }
+    CleanupStack::PopAndDestroy( 2, settingsData ); // dataManager
+    return signatureText;
+    }
+
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 void CIpsSetDataApi::GetImapChildFoldersL(