williamr@2: // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef __MSVSCHEDULEDENTRY_H__ williamr@2: #define __MSVSCHEDULEDENTRY_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: /** williamr@2: Abstract base class which stores the schedule data and recipients of a message. williamr@2: williamr@2: CMsvScheduledEntry does not force the Server MTM to store the message williamr@2: recipients in a certain way. However, it is recommended that the Server MTM williamr@2: derive its recipients class from CMsvRecipient, because the class already has williamr@2: support for the number of retries to send a message to a recipient. williamr@2: williamr@2: CMsvScheduledEntry stores the TMsvEntry to which it relates to provide quick williamr@2: access to the scheduling-related index data without needing calls to williamr@2: CMsvServerEntry::SetEntry(). williamr@2: However, CMsvScheduledEntry does not provide access to all the members of williamr@2: the TMsvEntry. This is to stop the user of the CMsvScheduledEntry from williamr@2: accessing the descriptor members of the TMsvEntry while the server entry is williamr@2: not set to the TMsvEntry. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: class CMsvScheduledEntry : public CBase williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Tests if any of the recipients of this message can still be sent to. williamr@2: williamr@2: @param aErrorActions williamr@2: Error-actions williamr@2: williamr@2: @param aAction williamr@2: Default error-action williamr@2: williamr@2: @return True if at least one of the recipients has not been sent williamr@2: the message. williamr@2: */ williamr@2: virtual TBool CanSendToAnyRecipients(const CMsvSendErrorActions& aErrorActions, TMsvSendErrorAction& aAction) = 0; williamr@2: williamr@2: /** williamr@2: Tests if any of the recipients of this message can still be sent to. williamr@2: williamr@2: @param aAction williamr@2: Default error-action williamr@2: williamr@2: @return True if at least one of the recipients has not been sent williamr@2: the message. williamr@2: */ williamr@2: virtual TBool CanSendToAnyRecipients(const TMsvSendErrorAction& aAction) = 0; williamr@2: williamr@2: /** williamr@2: Sets all the recipients' retries to zero. williamr@2: */ williamr@2: virtual void RecipientsResetRetries() = 0; williamr@2: williamr@2: /** williamr@2: Increases all the recipients' retries by one. williamr@2: */ williamr@2: virtual void RecipientsIncreaseRetries() = 0; williamr@2: williamr@2: /** williamr@2: Sets all the recipients' flags to sending failed. williamr@2: */ williamr@2: virtual void RecipientsSetFailed() = 0; williamr@2: williamr@2: /** williamr@2: Tests if all recipients of the message have been sent successfully. williamr@2: williamr@2: @return True if all recipients have been sent successfully. williamr@2: */ williamr@2: virtual TBool RecipientsAllSent() const = 0; williamr@2: williamr@2: IMPORT_C virtual void StoreL(CMsvStore& aStore) const; williamr@2: IMPORT_C virtual void RestoreL(CMsvStore& aStore); williamr@2: williamr@2: /** williamr@2: Stores the recipients. williamr@2: williamr@2: @param aStore williamr@2: Store to write to. williamr@2: */ williamr@2: virtual void RecipientsStoreL(CMsvStore& aStore) const = 0; williamr@2: williamr@2: /** williamr@2: Restores the recipients. williamr@2: williamr@2: @param aStore williamr@2: Store to read from. williamr@2: */ williamr@2: virtual void RecipientsRestoreL(CMsvStore& aStore) = 0; williamr@2: williamr@2: inline const TTime& ScheduleDate() const; williamr@2: inline void SetScheduleDate(const TTime& aDate); williamr@2: williamr@2: inline const TBool Scheduled() const; williamr@2: inline void SetScheduled(const TBool aScheduled); williamr@2: williamr@2: inline const TInt SendingState() const; williamr@2: inline void SetSendingState(TInt aState); williamr@2: williamr@2: inline const TInt Error() const; williamr@2: inline const TMsvId Id() const; williamr@2: inline const TBool OffPeak() const; williamr@2: williamr@2: inline void SetFailed(const TBool aFail); williamr@2: inline const TBool Failed() const; williamr@2: williamr@2: IMPORT_C TBool PendingConditions() const; williamr@2: IMPORT_C void SetPendingConditions(TBool aPendingConditions); williamr@2: williamr@2: inline const TUid Mtm() const; williamr@2: williamr@2: IMPORT_C void Entry(TMsvEntry& aEntry) const; williamr@2: williamr@2: protected: williamr@2: williamr@2: IMPORT_C CMsvScheduledEntry(const TMsvEntry& aEntry); williamr@2: williamr@2: public: williamr@2: williamr@2: /** Message schedule data. */ williamr@2: TMsvEntryScheduleData iData; williamr@2: williamr@2: private: williamr@2: williamr@2: TMsvEntry iEntry; williamr@2: }; williamr@2: williamr@2: /** williamr@2: Dynamic array of CMsvScheduledEntry objects. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: typedef CArrayPtrFlat CMsvScheduledEntries; williamr@2: williamr@2: #include williamr@2: williamr@2: #endif