epoc32/include/mw/msvscheduledentry.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __MSVSCHEDULEDENTRY_H__
    17 #define __MSVSCHEDULEDENTRY_H__
    18 
    19 #include <msvsenderroraction.h>
    20 #include <msventryscheduledata.h>
    21 
    22 /**
    23 Abstract base class which stores the schedule data and recipients of a message. 
    24 
    25 CMsvScheduledEntry does not force the Server MTM to store the message 
    26 recipients in a certain way. However, it is recommended that the Server MTM 
    27 derive its recipients class from CMsvRecipient, because the class already has 
    28 support for the number of retries to send a message to a recipient. 
    29 
    30 CMsvScheduledEntry stores the TMsvEntry to which it relates to provide quick 
    31 access to the scheduling-related index data without needing calls to 
    32 CMsvServerEntry::SetEntry(). 
    33 However, CMsvScheduledEntry does not provide access to all the members of 
    34 the TMsvEntry. This is to stop the user of the CMsvScheduledEntry from 
    35 accessing the descriptor members of the TMsvEntry while the server entry is 
    36 not set to the TMsvEntry. 
    37 
    38 @publishedAll
    39 @released
    40 */
    41 
    42 class CMsvScheduledEntry : public CBase
    43 	{
    44 public:
    45 	/**
    46 	Tests if any of the recipients of this message can still be sent to.
    47 	
    48 	@param aErrorActions
    49 	Error-actions
    50 	
    51 	@param aAction 
    52 	Default error-action
    53 	
    54 	@return True if at least one of the recipients has not been sent 
    55 	the message.
    56 	*/
    57 	virtual TBool CanSendToAnyRecipients(const CMsvSendErrorActions& aErrorActions, TMsvSendErrorAction& aAction) = 0;
    58 
    59 	/**
    60 	Tests if any of the recipients of this message can still be sent to.
    61 	
    62 	@param aAction
    63 	Default error-action
    64 	
    65 	@return True if at least one of the recipients has not been sent 
    66 	the message.
    67 	*/
    68 	virtual TBool CanSendToAnyRecipients(const TMsvSendErrorAction& aAction) = 0;
    69 	
    70 	/**
    71 	Sets all the recipients' retries to zero.
    72 	*/
    73 	virtual void RecipientsResetRetries() = 0;
    74 	
    75 	/**
    76 	Increases all the recipients' retries by one.
    77 	*/
    78 	virtual void RecipientsIncreaseRetries() = 0;
    79 	
    80 	/**
    81 	Sets all the recipients' flags to sending failed.
    82 	*/
    83 	virtual void RecipientsSetFailed() = 0;
    84 	
    85 	/**
    86 	Tests if all recipients of the message have been sent successfully. 
    87 	
    88 	@return True if all recipients have been sent successfully.
    89 	*/
    90 	virtual TBool RecipientsAllSent() const = 0;
    91 
    92 	IMPORT_C virtual void StoreL(CMsvStore& aStore) const;
    93 	IMPORT_C virtual void RestoreL(CMsvStore& aStore);
    94 
    95 	/**
    96 	Stores the recipients.
    97 	
    98 	@param aStore
    99 	Store to write to.
   100 	*/
   101 	virtual void RecipientsStoreL(CMsvStore& aStore) const = 0;
   102 	
   103 	/**
   104 	Restores the recipients.
   105 	
   106 	@param aStore
   107 	Store to read from.
   108 	*/
   109 	virtual void RecipientsRestoreL(CMsvStore& aStore) = 0;
   110 
   111 	inline const TTime& ScheduleDate() const;
   112 	inline void SetScheduleDate(const TTime& aDate);
   113 
   114 	inline const TBool Scheduled() const;
   115 	inline void SetScheduled(const TBool aScheduled);
   116 
   117 	inline const TInt SendingState() const;
   118 	inline void SetSendingState(TInt aState);
   119 
   120 	inline const TInt Error() const;
   121 	inline const TMsvId Id() const;
   122 	inline const TBool OffPeak() const;
   123 
   124 	inline void SetFailed(const TBool aFail);
   125 	inline const TBool Failed() const;
   126 	
   127 	IMPORT_C TBool PendingConditions() const;
   128 	IMPORT_C void SetPendingConditions(TBool aPendingConditions);
   129 
   130 	inline const TUid Mtm() const;
   131 
   132 	IMPORT_C void Entry(TMsvEntry& aEntry) const;
   133 
   134 protected:
   135 
   136 	IMPORT_C CMsvScheduledEntry(const TMsvEntry& aEntry);
   137 
   138 public:
   139 
   140 	/** Message schedule data. */
   141 	TMsvEntryScheduleData iData;
   142 
   143 private:
   144 
   145 	TMsvEntry iEntry;
   146 	};
   147 
   148 /**
   149 Dynamic array of CMsvScheduledEntry objects. 
   150 
   151 @publishedAll
   152 @released
   153 */
   154 typedef CArrayPtrFlat<CMsvScheduledEntry> CMsvScheduledEntries;
   155 
   156 #include <msvscheduledentry.inl>
   157 
   158 #endif