pushmtm/MtmUiInc/PushMtmUiData.h
changeset 51 48e827313edd
parent 37 481242ead638
child 53 f427d27b98d8
equal deleted inserted replaced
37:481242ead638 51:48e827313edd
     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:  Push Ui Data Mtm class declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef PUSHMTMUIDATA_H
       
    21 #define PUSHMTMUIDATA_H
       
    22 
       
    23 // INCLUDE FILES
       
    24 
       
    25 #include <msvstd.h>
       
    26 #include <mtudcbas.h>
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 * UI Data MTM for pushed messages.
       
    32 */
       
    33 class CPushMtmUiData: public CBaseMtmUiData
       
    34     {
       
    35     public:     // construction
       
    36 
       
    37         /**
       
    38         * Two-phased constructor (exported factory function).
       
    39         * Leaves on failure.
       
    40         * @param aRegisteredMtmDll Registration data for the MTM DLL.
       
    41         * @return The constructed UI Data.
       
    42         */
       
    43         IMPORT_C static CPushMtmUiData* NewL( CRegisteredMtmDll& aRegisteredDll );
       
    44 
       
    45         /**
       
    46         * Destructor.
       
    47         */
       
    48         virtual ~CPushMtmUiData();
       
    49 
       
    50     private:  // construction
       
    51 
       
    52         /**
       
    53         * Constructor.
       
    54         * @param aRegisteredMtmDll Registration data for the MTM DLL.
       
    55         */
       
    56         CPushMtmUiData( CRegisteredMtmDll& aRegisteredDll );
       
    57 
       
    58     private:     // from CBaseMtmUiData
       
    59 
       
    60         /**
       
    61         * Get an array of bitmaps relevant to the passed context entry.
       
    62         * @param aContext Context entry to return the icons for.
       
    63         * @param aStateFlags 
       
    64         * @return Bitmap array for the given context.
       
    65         */
       
    66         const CBaseMtmUiData::CBitmapArray& ContextIcon
       
    67             ( const TMsvEntry& aContext, TInt aStateFlags ) const;
       
    68 
       
    69         /**
       
    70         * Check if aNewEntry can be created as a child of aContext.
       
    71         * (Yes for services in the root).
       
    72         * @param aParent The entry under which aNewEntry should be created.
       
    73         * @param aNewEntry The entry to which the operation applies.
       
    74         * @param aReasonResourceId On return, a resource string ID or 0.
       
    75         */
       
    76         TBool CanCreateEntryL( const TMsvEntry& aParent,TMsvEntry& aNewEntry,
       
    77                                             TInt& aReasonResourceId ) const;
       
    78 
       
    79         /**
       
    80         * Check if a delete operation is supported for aContext (yes).
       
    81         * @param aContext The entry to which the operation applies.
       
    82         * @param aReasonResourceId On return, a resource string ID or 0.
       
    83         */
       
    84         TBool CanDeleteFromEntryL
       
    85             ( const TMsvEntry& aContext, TInt& aReasonResourceId ) const;
       
    86 
       
    87         /**
       
    88         * Check if the service aService can be deleted (yes).
       
    89         * @param aService The entry to which the operation applies.
       
    90         * @param aReasonResourceId On return, a resource string ID or 0.
       
    91         */
       
    92         TBool CanDeleteServiceL
       
    93             ( const TMsvEntry& aService, TInt& aReasonResourceId ) const;
       
    94 
       
    95         /**
       
    96         * Check if aContext can be replied to (no).
       
    97         * @param aContext The entry to which the operation applies.
       
    98         * @param aReasonResourceId On return, a resource string ID or 0.
       
    99         */
       
   100         TBool CanReplyToEntryL
       
   101             ( const TMsvEntry& aContext, TInt& aReasonResourceId ) const;
       
   102 
       
   103         /**
       
   104         * Check if aContext can be forwarded (no).
       
   105         * @param aContext The entry to which the operation applies.
       
   106         * @param aReasonResourceId On return, a resource string ID or 0.
       
   107         */
       
   108         TBool CanForwardEntryL
       
   109             ( const TMsvEntry& aContext, TInt& aReasonResourceId ) const;
       
   110 
       
   111         /**
       
   112         * Check if aContext can be edited (no).
       
   113         * @param aContext The entry to which the operation applies.
       
   114         * @param aReasonResourceId On return, a resource string ID or 0.
       
   115         */
       
   116         TBool CanEditEntryL
       
   117             ( const TMsvEntry& aContext, TInt& aReasonResourceId ) const;
       
   118 
       
   119         /**
       
   120         * Check if aContext can be viewed (yes for messages).
       
   121         * @param aContext The entry to which the operation applies.
       
   122         * @param aReasonResourceId On return, a resource string ID or 0.
       
   123         */
       
   124         TBool CanViewEntryL
       
   125             ( const TMsvEntry& aContext, TInt& aReasonResourceId ) const;
       
   126 
       
   127         /**
       
   128         * Check if aContext can be opened (yes for messages).
       
   129         * @param aContext The entry to which the operation applies.
       
   130         * @param aReasonResourceId On return, a resource string ID or 0.
       
   131         */
       
   132         TBool CanOpenEntryL
       
   133             ( const TMsvEntry& aContext, TInt& aReasonResourceId ) const;
       
   134 
       
   135         /**
       
   136         * Check if aContext can be closed (yes for messages).
       
   137         * @param aContext The entry to which the operation applies.
       
   138         * @param aReasonResourceId On return, a resource string ID or 0.
       
   139         */
       
   140         TBool CanCloseEntryL
       
   141             ( const TMsvEntry& aContext, TInt& aReasonResourceId ) const;
       
   142 
       
   143         /**
       
   144         * Check if a copy to or move to operation is supported
       
   145         * for aContext (yes).
       
   146         * @param aContext The entry to which the operation applies.
       
   147         * @param aReasonResourceId On return, a resource string ID or 0.
       
   148         */
       
   149         TBool CanCopyMoveToEntryL
       
   150             ( const TMsvEntry& aContext, TInt& aReasonResourceId ) const;
       
   151 
       
   152         /**
       
   153         * Check if a copy from or move from operation is supported
       
   154         * for aContext (yes).
       
   155         * @param aContext The entry to which the operation applies.
       
   156         * @param aReasonResourceId On return, a resource string ID or 0.
       
   157         */
       
   158         TBool CanCopyMoveFromEntryL
       
   159             ( const TMsvEntry& aContext, TInt& aReasonResourceId ) const;
       
   160 
       
   161         /**
       
   162         * Check if a cancel operation is supported for aContext (no).
       
   163         * @param aContext The entry to which the operation applies.
       
   164         * @param aReasonResourceId On return, a resource string ID or 0.
       
   165         */
       
   166         TBool CanCancelL
       
   167             ( const TMsvEntry& aContext, TInt& aReasonResourceId ) const;
       
   168 
       
   169         /**
       
   170         * Check if an MTM-specific operation is appropriate to the entry
       
   171         * specified in aContext.
       
   172         * @param aOperationId ID of operation to query.
       
   173         * @param aContext The entry to which the operation applies.
       
   174         * @return
       
   175         * - KErrNone if operation is supported,
       
   176         * - KErrCancel if the operation is not supported.
       
   177         */
       
   178         TInt OperationSupportedL
       
   179             ( TInt aOperationId, const TMsvEntry& aContext ) const;
       
   180 
       
   181         /**
       
   182         * Query if the MTM supports a particular (standard) capability.
       
   183         * This function is also called by CPushMtmBaseClient::QueryCapability.
       
   184         * @param aCapability UID of capability to be queried.
       
   185         * @param aResponse Response value.
       
   186         * @return
       
   187         * - KErrNone: aCapability is a recognised value
       
   188         *   and a response is returned.
       
   189         * - KErrNotSupported: aCapability is not a recognised value.
       
   190         */
       
   191         TInt QueryCapability( TUid aCapability, TInt& aResponse ) const;
       
   192 
       
   193         /**
       
   194 		* Since we don't support sending, we don't need to support this 
       
   195         * function.
       
   196         * @param aContext 
       
   197         * @return NULL.
       
   198         */
       
   199         HBufC* StatusTextL( const TMsvEntry& aContext ) const;
       
   200 
       
   201         /**
       
   202         * Load and populate icons and functions.
       
   203         */
       
   204         void PopulateArraysL();
       
   205 
       
   206         /**
       
   207         * Get the resource file name for this component.
       
   208         */
       
   209         void GetResourceFileName( TFileName& aFileName ) const;
       
   210 
       
   211     private:     // New functions
       
   212 
       
   213         /**
       
   214         * Create skinned icons in iIconArrays.
       
   215         */
       
   216         void CreateSkinnedBitmapsL();
       
   217     };
       
   218 
       
   219 #endif // PUSHMTMUIDATA_H