meetingrequest/mrcommon/inc/esmrentryhelper.h
branchRCL_3
changeset 25 3533d4323edc
equal deleted inserted replaced
24:d189ee25cf9d 25:3533d4323edc
       
     1 /*
       
     2 * Copyright (c)  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:  Definition for static entry helper methods
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MESMRENTRYHELPER_H
       
    20 #define MESMRENTRYHELPER_H
       
    21 
       
    22 #include "esmrdef.h"
       
    23 #include <e32base.h>
       
    24 #include <MAgnEntryUi.h>
       
    25 
       
    26 class CCalEntry;
       
    27 class CCalAttendee;
       
    28 class CMRMailboxUtils;
       
    29 
       
    30 /**
       
    31  *  Static helpers methods for MR Viewers for analyzing entry
       
    32  *  content and properties.
       
    33  */
       
    34 NONSHARABLE_CLASS(ESMREntryHelper)
       
    35     {
       
    36 public: // New functions
       
    37 
       
    38     /**
       
    39     * Tells the mailbox id to use for sending a request or a response.
       
    40     * From mail application we may only respond, and in that case we
       
    41     * use the incoming mailbox. From other places we must use the
       
    42     * default MR mailbox setting.
       
    43     * @param aInParams input parameters for AgnEntryUi
       
    44     * @param aUtils reference to MR Utils
       
    45     * @return mailbox id, KMsvNullIndexEntryId if not available
       
    46     */
       
    47     IMPORT_C static TMsvId SendingMailBoxL(
       
    48             const MAgnEntryUi::TAgnEntryUiInParams& aInParams,
       
    49             CMRMailboxUtils& aUtils );
       
    50 
       
    51     /**
       
    52     * Tells whether the entry belongs to a repeating meeting.
       
    53     * The definition of a repeating meeting is not that there must be
       
    54     * multiple instances, but that repeating properties exist (e.g. RRule).
       
    55     */
       
    56     IMPORT_C static TBool IsRepeatingMeetingL(
       
    57             const CCalEntry& aEntry );
       
    58 
       
    59     /**
       
    60     * Tests whether given entry is an originating entry or a modifying
       
    61     * entry.
       
    62     * @param aEntry to evaluate
       
    63     * @return ETrue if modifying entry, EFalse otherwise
       
    64     */
       
    65     IMPORT_C static TBool IsModifyingEntryL(
       
    66             const CCalEntry& aEntry );
       
    67 
       
    68     /**
       
    69     * Has this particular entry with it's latest saved content been sent?
       
    70     * This is determined from the DTSTAMP value which is null until
       
    71     * up to date entry is sent.
       
    72     * @param aEntry
       
    73     * @return ETrue if entry has been sent
       
    74     */
       
    75     IMPORT_C static TBool IsLatestSavedSentL(
       
    76             const CCalEntry& aEntry );
       
    77 
       
    78     /**
       
    79     * Checks if either entire meeting is cancelled, or if entry is
       
    80     * cancellation for this particular attendee.
       
    81     * @param aEntry
       
    82     * @return ETrue if meeting cancelled from user's point of view
       
    83     */
       
    84     IMPORT_C static TBool IsCancelledL(
       
    85             const CCalEntry& aEntry,
       
    86             CMRMailboxUtils& aUtils );
       
    87     
       
    88     /**
       
    89     * Checks if entry is all-day event.
       
    90     * @param aEntry
       
    91     * @return ETrue if meeting is all-day event
       
    92     */
       
    93     IMPORT_C static TBool IsAllDayEventL(
       
    94             const CCalEntry& aEntry );
       
    95 
       
    96     /**
       
    97     * Checks whether entry is out of date or not.
       
    98     * @param aEntry entry to check
       
    99     * @return ETrue if entry is outdated
       
   100     */
       
   101     IMPORT_C static TBool OccursInPastL(
       
   102             const CCalEntry& aEntry );
       
   103 
       
   104     /**
       
   105     * Returns phone owner's address, KNullDesC if not found.
       
   106     * @param aEntry entry to evaluate
       
   107     * @param aUtils utility reference
       
   108     * @return address
       
   109     */
       
   110     IMPORT_C static const TDesC& PhoneOwnerAddrL(
       
   111             const CCalEntry& aEntry,
       
   112             CMRMailboxUtils& aUtils );
       
   113 
       
   114     /**
       
   115     * Searches for the given attendee in aEntry. This is usable e.g.
       
   116     * in case of response, when compare and update attendee in
       
   117     * response and request. Matching is done based on e-mail address.
       
   118     * @param aAttendee reference attendee to be found
       
   119     * @aEntry entry containing possibly multiple attendees
       
   120     * @return matching attendee or NULL, ownership is not transferred
       
   121     */
       
   122     IMPORT_C static CCalAttendee* EqualAttendeeL(
       
   123             const CCalAttendee& aAttendee,
       
   124             const CCalEntry& aEntry );
       
   125 
       
   126     /**
       
   127     * Method which checks if start and end time span multiple days.
       
   128     * @param aEntry
       
   129     * @return ETrue if spans multiple days
       
   130     */
       
   131     IMPORT_C static TBool SpansManyDaysL(
       
   132             const TCalTime& aStartTime,
       
   133             const TCalTime& aEndTime );
       
   134     
       
   135     /**
       
   136      * Resolves the calendar entry type.
       
   137      * @param aCalEntry reference to calendar entry
       
   138      */
       
   139     IMPORT_C static TESMRCalendarEventType EventTypeL(
       
   140             const CCalEntry& aCalEntry );
       
   141     
       
   142     /**
       
   143      * Sets child entry's start and end time.
       
   144      *
       
   145      * @param aChild Reference to child entry
       
   146      * @param aParent Reference to parent entry
       
   147      * @param aChildEnd Child entry's start time
       
   148      */
       
   149     IMPORT_C static void SetInstanceStartAndEndL(
       
   150             CCalEntry& aChild,
       
   151             const CCalEntry& aParent,
       
   152             const TCalTime& aChildStart );
       
   153 
       
   154     /**
       
   155      * Checks and adjust repeat until validity. Method adjusts entry's
       
   156      * recurrence until time if needed.
       
   157      * @param aEntry Reference to parent entry
       
   158      * @param aInstanceTime Reference to instances time
       
   159      */
       
   160     IMPORT_C static void CheckRepeatUntilValidityL(
       
   161             CCalEntry& aEntry,
       
   162             const TCalTime& aInstanceTime );    
       
   163     };
       
   164 
       
   165 #endif      // MESMRENTRYHELPER_H