meetingrequest/mrcommon/inc/esmrentryhelper.h
changeset 0 8466d47a6819
child 12 4ce476e64c59
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     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 <e32base.h>
       
    23 #include <MAgnEntryUi.h>
       
    24 
       
    25 class CCalEntry;
       
    26 class CCalAttendee;
       
    27 class CMRMailboxUtils;
       
    28 
       
    29 /**
       
    30  *  Static helpers methods for MR Viewers for analyzing entry
       
    31  *  content and properties.
       
    32  */
       
    33 NONSHARABLE_CLASS(ESMREntryHelper)
       
    34     {
       
    35 public: // New functions
       
    36 
       
    37     /**
       
    38     * Tells the mailbox id to use for sending a request or a response.
       
    39     * From mail application we may only respond, and in that case we
       
    40     * use the incoming mailbox. From other places we must use the
       
    41     * default MR mailbox setting.
       
    42     * @param aInParams input parameters for AgnEntryUi
       
    43     * @param aUtils reference to MR Utils
       
    44     * @return mailbox id, KMsvNullIndexEntryId if not available
       
    45     */
       
    46     IMPORT_C static TMsvId SendingMailBoxL(
       
    47             const MAgnEntryUi::TAgnEntryUiInParams& aInParams,
       
    48             CMRMailboxUtils& aUtils );
       
    49 
       
    50     /**
       
    51     * Tells whether the entry belongs to a repeating meeting.
       
    52     * The definition of a repeating meeting is not that there must be
       
    53     * multiple instances, but that repeating properties exist (e.g. RRule).
       
    54     */
       
    55     IMPORT_C static TBool IsRepeatingMeetingL(
       
    56             const CCalEntry& aEntry );
       
    57 
       
    58     /**
       
    59     * Tests whether given entry is an originating entry or a modifying
       
    60     * entry.
       
    61     * @param aEntry to evaluate
       
    62     * @return ETrue if modifying entry, EFalse otherwise
       
    63     */
       
    64     IMPORT_C static TBool IsModifyingEntryL(
       
    65             const CCalEntry& aEntry );
       
    66 
       
    67     /**
       
    68     * Has this particular entry with it's latest saved content been sent?
       
    69     * This is determined from the DTSTAMP value which is null until
       
    70     * up to date entry is sent.
       
    71     * @param aEntry
       
    72     * @return ETrue if entry has been sent
       
    73     */
       
    74     IMPORT_C static TBool IsLatestSavedSentL(
       
    75             const CCalEntry& aEntry );
       
    76 
       
    77     /**
       
    78     * Checks if either entire meeting is cancelled, or if entry is
       
    79     * cancellation for this particular attendee.
       
    80     * @param aEntry
       
    81     * @return ETrue if meeting cancelled from user's point of view
       
    82     */
       
    83     IMPORT_C static TBool IsCancelledL(
       
    84             const CCalEntry& aEntry,
       
    85             CMRMailboxUtils& aUtils );
       
    86 
       
    87     /**
       
    88     * Checks whether entry is out of date or not.
       
    89     * @param aEntry entry to check
       
    90     * @return ETrue if entry is outdated
       
    91     */
       
    92     IMPORT_C static TBool OccursInPastL(
       
    93             const CCalEntry& aEntry );
       
    94 
       
    95     /**
       
    96     * Returns phone owner's address, KNullDesC if not found.
       
    97     * @param aEntry entry to evaluate
       
    98     * @param aUtils utility reference
       
    99     * @return address
       
   100     */
       
   101     IMPORT_C static const TDesC& PhoneOwnerAddrL(
       
   102             const CCalEntry& aEntry,
       
   103             CMRMailboxUtils& aUtils );
       
   104 
       
   105     /**
       
   106     * Searches for the given attendee in aEntry. This is usable e.g.
       
   107     * in case of response, when compare and update attendee in
       
   108     * response and request. Matching is done based on e-mail address.
       
   109     * @param aAttendee reference attendee to be found
       
   110     * @aEntry entry containing possibly multiple attendees
       
   111     * @return matching attendee or NULL, ownership is not transferred
       
   112     */
       
   113     IMPORT_C static CCalAttendee* EqualAttendeeL(
       
   114             const CCalAttendee& aAttendee,
       
   115             const CCalEntry& aEntry );
       
   116 
       
   117     /**
       
   118     * Method which checks if start and end time span multiple days.
       
   119     * @param aEntry
       
   120     * @return ETrue if spans multiple days
       
   121     */
       
   122     IMPORT_C static TBool SpansManyDaysL(
       
   123             const TCalTime& aStartTime,
       
   124             const TCalTime& aEndTime );
       
   125     };
       
   126 
       
   127 #endif      // MESMRENTRYHELPER_H