mtmsexampleengine.h

来自「s60源码」· C头文件 代码 · 共 92 行

H
92
字号
#ifndef MTMS_EXAMPLE_ENGINE_H
#define MTMS_EXAMPLE_ENGINE_H

// INCLUDES

// System includes 
#include <e32base.h> // CBase
#include <msvapi.h>  // MMsvSessionObserver

// FORWARD DECLARATIONS
class CClientMtmRegistry;
class CMtmsExampleDialog;
class CSmsClientMtm;
class CMmsClientMtm;

// CLASS DECLARATION


class MMtmsExampleEngineObserver
    {
    public:
        virtual void HandleMessageSentL(TInt aError) = 0;
    };


/**
*
* @class    CMtmsExampleEngine MtmsExampleEngine.h 
* @brief    This is the engine class which handles all interactions with the messaging server
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/
class CMtmsExampleEngine : public CActive, public MMsvSessionObserver
    {
    public:
        static CMtmsExampleEngine* NewL(MMtmsExampleEngineObserver& aObserver);
        ~CMtmsExampleEngine();

    public:
        inline TBool IsReady() const;

        //  SMS
        void CreateDraftSMSL(const TDesC& aAddress);
        TBool ValidateSMS();
        void SendSMSL();

        //  MMS
        void CreateDraftMMSL(const TDesC& aAddress);
        TBool ValidateMMS();
        void SendMMSL();

    private:
        CMtmsExampleEngine(MMtmsExampleEngineObserver& aObserver);
        void ConstructL();
        void CompleteConstructL();

        void AddMMSAttachmentsL();

    private: // from CActive
        virtual void DoCancel();
        virtual void RunL();


    private: // from MMsvSessionObserver
        void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);

    private:
        MMtmsExampleEngineObserver& iObserver;
        CMsvOperation*      iOp;
        CMsvEntrySelection* iEntrySelection;

        CMsvSession*        iSession;              // Session to the messaging server
        CClientMtmRegistry* iMtmReg;
        CSmsClientMtm*      iSmsMtm;
        CMmsClientMtm*      iMmsMtm;
        TBool               iReady;

        TMsvId              iSmsId;
        TMsvId              iMmsId;
    };


inline TBool CMtmsExampleEngine::IsReady() const
    {
    return iReady;
    }

#endif  // #ifndef MTMS_EXAMPLE_ENGINE_H

// End of File

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?