meetingui/inc/CMRUtilsInternal.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:  
       
    15 *       Internal view of the CMRUtils.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __CMRUTILSINTERNAL_H__
       
    22 #define __CMRUTILSINTERNAL_H__
       
    23 
       
    24 //  INCLUDES
       
    25 #include <CMRUtils.h>
       
    26 #include <MMRUtilsTombsExt.h>
       
    27 #include <msvstd.h>
       
    28 #include <CalUser.h>
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CCalInstanceView;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 
       
    36 class CMRUtilsInternal :
       
    37 public CMRUtils,
       
    38 public MMRUtilsTombsExt
       
    39     {
       
    40     public: // Data types
       
    41     
       
    42         /**
       
    43         * Enumeration determining mail recipients.
       
    44         */        
       
    45         enum TMailRecipients
       
    46             {
       
    47             EOrganizer, // meeting organizer
       
    48             ESender,    // message sender
       
    49             EAll        // all, but not declined attendees
       
    50             };         
       
    51     
       
    52         /**
       
    53         * Codes of asynchronous operations.
       
    54         */ 
       
    55         enum TOpCode
       
    56             {
       
    57             EFirstOperation = CMRUtils::ELastOperation,
       
    58             EDeleteTombstones,       // delete some tombstone(s)
       
    59             };
       
    60                 
       
    61     public: // Constructors and destructors
       
    62 
       
    63         /**
       
    64         * Constructs an ECom plug-in, KMeetingRequestUtilsImplUID implementation.
       
    65         * Client may give NULL pointer for aMsvSession if it is not available.
       
    66         *
       
    67         * @param aObserver mandatory utils feedback observer
       
    68         * @param aCalSession calendar session reference
       
    69         * @param aMsvSession, ownership not transferred
       
    70         * @return instantiated plug-in
       
    71         */
       
    72         static CMRUtilsInternal* NewL( MMRUtilsObserver& aObserver,
       
    73                                        CCalSession& aCalSession,
       
    74                                        CMsvSession* aMsvSession );
       
    75 
       
    76         /**
       
    77         * Destructor.
       
    78         */
       
    79         virtual ~CMRUtilsInternal();
       
    80         
       
    81     public: // New functions
       
    82     
       
    83         /**
       
    84         * Accessor for Agenda Model CCalEntryView owned by this utility.
       
    85         * Returns a valid pointer if status is EAvailable or
       
    86         * EAvailableWithoutTombs, otherwise NULL.        
       
    87         * @return entry view pointer, ownership not transferred
       
    88         */  
       
    89         virtual CCalEntryView* EntryView() = 0;       
       
    90 
       
    91         /**
       
    92         * Accessor for Agenda Model CCalInstanceView owned by this utility.
       
    93         * Returns a valid pointer if status is EAvailable or
       
    94         * EAvailableWithoutTombs, otherwise NULL.        
       
    95         * @return instance view pointer, ownership not transferred
       
    96         */  
       
    97         virtual CCalInstanceView* InstanceView() = 0; 
       
    98 
       
    99         /**
       
   100         * Fetches entries from the Agenda Model based on time range.
       
   101         * In case of repeating entries the entire sequence must
       
   102         * be within range (but modifying entries are considered separately).
       
   103         * Ownership of entries is transferred to caller.
       
   104         * See CCalEntryView documentation for other fetch variants.
       
   105         * @param aCalEntryArray will contain fetched entries
       
   106         * @param aTimeRange criteria
       
   107         */
       
   108         virtual void FetchEntriesL(
       
   109             RPointerArray<CCalEntry>& aCalEntryArray,
       
   110             const CalCommon::TCalTimeRange& aTimeRange ) = 0;
       
   111           
       
   112         /**
       
   113         * Fetches entry from the Agenda Model based on Uid and recurrence id.
       
   114         * See CCalEntryView documentation for other fetch variants. For fetching
       
   115         * originating entry use TCalTime set to Time::NullTTime().
       
   116         * Returns NULL if no matching entry was found.
       
   117         * @param aUid criteria
       
   118         * @param aRecurrenceId criteria        
       
   119         * @return entry, ownership is transferred to caller
       
   120         */  
       
   121         virtual CCalEntry* FetchEntryL( const TDesC8& aUid,
       
   122                                         const TCalTime& aRecurrenceId ) = 0;
       
   123 
       
   124         /**
       
   125         * Updates the given entry in the Agenda Model.
       
   126         * @param aCalEntry entry to update
       
   127         * @return KErrNone or a system wide error code
       
   128         */      
       
   129         virtual TInt UpdateEntryL( const CCalEntry& aCalEntry ) = 0;
       
   130 
       
   131         /**
       
   132         * This method deletes and re-creates the tombstone db file.
       
   133         * Reseting causes asynchronous initialization and client is notified
       
   134         * first with MMRUtilsObserver::ENotReady and later on with a completion
       
   135         * status code.
       
   136         */
       
   137         virtual void ResetTombsFileL() = 0;
       
   138         
       
   139         /**
       
   140         * This method deletes tombstones determined by aCalTimeRange.
       
   141         * This is asynchronous, user gets notified with
       
   142         * MMRUtilsObserver::HandleOperation( EDeleteTombstones,... )
       
   143         * @param aCalTimeRange range determining which entries to delete
       
   144         */
       
   145         virtual void DeleteTombstonesL(
       
   146             const CalCommon::TCalTimeRange& aCalTimeRange ) = 0;
       
   147 
       
   148         /**
       
   149         * Check entry: GUID, sequence number, existence in Agenda Model and
       
   150         * tombstone database. Same as CMRUtilsTombsExt::StoreL() but doesn't
       
   151         * actually store.
       
   152         * @param aCalEntry entry to check
       
   153         * @return result code
       
   154         */
       
   155         virtual TMRUtilsDbResult CheckEntryCondL( const CCalEntry& aCalEntry ) = 0;
       
   156         
       
   157         /**
       
   158         * Allows user to set attendee statuses and optionally edit and send
       
   159         * response to aEntries. If array contains multiple entries,
       
   160         * the same response value and information is sent to all given entries.
       
   161         * Cancelled or outdated entries are omitted, and so are those that
       
   162         * don't contain phone user as attendee whose response is requested.
       
   163         * Return values that are used are:
       
   164         * KErrNone if attendee status of one or more entries was set
       
   165         * KErrArgument if couldn't find any valid entry to respond
       
   166         * KErrCancel if user cancels responding (after setting attendee status)
       
   167         * @param aEntries entries belonging to same recurring meeting
       
   168         * @param aStatus responding status
       
   169         * @param aMailbox mailbox to use for sending response        
       
   170         * @return KErrNone or a system wide error code
       
   171         */
       
   172         virtual TInt RespondWithUiL( const RPointerArray<CCalEntry>& aEntries,
       
   173                                      CCalAttendee::TCalStatus aStatus,
       
   174                                      TMsvId aMailbox ) = 0;
       
   175                             
       
   176         /**
       
   177         * Allows organizer cancel, and optionally to edit and send 
       
   178         * cancellation of aEntries, i.e. recurring meeting or instance(s) of it.
       
   179         * Already cancelled, unsent or outdated entries are omitted,
       
   180         * and so are those attendees that have declined participation
       
   181         * to a particular entry. Return values that are used are:
       
   182         * KErrNone if one or more entries was cancelled
       
   183         * KErrArgument if couldn't find any valid entry to cancel
       
   184         * KErrCancel if user cancels sending (after canceling entry(s))
       
   185         * @param aEntries entries belonging to same recurring meeting
       
   186         * @param aMailbox mailbox to use for sending cancellation        
       
   187         * @return KErrNone or a system wide error code    
       
   188         */ 
       
   189         virtual TInt CancelWithUiL( const RPointerArray<CCalEntry>& aEntries,
       
   190                                     TMsvId aMailbox ) = 0;
       
   191     
       
   192         /**
       
   193         * Open SendUI editor for replying to the recipient(s) with an e-mail.
       
   194         * aSenderAddr is omitted if aRecipients does not contain MR sender.
       
   195         * @param aRecipients enumeration determining the recipients
       
   196         * @param aCalEntry entry to be used as a base for sending reply
       
   197         * @param aSenderAddr specifies the sender, if applicable
       
   198         * @param aMailbox mailbox to use for sending reply        
       
   199         */          
       
   200         virtual void ReplyToL( TMailRecipients aRecipients,
       
   201                                const CCalEntry& aCalEntry,
       
   202                                const TDesC& aSenderAddr,
       
   203                                TMsvId aMailbox ) = 0;
       
   204                                
       
   205         /**
       
   206         * Reads "from" field of the given mail message. Created descriptor
       
   207         * is left in the cleanup stack, ownership transferred to the caller.
       
   208         * Leaves with KErrNotSupported if client gave NULL MsvSession in
       
   209         * constructor.
       
   210         * @param aMessage mail message to read
       
   211         * @return "from" field
       
   212         */
       
   213 		virtual HBufC* MailHeaderFromFieldLC( TMsvId aMessage ) = 0;
       
   214 
       
   215         /**
       
   216         * Reads "subject" field of the given mail message. Created descriptor
       
   217         * is left in the cleanup stack, ownership transferred to the caller.
       
   218         * Leaves with KErrNotSupported if client gave NULL MsvSession in
       
   219         * constructor.
       
   220         * @param aMessage mail message to read
       
   221         * @return "subject" field
       
   222         */		
       
   223 		virtual HBufC* MailHeaderSubjectFieldLC( TMsvId aMessage ) = 0;
       
   224     };
       
   225 
       
   226 #include "CMRUtilsInternal.inl"
       
   227 
       
   228 #endif // __CMRUTILSINTERNAL_H__
       
   229 
       
   230 // End of File