pushmtm/MtmUiInc/PushMtmUi.h
branchRCL_3
changeset 65 8e6fa1719340
equal deleted inserted replaced
64:6385c4c93049 65:8e6fa1719340
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Ui Mtm class declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef PUSHMTMUI_H
       
    21 #define PUSHMTMUI_H
       
    22 
       
    23 // INCLUDE FILES
       
    24 
       
    25 #include <mtmuibas.h>
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30 * UI MTM for pushed messages.
       
    31 */
       
    32 class CPushMtmUi: public CBaseMtmUi
       
    33     {
       
    34     public:     // Constructors and destructor
       
    35 
       
    36         /**
       
    37         * Two-phased constructor (exported factory function).
       
    38         * Leaves on failure.
       
    39         * @param aBaseMtm The client MTM.
       
    40         * @param aRegisteredMtmDll Registration data for the MTM DLL.
       
    41         * @return The constructed UI.
       
    42         */
       
    43         IMPORT_C static CPushMtmUi* NewL
       
    44             ( CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll );
       
    45 
       
    46         /**
       
    47         * Destructor.
       
    48         */
       
    49         virtual ~CPushMtmUi();
       
    50 
       
    51     private:  // Constructors 
       
    52 
       
    53         /**
       
    54         * Constructor.
       
    55         * @param aBaseMtm The client MTM.
       
    56         * @param aRegisteredMtmDll Registration data for the MTM DLL.
       
    57         * @return The constructed UI.
       
    58         */
       
    59         CPushMtmUi( CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll );
       
    60 
       
    61     private:  // New functions
       
    62 
       
    63         /**
       
    64         * Utility to set a TMsvLocalOperationProgress completed.
       
    65         * @param aProgress Progress package buffer to set.
       
    66         * @param aId Id to set in the buffer.
       
    67         */
       
    68         void SetProgressSuccess
       
    69             ( TPckgBuf<TMsvLocalOperationProgress>& aProgress, TMsvId aId );
       
    70 
       
    71         /**
       
    72         * Create a CMsvCompletedOperation object.
       
    73         * @param aObserverStatus Observer's status.
       
    74         * @return The operation object.
       
    75         */
       
    76         CMsvOperation* CompletedOperationL( TRequestStatus& aObserverStatus );
       
    77 
       
    78         /**
       
    79         * Ensure that a service entry exists with which the settings can be 
       
    80         * reached from a messaging application. It creates a service entry 
       
    81         * if necessary.
       
    82         * @return None.
       
    83         */
       
    84         void EnsureServiceEntryL() const;
       
    85 
       
    86     private:  // Functions from base classes
       
    87 
       
    88         /**
       
    89         * Unsupported, leaves with KErrNotSupported.
       
    90         * @param aEntry (Unused) The data to be copied into the new entry.
       
    91         * @param aParent (Unused) The parent of the new entry.
       
    92         * @param aStatus (Unused) Completion status.
       
    93         * @return (NULL) The operation object.
       
    94         */
       
    95         CMsvOperation* CreateL(
       
    96             const TMsvEntry& aEntry,
       
    97             CMsvEntry& aParent,
       
    98             TRequestStatus& aStatus );
       
    99 
       
   100 		// --------------------------------------------------
       
   101         // --- Functions dependent on the current context ---
       
   102 		// --------------------------------------------------
       
   103 
       
   104         /**
       
   105         * Open the current context. If it is a KUidMsvMessageEntry then it is 
       
   106         * equivalent to ViewL. If it is a KUidMsvServiceEntry then it is 
       
   107         * equivalent to EditL. Otherwise it leaves with KErrNotSupported.
       
   108         * @param aStatus Completion status.
       
   109         * @return The operation object.
       
   110         */
       
   111         CMsvOperation* OpenL( TRequestStatus& aStatus );
       
   112 
       
   113         /**
       
   114         * Close the current context. It does nothing just returns a completed 
       
   115         * operation.
       
   116         * @param aStatus Completion status.
       
   117         * @return The operation object.
       
   118         */
       
   119         CMsvOperation* CloseL( TRequestStatus& aStatus );
       
   120 
       
   121         /**
       
   122         * Edit the current context. For KUidMsvServiceEntry it executes the 
       
   123         * "Service Settings" dialog. It returns a completed operation. For 
       
   124         * other entry types it leaves with KErrNotSupported.
       
   125         * @param aStatus Completion status.
       
   126         * @return The operation object.
       
   127         */
       
   128         CMsvOperation* EditL( TRequestStatus& aStatus );
       
   129 
       
   130         /**
       
   131         * View the current context. Only for KUidMsvMessageEntry. It launches the 
       
   132         * Push Viewer application embedded for SI and it lauches the viewer 
       
   133         * application embedded for SP. For other entry types it leaves 
       
   134         * with KErrNotSupported.
       
   135         * @param aStatus Completion status.
       
   136         * @return The operation object.
       
   137         */
       
   138         CMsvOperation* ViewL( TRequestStatus& aStatus );
       
   139 
       
   140 		// --------------------------------------------------
       
   141         // -- Functions independent on the current context --
       
   142 		// --------------------------------------------------
       
   143 
       
   144         // --- Actions upon message selections ---
       
   145         // Selections must be in same folder and all of the correct MTM type.
       
   146         // Context may change after calling these functions.
       
   147 
       
   148         /**
       
   149         * This function is supported only for one selected entry. If the selection 
       
   150         * contains more than one entry then it leaves with KErrNotSupported.
       
   151         * @param aStatus Completion status.
       
   152         * @param aSelection Entry selection to operate on.
       
   153         * @return The operation object.
       
   154         */
       
   155         CMsvOperation* OpenL
       
   156             ( TRequestStatus& aStatus, const CMsvEntrySelection& aSelection );
       
   157 
       
   158         /**
       
   159         * This function is supported only for one selected entry. If the selection 
       
   160         * contains more than one entry then it leaves with KErrNotSupported.
       
   161         * Close the first entry from the selection. It does nothing however.
       
   162         * @param aStatus Completion status.
       
   163         * @param aSelection Entry selection to operate on.
       
   164         * @return The operation object.
       
   165         */
       
   166         CMsvOperation* CloseL
       
   167             ( TRequestStatus& aStatus, const CMsvEntrySelection& aSelection );
       
   168 
       
   169         /**
       
   170         * This function is supported only for one selected entry. If the selection 
       
   171         * contains more than one entry then it leaves with KErrNotSupported.
       
   172         * Edit the first selected entry.
       
   173         * @param aStatus Completion status.
       
   174         * @param aSelection Entry selection to operate on.
       
   175         * @return The operation object.
       
   176         */
       
   177         CMsvOperation* EditL
       
   178             ( TRequestStatus& aStatus, const CMsvEntrySelection& aSelection );
       
   179 
       
   180         /**
       
   181         * This function is supported only for one selected entry. If the selection 
       
   182         * contains more than one entry then it leaves with KErrNotSupported.
       
   183         * View the first entry from the selection.
       
   184         * @param aStatus Completion status.
       
   185         * @param aSelection Entry selection to operate on.
       
   186         * @return The operation object.
       
   187         */
       
   188         CMsvOperation* ViewL
       
   189             ( TRequestStatus& aStatus, const CMsvEntrySelection& aSelection );
       
   190 
       
   191         /**
       
   192         * It does nothing just leaves with KErrNotSupported.
       
   193         * @param aStatus Completion status.
       
   194         * @param aSelection Entry selection to operate on.
       
   195         * @return The operation object.
       
   196         */
       
   197         CMsvOperation* CancelL
       
   198             ( TRequestStatus& aStatus, const CMsvEntrySelection& aSelection );
       
   199 
       
   200         // --- Deletion ---
       
   201 
       
   202         /**
       
   203         * It does nothing just leaves with KErrNotSupported.
       
   204         * @param aSelection Entry selection to operate on.
       
   205         * @param aStatus Completion status.
       
   206         * @return The operation object.
       
   207         */
       
   208         CMsvOperation* DeleteFromL
       
   209             ( const CMsvEntrySelection& aSelection, TRequestStatus& aStatus );
       
   210 
       
   211 		/**
       
   212         * It does nothing just leaves with KErrNotSupported.
       
   213         * @param aSelection (Unused) Entry selection to operate on. They must
       
   214         * be children of the current context.
       
   215         * @param aStatus (Unused) Completion status.
       
   216         * @return (NULL) The operation object.
       
   217         */
       
   218         CMsvOperation* UnDeleteFromL
       
   219             ( const CMsvEntrySelection& aSelection, TRequestStatus& aStatus );
       
   220 
       
   221         /* *
       
   222         * It does nothing just leaves with KErrNotSupported.
       
   223         * @param (Unused) aService Service to delete.
       
   224         * @param (Unused) aStatus Completion status.
       
   225         * @return (NULL) The operation object.
       
   226         */
       
   227         CMsvOperation* DeleteServiceL
       
   228             ( const TMsvEntry& aService, TRequestStatus& aStatus );
       
   229 
       
   230         // --- Message responding ---
       
   231 
       
   232         /**
       
   233         * It does nothing just leaves with KErrNotSupported.
       
   234         * @param aDestination (Unused) The entry to which to assign the reply.
       
   235         * @param aPartList (Unused) Parts to be contained in the reply.
       
   236         * @param aStatus (Unused) Completion status.
       
   237         * @return (NULL) The operation object.
       
   238         */
       
   239         CMsvOperation* ReplyL(
       
   240             TMsvId aDestination,
       
   241             TMsvPartList aPartlist,
       
   242             TRequestStatus& aCompletionStatus );
       
   243 
       
   244         /**
       
   245         * It does nothing just leaves with KErrNotSupported.
       
   246         * @param aDestination (Unused) The entry to which to assign the
       
   247         * forwarded message.
       
   248         * @param aPartList (Unused) Parts to be contained in the forwarded
       
   249         * message.
       
   250         * @param aStatus (Unused) Completion status.
       
   251         * @return (NULL) The operation object.
       
   252         */
       
   253         CMsvOperation* ForwardL(
       
   254             TMsvId aDestination,
       
   255             TMsvPartList aPartList,
       
   256             TRequestStatus& aCompletionStatus );
       
   257 
       
   258         // --- Copy and move functions ---
       
   259         // Context should be set to folder or entry of this MTM.
       
   260 
       
   261         /**
       
   262         * It does nothing just leaves with KErrNotSupported.
       
   263         * @param aSelection (Unused) Entry selection to operate on. They all
       
   264         * must have the same parent.
       
   265         * @param aStatus (Unused) Completion status.
       
   266         * @return (NULL) The operation object.
       
   267         */
       
   268         CMsvOperation* CopyToL
       
   269             ( const CMsvEntrySelection& aSelection, TRequestStatus& aStatus );
       
   270 
       
   271         /* *
       
   272         * It does nothing just leaves with KErrNotSupported.
       
   273         * @param aSelection (Unused) Entry selection to operate on. They all
       
   274         * must have the same parent.
       
   275         * @param aStatus (Unused) Completion status.
       
   276         * @return (NULL) The operation object.
       
   277         */
       
   278         CMsvOperation* MoveToL
       
   279             ( const CMsvEntrySelection& aSelection, TRequestStatus& aStatus );
       
   280 
       
   281         /**
       
   282         * It does nothing just leaves with KErrNotSupported.
       
   283         * @param aSelection (Unused) Entry selection to operate on. They all
       
   284         * must have the same parent.
       
   285         * @param aTargetId (Unused) The ID of the entry to own the copies.
       
   286         * @param aStatus (Unused) Completion status.
       
   287         * @return (NULL) The operation object.
       
   288         */
       
   289         CMsvOperation* CopyFromL(
       
   290             const CMsvEntrySelection& aSelection,
       
   291             TMsvId aTargetId,
       
   292             TRequestStatus& aStatus );
       
   293 
       
   294         /**
       
   295         * It does nothing just leaves with KErrNotSupported.
       
   296         * @param aSelection Entry selection to operate on. They all
       
   297         * must have the same parent.
       
   298         * @param aTargetId The ID of the entry to move to.
       
   299         * @param aStatus Completion status.
       
   300         * @return The operation object.
       
   301         */
       
   302         
       
   303 		CMsvOperation* MoveFromL(
       
   304             const CMsvEntrySelection& aSelection,
       
   305             TMsvId aTargetId,
       
   306             TRequestStatus& aStatus );
       
   307 
       
   308         /**
       
   309         * Query if the MTM supports a particular (standard) capability.
       
   310         * This feunction is also called by CPushMtmClient::QueryCapability.
       
   311         * @param aCapability UID of capability to be queried.
       
   312         * @param aResponse Response value.
       
   313         * @return
       
   314         * - KErrNone: aCapability is a recognized value
       
   315         *   and a response is returned.
       
   316         * - KErrNotSupported: aCapability is not a recognized value.
       
   317         */
       
   318         TInt QueryCapability( TUid aCapability, TInt& aResponse );
       
   319 
       
   320         /**
       
   321         * Invoke synchronous operation.
       
   322         * Only KMtmUiMessagingInitialisation and 
       
   323         * KMtmUiFunctionRestoreFactorySettings are supported.
       
   324         * It will leave with KErrNotSupported otherwise.
       
   325         * @param aFunctionId ID of the requested operation.
       
   326         * @param aSelection Selection of message entries to operate on.
       
   327         * @param aParameter Buffer containing input and output parameters.
       
   328         * @return None.
       
   329         * @throw KErrNotSupported The selected function is not supported.
       
   330         */
       
   331         void InvokeSyncFunctionL(
       
   332             TInt aFunctionId,
       
   333             const CMsvEntrySelection& aSelection,
       
   334             TDes8& aParameter );
       
   335 
       
   336 		/**
       
   337         * Invoke asynchronous operation.
       
   338         * Supported operations:
       
   339         * - KMtmUiFunctionMessageInfo  Launch message info dialog.
       
   340         * - EPushMtmCmdLoadService     Handle the URL in SI (or SL).
       
   341         * - EPushMtmCmdViewService     Render the content of the SP.
       
   342         * - otherwise it calls CBaseMtmUi::InvokeAsyncFunctionL
       
   343         * @param aFunctionId ID of the requested operation.
       
   344         * @param aSelection Selection of message entries to operate on.
       
   345         * @param aCompletionStatus Completion status.
       
   346         * @param aParameter Buffer containing input and output parameters.
       
   347         * @return
       
   348         * - If successful, an asynchronously completing operation.
       
   349         * - If failed, a completed operation, with status set to the
       
   350         *   relevant error code.
       
   351         * @throw KErrNotSupported The selected function is not supported.
       
   352         */
       
   353         CMsvOperation* InvokeAsyncFunctionL(
       
   354             TInt aFunctionId,
       
   355             const CMsvEntrySelection& aSelection,
       
   356             TRequestStatus& aCompletionStatus,
       
   357             TDes8& aParameter );
       
   358 
       
   359         /**
       
   360         * Get the resource file name for this MTM UI.
       
   361         */
       
   362         void GetResourceFileName( TFileName& aFileName ) const;
       
   363     private:
       
   364         TInt   iPushSLEnabled;
       
   365     };
       
   366 
       
   367 #endif // PUSHMTMUI_H
       
   368 
       
   369 // End of File