meetingrequest/mricalviewer/inc/esmricalviewerutils.h
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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 "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:  ESMRIcalViewer utility methods
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ESMRICALVIEWERUTILS_H
       
    20 #define ESMRICALVIEWERUTILS_H
       
    21 
       
    22 #include <e32base.h>
       
    23 //<cmail>
       
    24 #include "esmrdef.h"
       
    25 //</cmail>
       
    26 #include "tesmrinputparams.h"
       
    27 
       
    28 class CFSMailMessagePart;
       
    29 class CCalEntry;
       
    30 
       
    31 /**
       
    32  * ESMRIcalViewerUtils contains static utilies for use of the
       
    33  * ical viewer ecom plugin. Not for use outside this ecom implementation.
       
    34  */
       
    35 NONSHARABLE_CLASS( ESMRIcalViewerUtils ) :
       
    36         public CBase
       
    37     {
       
    38 public: // Construction and destruction
       
    39 
       
    40     /**
       
    41      * Converts MRUI callback command to
       
    42      * correct email operation.
       
    43      *
       
    44      * @param aCommandId MRUI command id.
       
    45      * @return Email command id.
       
    46      */
       
    47     static TESMRIcalViewerOperationType EmailOperation(
       
    48             TInt aCommandId );
       
    49 
       
    50     /**
       
    51      * Tests if entry contains attachments or not.
       
    52      * @param aEntry Reference to meeting request entry.
       
    53      * @return ETrue if entry contains attachments
       
    54      */
       
    55     static TBool ContainsAttachments(
       
    56             TESMRInputParams& aParams );
       
    57 
       
    58     /**
       
    59      * Tests if command is asynchronous or not.
       
    60      * @param aCommand Command to be evaluated.
       
    61      * @return ETrue if command is asynchronous
       
    62      */
       
    63     static TBool IsAsyncEmailCommand(
       
    64             TESMRIcalViewerOperationType aCommand );
       
    65 
       
    66     /**
       
    67      * Resolves correct MRUI MR response command without performing
       
    68      * attachment check.
       
    69      * @param aCommand MRUI command.
       
    70      * @return TESMRCommand for correct attachement command ordering
       
    71      */
       
    72     static TESMRCommand MRResponseCommandWithoutAttachmentCheck(
       
    73             TInt aCommand );
       
    74 
       
    75     /**
       
    76      * Locates child message part. Ownership is transferred to caller.
       
    77      * If child part cannot be located, NULL pointer is returned.
       
    78      * After return, cleanupstack always contains a pointer.
       
    79      *
       
    80      * @param aParentPart Reference to parent mail part.
       
    81      * @param aMimeType Defines the mime type to be located
       
    82      * @return part of mail message based on the mime type and parentpart
       
    83      */
       
    84     static CFSMailMessagePart* LocateChildPartLC(
       
    85             CFSMailMessagePart& aParentPart,
       
    86             const TDesC& aMimeType );
       
    87 
       
    88     /**
       
    89      * Locates calendar (content type = TEXT/CALENDAR) from message
       
    90      * If not found, NULL pointer is returned.
       
    91      * Function tries first to find a "multipart/alternative" section and a "text/calendar"
       
    92      * item from there. If not found it is looked from root of the message.
       
    93      * @param aMessage contains the message
       
    94      * @return message part being of correct content type
       
    95      */
       
    96     static CFSMailMessagePart* LocateCalendarPartL( CFSMailMessage& aMessage );
       
    97 
       
    98     /**
       
    99      * Cleanup operations for RPointerArray.
       
   100      *
       
   101      * @param aArray Pointer to RPointerArray.
       
   102      */
       
   103     static void MessagePartPointerArrayCleanup( TAny* aArray );
       
   104 
       
   105     /**
       
   106      * Tests if user responsed to MR and returns the correct attendee value.
       
   107      * @param aEntry calendar entry of the meeting request to check attendee status
       
   108      * @return Attendee response status
       
   109      */
       
   110     static TESMRAttendeeStatus UserResponsedToMRL(
       
   111             CCalEntry& aEntry );
       
   112 
       
   113     /**
       
   114      * Resolves the mailbox owner's role in meeting request
       
   115      * @param aEntry Meeting request entry
       
   116      * @param aMailClient Reference to mail client
       
   117      * @param aMessage Reference to mail message
       
   118      * @return role of the meeting request
       
   119      */
       
   120     static TESMRRole MailboxOwnerRoleL(
       
   121             CCalEntry& aEntry,
       
   122             CFSMailClient& aMailClient,
       
   123             CFSMailMessage& aMessage );
       
   124 
       
   125     /**
       
   126      * Resolves the mailbox owner's role is attendee in meeting request
       
   127      * @param aEntry Meeting request entry
       
   128      * @param aMailClient Reference to mail client
       
   129      * @param aMessage Reference to mail message
       
   130      * @return True if mailbox owner is an attendee in the meeting request
       
   131      */
       
   132     static TBool IsMailboxOwnerAttendeeL(
       
   133             CCalEntry& aEntry,
       
   134             CFSMailClient& aMailClient,
       
   135             CFSMailMessage& aMessage );
       
   136     };
       
   137 
       
   138 #endif // ESMRICALVIEWERUTILS_H
       
   139 
       
   140 // EOF