messagingapp/msgsettings/msginit/src/simscnumberdetector.cpp
changeset 52 12db4185673b
parent 44 36f374c67aa8
child 70 a15d9966050f
equal deleted inserted replaced
44:36f374c67aa8 52:12db4185673b
    26 #include <MessagingVariant.hrh>
    26 #include <MessagingVariant.hrh>
    27 #include <MessagingInternalCRKeys.h>    
    27 #include <MessagingInternalCRKeys.h>    
    28 #include <startupdomainpskeys.h>
    28 #include <startupdomainpskeys.h>
    29 #include <rcustomerserviceprofilecache.h>
    29 #include <rcustomerserviceprofilecache.h>
    30 
    30 
       
    31 #include "coutboxobserver.h"
    31 #include "simscnumberdetector.h"
    32 #include "simscnumberdetector.h"
    32 #include "startupmonitor.h"
    33 #include "startupmonitor.h"
    33 
    34 
    34 #include "debugtraces.h"
    35 #include "debugtraces.h"
    35 
    36 
    65 
    66 
    66     iCenRepSession = CRepository::NewL(KCRUidSmum);
    67     iCenRepSession = CRepository::NewL(KCRUidSmum);
    67 
    68 
    68     // initialise
    69     // initialise
    69     iMsvSession = CMsvSession::OpenSyncL(*this);
    70     iMsvSession = CMsvSession::OpenSyncL(*this);
       
    71    
       
    72     // Observes the OUTBOX for any offline messages...
       
    73     iOutBoxObserver = COutboxObserver::NewL();
    70 
    74 
    71     // Create the SMS Service	
    75     // Create the SMS Service	
    72     TMsvId serviceId = CreateSmsServiceL();
    76     TMsvId serviceId = CreateSmsServiceL();
    73 
    77 
    74     // Update the SMS cenrep with the default settings.
    78     // Update the SMS cenrep with the default settings.
    78     iSmsClientMtm = 
    82     iSmsClientMtm = 
    79     STATIC_CAST( CSmsClientMtm*, iClientRegistry->NewMtmL( KUidMsgTypeSMS )); 
    83     STATIC_CAST( CSmsClientMtm*, iClientRegistry->NewMtmL( KUidMsgTypeSMS )); 
    80 
    84 
    81     // Start the System state monitor
    85     // Start the System state monitor
    82     iStartupMonitor = CStartUpMonitor::NewL(this);
    86     iStartupMonitor = CStartUpMonitor::NewL(this);
       
    87     
       
    88     // Start the Auto-send AO, to handle offline SMS messages
       
    89     iOutBoxObserver->HandleMsvSessionReadyL(*iMsvSession);
    83 
    90 
    84     QDEBUG_WRITE("CMsgSimOperation::ConstructL exit")
    91     QDEBUG_WRITE("CMsgSimOperation::ConstructL exit")
    85     }
    92     }
    86 
    93 
    87 TMsvId CMsgSimOperation::CreateSmsServiceL()
    94 TMsvId CMsgSimOperation::CreateSmsServiceL()
   295     {
   302     {
   296     QDEBUG_WRITE("CMsgSimOperation::~CMsgSimOperation Enter") 
   303     QDEBUG_WRITE("CMsgSimOperation::~CMsgSimOperation Enter") 
   297     delete iSimOperation;
   304     delete iSimOperation;
   298     delete iSmsClientMtm;
   305     delete iSmsClientMtm;
   299     delete iClientRegistry;
   306     delete iClientRegistry;
       
   307     
       
   308     delete iOutBoxObserver;
       
   309     iOutBoxObserver = NULL;
       
   310     
   300     delete iMsvSession;
   311     delete iMsvSession;
   301     delete iStartupMonitor;
   312     delete iStartupMonitor;
   302     iStartupMonitor = NULL;
   313     iStartupMonitor = NULL;
   303     QDEBUG_WRITE("CMsgSimOperation::~CMsgSimOperation Exit") 
   314     QDEBUG_WRITE("CMsgSimOperation::~CMsgSimOperation Exit") 
   304     }
   315     }
   485         delete iSmsClientMtm;
   496         delete iSmsClientMtm;
   486         iSmsClientMtm = NULL;
   497         iSmsClientMtm = NULL;
   487 
   498 
   488         delete iClientRegistry;
   499         delete iClientRegistry;
   489         iClientRegistry = NULL;
   500         iClientRegistry = NULL;
   490 
   501         
       
   502         iOutBoxObserver->HandleMsvSessionClosedL();
       
   503         delete iOutBoxObserver;
       
   504         iOutBoxObserver = NULL;
       
   505         
   491         delete iMsvSession;
   506         delete iMsvSession;
   492         iMsvSession = NULL;
   507         iMsvSession = NULL;
   493 
   508 
   494         CompleteClientRequest(0);
   509         CompleteClientRequest(0);
   495         }
   510         }