examples/ForumNokia/SMSExample/Engine/inc/SMSExampleMtmsEngine.h

00001 /*
00002  * Copyright © 2008 Nokia Corporation.
00003  */
00004 
00005 #ifndef SMS_EXAMPLE_ENGINE
00006 #define SMS_EXAMPLE_ENGINE
00007 
00008 // INCLUDES 
00009 #include <e32base.h> // CBase
00010 #include <msvapi.h>  // MMsvSessionObserver
00011 #include <badesca.h> // CDesCArrayFlat
00012 
00013 // FORWARD DECLARATIONS
00014 class CClientMtmRegistry;
00015 class CSmsClientMtm;
00016 class MSMSExampleMtmsEngineObserver;
00017 
00018 // CLASS DECLARATION
00019 
00024 class CSMSExampleMtmsEngine : public CActive, public MMsvSessionObserver
00025     {
00026     public:
00027        
00034         static CSMSExampleMtmsEngine* NewL(MSMSExampleMtmsEngineObserver& 
00035                                            aObserver);
00036         
00040         ~CSMSExampleMtmsEngine();
00041 
00042     public:
00043 
00049         void MoveToFolderL( TMsvId aMessageId,  TMsvId aFolder );
00050 
00055         void DeleteMessageL( TMsvId aMessageId );
00056 
00062         void CopyMessageL( TMsvId aMessageId, TMsvId aFolder );
00063 
00069         void GetMessageAddressL( TMsvId aMessageId, TDes& aAddress );
00070 
00078         TBool GetMessageL( TMsvId aMessageId, TDes& aMessage );
00079 
00087         TBool GetMessageIndexBodyTextL( TMsvId aMessageId, TDes& aMessage );
00088 
00094         void GetFolderSMSMessageInformationL( TMsvId aFolderID, 
00095                                               CDesCArrayFlat*& aAddresses, 
00096                                               CDesCArrayFlat*& aMessages );
00097 
00103         RArray<TMsvId>* GetMessageIds();
00104 
00105     private:
00110         CSMSExampleMtmsEngine(MSMSExampleMtmsEngineObserver& aObserver);
00111 
00115         void ConstructL();
00116 
00120         void CreateMtmClientL();
00121 
00122     private: // from CActive
00123         virtual void DoCancel();
00124         virtual void RunL();
00125 
00126 
00127     private: // from MMsvSessionObserver
00128         void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, 
00129                                  TAny* aArg2, TAny* aArg3);
00130 
00131     private:
00132 
00133         // SMS client MTM interface
00134         CSmsClientMtm*      iSmsMtm;
00135 
00136         // Observer of this engine.
00137         MSMSExampleMtmsEngineObserver& iObserver;
00138 
00139         // Controls asynchronous commands in the messaging system
00140         // Get progress information about the sending.
00141         CMsvOperation*      iMsvOper;
00142 
00143         // Encapsulates an array of entry IDs.
00144         CMsvEntrySelection* iEntrySelection;
00145 
00146         // Represents a session to the messaging server
00147         CMsvSession*        iSession;   
00148 
00149         // This registry holds details of the all the Client-side 
00150         // MTMs currently available on the system. 
00151         CClientMtmRegistry* iClientMtmReg;
00152        
00153         // Array of ids
00154         RArray<TMsvId>*     iIdArray;
00155        
00156         // Id of an SMS message
00157         TMsvId              iSmsId;
00158     };
00159 
00163 class MSMSExampleMtmsEngineObserver
00164     {
00165     public:
00166         virtual void HandleMessageSentL(TInt aError) = 0;
00167     };
00168 
00169 
00170 #endif  // SMS_EXAMPLE_ENGINE
00171 

Generated by  doxygen 1.6.2