meetingui/inc/MRHelpers.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2005 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:   Static helper methods
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef MRHELPERS_H
       
    22 #define MRHELPERS_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <msvstd.h>
       
    27 #include <calentry.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CCalAttendee;
       
    31 class CCalUser;
       
    32 class CMsvSession;
       
    33 
       
    34 /**
       
    35 *  Static helpers methods for ICalUI.
       
    36 *
       
    37 *  @since Series S60 3.0
       
    38 */
       
    39 class MRHelpers
       
    40     {    
       
    41     public: // Data types
       
    42     
       
    43         enum TCopyFields
       
    44             {
       
    45             ECopyFull,
       
    46             ECopyOrganizer,
       
    47             ECopySkeleton
       
    48             };
       
    49             
       
    50     public: // New functions
       
    51     
       
    52         /**
       
    53         * Creates a new copy of the given attendee.
       
    54         *
       
    55         * @param aSource 
       
    56         * @return attendee, ownership is transferred to caller.
       
    57         */
       
    58         static CCalAttendee* CopyAttendeeL( CCalAttendee& aSource );
       
    59         
       
    60         /**
       
    61         * Creates a new copy of the given attendee. Item is
       
    62         * left in the cleanup stack.
       
    63         *
       
    64         * @param aSource 
       
    65         * @return attendee, ownership is transferred to caller.
       
    66         */        
       
    67         static CCalAttendee* CopyAttendeeLC( CCalAttendee& aSource );        
       
    68         
       
    69         /**
       
    70         * Creates a new copy of the given cal user.
       
    71         *
       
    72         * @param aSource 
       
    73         * @return user, ownership is transferred to caller.
       
    74         */
       
    75         static CCalUser* CopyUserL( CCalUser& aSource );
       
    76         
       
    77         /**
       
    78         * Creates a new copy of the given cal user. Item is
       
    79         * left in the cleanup stack.
       
    80         *
       
    81         * @param aSource 
       
    82         * @return user, ownership is transferred to caller.
       
    83         */        
       
    84         static CCalUser* CopyUserLC( CCalUser& aSource );
       
    85         
       
    86         /**
       
    87         * Creates a copy with given method type.
       
    88         * Start/end time and DTSTAMP are set even for a skeleton.
       
    89         * @param aEntry source entry
       
    90         * @param aCopyType specifies copied data
       
    91         * @return instantiated entry, ownership transferred to caller
       
    92         */
       
    93         static CCalEntry* CopyEntryL( const CCalEntry& aEntry,
       
    94                                       CCalEntry::TMethod aMethod,
       
    95                                       TCopyFields aCopyType );
       
    96         
       
    97         /**
       
    98         * Creates a copy with given method type.
       
    99         * Start/end time and DTSTAMP are set even for a skeleton.
       
   100         * Copied entry is left in the cleanup stack.
       
   101         * @param aEntry source entry
       
   102         * @param aCopyType specifies copied data
       
   103         * @return instantiated entry, ownership transferred to caller
       
   104         */
       
   105         static CCalEntry* CopyEntryLC( const CCalEntry& aEntry,
       
   106                                        CCalEntry::TMethod aMethod,
       
   107                                        TCopyFields aCopyType );
       
   108                                        
       
   109         /**
       
   110         * Copies entry fields according to the copy type specification.
       
   111         * Unlike CCalEntry::CopyFromL() this function never copies
       
   112         * the entry method property.
       
   113         * @param aSource source for copying
       
   114         * @param aTarget target for copying
       
   115         * @param aCopyType specifies what data to copy
       
   116         */
       
   117         static void CopyFieldsL( const CCalEntry& aSource,
       
   118                                  CCalEntry& aTarget,
       
   119                                  TCopyFields aCopyType );
       
   120         
       
   121         /**
       
   122         * Finds out e-mail sender address, creates and assigns a
       
   123         * heap descriptor which is left to cleanupstack.
       
   124         * @param aSession opened session reference
       
   125         * @param aMsgId e-mail message entry id
       
   126         * @param aStripAlias instructs whether to strip possible alias name
       
   127         * @return address descriptor, ownership is transferred to caller
       
   128         */
       
   129         static HBufC* SenderAddressLC( CMsvSession& aSession,
       
   130                                        TMsvId aMsgId,
       
   131                                        TBool aStripAlias );
       
   132 
       
   133         /**
       
   134         * Returns TPtrC to all/part of the aAddress parameter
       
   135         * so that possible "mailto:" prefix is stripped out.
       
   136         *
       
   137         * @param aAddress address which might contain the prefix
       
   138         * @return TPtrC which represents only the address
       
   139         */            
       
   140         static TPtrC AddressWithoutMailtoPrefix( const TDesC& aAddress );
       
   141         
       
   142         
       
   143         /**
       
   144         * Parses drive name of dll(eg. "c:") and sets it to
       
   145         * aDriveName parameter.
       
   146         *
       
   147         * @param aDriveName TFileName where parsed drive letter
       
   148         * shall be set.
       
   149         */
       
   150         static void GetCorrectDllDriveL(TFileName& aDriveName);
       
   151         
       
   152         /**
       
   153         * 
       
   154         */
       
   155         static TInt LoadResourceL( const TDesC& aResourceFile,
       
   156                                    const TDesC& aResourcePath );
       
   157     };
       
   158 
       
   159 #endif      // MRHELPERS_H
       
   160 
       
   161 // End of File
       
   162