examples/ForumNokia/S60_3rd_Edition_TextMTM_Example/modules/Install/src/TxtViewerStarter.h

00001 /*
00002 * ============================================================================
00003 *  Name     : ViewerStarter from MuiuMsgEditorLauncher.h
00004 *  Part of  : msgavkon\muiu
00005 *
00006 *  Description:
00007 *  Static class which launches editor application (provided editor
00008 *  conforms to \msgeditor architecture.
00009 *
00010 *
00011 *  Version:
00012 *
00013 *  Copyright (C) 2002 Nokia Corporation.
00014 *  This material, including documentation and any related 
00015 *  computer programs, is protected by copyright controlled by 
00016 *  Nokia Corporation. All rights are reserved. Copying, 
00017 *  including reproducing, storing,  adapting or translating, any 
00018 *  or all of this material requires the prior written consent of 
00019 *  Nokia Corporation. This material also contains confidential 
00020 *  information which may not be disclosed to others without the 
00021 *  prior written consent of Nokia Corporation.
00022 *
00023 * ============================================================================
00024 */
00025 
00026 
00027 #ifndef __MUIUMSGEDITORLAUNCHER_H__
00028 #define __MUIUMSGEDITORLAUNCHER_H__
00029 
00030 
00031 //  INCLUDES
00032 #include <apparc.h>
00033 #include <msvapi.h>
00034 #include <msvids.h>
00035 #include <MTCLBASE.H>   // TMsvPartList
00036 
00037 // CONSTANTS
00038 const TUid KUidMsvEditorParameterValue = {0x100014AA};
00039 
00040 
00041 // FORWARD DECLARATIONS (These declarations are for class ViewerStarter)
00042 class CEikDocument;
00043 class CCommandAbsorbingControl;
00044 class TEditorParameters;
00045 
00046 
00047 // CLASS DECLARATION
00048 
00052 class TEditorParameters
00053     {
00054     public:
00055         inline TEditorParameters();
00056         inline TEditorParameters( const TEditorParameters& aParams );
00057         inline void ExternalizeL( RWriteStream& aStream ) const;
00058         inline void InternalizeL( RReadStream& aStream );
00059     public:
00060         TMsvId  iId;
00061         TInt    iFlags;
00062         TMsvPartList iPartList;
00063         TMsvId iDestinationFolderId;
00064         TUid    iSpecialAppId;
00065     };
00066 
00070 enum TEditorFlags
00071     {
00072     EMsgReadOnly = 0x00010,
00073     EMsgSwitch = 0x00020,          // Internal
00074     EMsgEditorChanged = 0x00040,       // Internal
00075     EMsgCreateNewMessage = 0x00080,
00076     EMsgLaunchEditorThenWait = 0x00100,
00077     EMsgLaunchEditorEmbedded = 0x00200,
00078     EMsgForwardMessage = 0x01000,
00079     EMsgReplyToMessageSender = 0x02000,
00080     EMsgReplyToMessageAll = 0x04000,
00081     EMsgCreateMessageToService = 0x08000,
00082     EMsgEditNewMessage = 0x10000,
00083     EMsgPreviewMessage = 0x20000,
00084     EMsgCreateDuplicate = 0x40000,
00085     EMsgUnreadMessage = 0x80000,
00086     EMsgFirstFreeEditorSpecificFlag = 0x100000
00087     };
00088 
00089 inline TEditorParameters::TEditorParameters()
00090 :   iId( KMsvNullIndexEntryId ),
00091     iFlags( 0 ),
00092     iPartList( 0 ),
00093     iDestinationFolderId( KMsvNullIndexEntryId ),
00094     iSpecialAppId( TUid::Uid(0) )
00095     {}
00096 
00097 inline TEditorParameters::TEditorParameters( const TEditorParameters& aParams )
00098 :   iId( aParams.iId ),
00099     iFlags( aParams.iFlags ),
00100     iPartList( aParams.iPartList ),
00101     iDestinationFolderId( aParams.iDestinationFolderId ),
00102     iSpecialAppId( aParams.iSpecialAppId )
00103     {}
00104 
00105 inline void TEditorParameters::ExternalizeL( RWriteStream& aStream ) const
00106     {
00107     aStream.WriteInt32L( iId );
00108     aStream.WriteInt32L( iFlags );
00109     aStream.WriteInt32L( iPartList );
00110     aStream.WriteInt32L( iDestinationFolderId );
00111     }
00112 inline void TEditorParameters::InternalizeL( RReadStream& aStream )
00113     {
00114     iId = aStream.ReadInt32L();
00115     iFlags = aStream.ReadInt32L();
00116     iPartList = aStream.ReadInt32L();
00117     iDestinationFolderId = aStream.ReadInt32L();
00118     }
00119 
00120 
00121 // CLASS DECLARATION
00122 
00134 class ViewerStarter
00135     {
00136     public:
00137 
00147         IMPORT_C static CMsvOperation* LaunchEditorApplicationL(
00148             CMsvSession& aSession,
00149             TUid aMtmType,
00150             TRequestStatus& aStatus,
00151             const TEditorParameters& aParams,
00152             const TDesC& aAppName,
00153             const TDesC8* aAddtionalParams = NULL );
00154 
00165         IMPORT_C static CMsvOperation* LaunchEditorApplicationL(
00166             CMsvSession& aSession,
00167             TUid aMtmType,
00168             TRequestStatus& aStatus,
00169             const TEditorParameters& aParams,
00170             const TDesC& aAppName,
00171             const TDesC8& aProgressPack,
00172             const TDesC8* aAddtionalParams = NULL );
00173 
00174     private:
00178         static CMsvOperation* LaunchEditorApplicationEmbeddedL(
00179             CMsvSession& aSession,
00180             TUid aMtmType,
00181             TRequestStatus& aStatus,
00182             const TEditorParameters& aParams,
00183             const TDesC& aAppName,
00184             const TDesC8& aProgressPack );
00185 
00189         static CMsvOperation* LaunchEditorApplicationStandAloneL(
00190             CMsvSession& aSession,
00191             TUid aMtmType,
00192             TRequestStatus& aStatus,
00193             const TEditorParameters& aParams,
00194             const TDesC& aAppName,
00195             const TDesC8& aProgressPack,
00196             const TDesC8* aAddtionalParams,
00197             TBool aLaunchThenWait );
00198 
00209         static TUid DiscoverL( const TEditorParameters aParams );
00210 
00221         static TBool TryMatchL(  const TEditorParameters aParams, const TApaAppServiceInfo aInfo, TUid& aAppUid  );
00222 
00223     };
00224 
00225 
00231 class MsvUiEditorUtilities
00232     {
00233     public:
00234         IMPORT_C static HBufC* ResolveAppFileNameL( TUid aAppUid );
00235     };
00236 
00237 
00245 class MsgEditorServiceResolver
00246         {
00247         public:
00258         static TUid DiscoverL( const TEditorParameters aParams, TUid aMtmType );
00259 
00270         static TBool TryMatchL(  const TEditorParameters aParams, TUid aMtmType, const TApaAppServiceInfo aInfo, TUid& aAppUid  );
00271         };
00272 
00273 
00274 
00275 #endif // __MSGEDITORLAUNCHER_H__
00276 
00277 // End of file

Generated by  doxygen 1.6.2