examples/ForumNokia/S60_3rd_Edition_TextMTM_Example/modules/Viewer/src/TxtViewerServiceSession.cpp

00001 
00002 
00003 #include "TxtViewerServiceSession.h"
00004 
00005 #include "../../UI/inc/TxtViewerService.h"
00006 
00007 
00008 #include <ApgCli.h>
00009 #include <eikenv.h>
00010 #include <eikappui.h>
00011 #include <mmsconst.h>
00012 #include <AknServerApp.h>
00013 #include <s32mem.h>
00014 #include "txtviewerdoc.h"
00015 const TInt KMemoryStoreBuffSize = 127;
00016 
00017 
00018 
00019 // ---------------------------------------------------------
00020 // CTxtViewerServiceSession
00021 // ---------------------------------------------------------
00022 //
00023 EXPORT_C CTxtViewerServiceSession::CTxtViewerServiceSession()
00024 : iDoc(CEikonEnv::Static()->EikAppUi()->Document())
00025         {       
00026         }
00027 
00028 // ---------------------------------------------------------
00029 // CTxtViewerServiceSession
00030 // ---------------------------------------------------------
00031 //
00032 CTxtViewerServiceSession::~CTxtViewerServiceSession()
00033         {
00034         }
00035 
00036 // ---------------------------------------------------------
00037 // CTxtViewerServiceSession::CreateL
00038 // ---------------------------------------------------------
00039 //
00040 void CTxtViewerServiceSession::CreateL()
00041         {
00042         CApaAppServiceBase::CreateL();          
00043         }
00044         
00045 // ---------------------------------------------------------
00046 // CTxtViewerServiceSession::ServiceL
00047 // ---------------------------------------------------------
00048 //
00049 void CTxtViewerServiceSession::ServiceL(const RMessage2& aMessage)
00050         {
00051         switch (aMessage.Function())
00052                 {
00053                 case ETxtViewerServiceCmdOpen:
00054                         OpenL(aMessage);
00055                         break;
00056 
00057 
00058                 default:
00059                         CApaAppServiceBase::ServiceL(aMessage);
00060                         break;
00061                 }               
00062         }
00063         
00064 // ---------------------------------------------------------
00065 // CTxtViewerServiceSession::ServiceError
00066 // ---------------------------------------------------------
00067 //
00068 void CTxtViewerServiceSession::ServiceError(const RMessage2& aMessage,TInt aError)
00069         {
00070         CApaAppServiceBase::ServiceError(aMessage, aError);             
00071         }
00072         
00073 // ---------------------------------------------------------
00074 // CTxtViewerServiceSession::OpenL
00075 // ---------------------------------------------------------
00076 //
00077 void CTxtViewerServiceSession::OpenL( const RMessage2& aMessage )
00078         {
00079         
00080         TEditorParameters params;
00081         params.iEntry = aMessage.Int0( );
00082         params.iOpenedForEditing= aMessage.Int1( );
00083         CTxtViewerDocument* doc = static_cast<CTxtViewerDocument*>(iDoc);
00084          
00085         doc->SetId(params.iEntry);
00086         doc->SetOpenedForEditing(params.iOpenedForEditing);
00087    
00088         doc->SetMessage(aMessage);
00089         doc->InitializeL();
00090         aMessage.Complete(KErrNone);
00091    
00092         }

Generated by  doxygen 1.6.2