00001 
00002 
00003 
00004 
00005 #ifndef SMSEXAMPLEAPPUI_H
00006 #define SMSEXAMPLEAPPUI_H
00007 
00008 
00009 #include <aknappui.h>
00010 #include <eikapp.h>
00011 #include <eikdoc.h>
00012 #include <e32std.h>
00013 #include <coeccntx.h>
00014 #include <aknViewAppUi.h>
00015 
00016 #include "SMSExample.hrh"
00017 #include "SMSExampleParser.h"
00018 #include "SMSEngine.h"
00019 
00020 
00021 class CSMSExampleRTEContainer;
00022 class CLogView;
00023 class CListboxView;
00024 
00025 
00026 
00031 class CSMSExampleAppUi : public CAknViewAppUi,
00032                          public MSmsEngineObserver
00033     {
00034     public: 
00035 
00039         void ConstructL();
00040 
00044         ~CSMSExampleAppUi();
00045 
00046     public: 
00047 
00052         TInt GetAddressL();
00053 
00058         TInt QueryMessageL();
00059 
00066         void QueryMessagesAndExecuteL(TInt aMode, TMsvId aOriginFolderID,
00067                                      TMsvId aDestinationFolderID);
00068 
00073         void ShowMessageL(const TDesC& aMsg) const;
00074 
00079         void ShowErrorL(TInt aErrorCode) const;
00080 
00081     public:
00085         void SendingMessage();
00086         void MessageSent();
00087         void MessageReceived(const TDesC& addr, const TDesC& msg);
00088         void SmsEngineInitialized();
00089         void SmsEngineError(TInt aErrorCode);
00090         void MessageDeleted(); 
00091 
00092 
00093     public:
00097         void HandleResourceChangeL(TInt aType);
00098 
00099     private:
00103         void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
00104 
00105     private:
00110         void HandleCommandL(TInt aCommand);
00111 
00118         virtual TKeyResponse HandleKeyEventL(
00119             const TKeyEvent& aKeyEvent,TEventCode aType);
00120 
00121     private:
00122         void HandleReceivedMessageL(const TDesC& aAddress, const TDesC& aMessage);
00123 
00124     private: 
00125 
00126         
00127         CLogView* iLogView;
00128 
00130         CListboxView* iListboxView;
00131 
00132         
00133         CSmsEngine* iSmsEngine;
00134 
00135         
00136         CSMSExampleParser* iParser;
00137 
00138         
00139         TBuf<EMtmsExampleMaxAddressLength> iAddress;
00140 
00141         
00142         TBuf<KSmsMessageLength> iMessage;
00143 
00144         
00145         TBool iAutomaticDelete;
00146 
00147     };
00148 
00149 #endif