mmsengine/mmsserver/inc/mmsscheduledentry.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002-2007 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 *     entry for scheduled sending of mms messages
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef MMSSCHEDULEDENTRY_H
       
    22 #define MMSSCHEDULEDENTRY_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include    <e32base.h>
       
    26 #include    <msvrcpt.h>
       
    27 #include    <msvscheduledentry.h>
       
    28 
       
    29 // CONSTANTS
       
    30 
       
    31 // MACROS
       
    32 
       
    33 // DATA TYPES
       
    34 
       
    35 // FUNCTION PROTOTYPES
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 class CMsvRecipient;
       
    39 
       
    40 // CLASS DECLARATION
       
    41 
       
    42 /**
       
    43 * Recipient info for scheduled operations.
       
    44 */
       
    45 class CMmsRecipient :public CMsvRecipient
       
    46     {
       
    47 
       
    48     public:  // Constructors and destructor
       
    49 
       
    50         // This is needed only because the constructor of CMsvRecipient is protected.
       
    51 
       
    52         /**
       
    53         * constructor.
       
    54         */
       
    55         static CMmsRecipient* NewL();
       
    56 
       
    57         /**
       
    58         * Destructor.
       
    59         */
       
    60         virtual ~CMmsRecipient();
       
    61 
       
    62 public: // New functions
       
    63 
       
    64         /**
       
    65         * Set max retries override
       
    66         * @param aMaxRetries maximum number of retries
       
    67         */
       
    68         inline void SetMaxRetries( TInt16 aMaxRetries );
       
    69 
       
    70         /**
       
    71         * return max retries override
       
    72         * @return maximum number of retries
       
    73         */
       
    74         inline TInt16 MaxRetries();
       
    75 
       
    76 public: // Functions from base classes
       
    77 
       
    78         /**
       
    79         * From CMsvRecipient.
       
    80         * @param aReadStream read stream
       
    81         */
       
    82         void InternalizeL(RReadStream& aReadStream);
       
    83 
       
    84         /**
       
    85         * From CMsvRecipient.
       
    86         * @param aWriteStream write stream
       
    87         */
       
    88         void ExternalizeL(RWriteStream& aWriteStream) const;
       
    89 
       
    90 private:
       
    91         /**
       
    92         * By default Symbian OS constructor is private.
       
    93         */
       
    94         CMmsRecipient();                
       
    95 
       
    96         // By default, prohibit copy constructor
       
    97         CMmsRecipient( const CMmsRecipient& );
       
    98         // Prohibit assignment operator
       
    99         CMmsRecipient& operator= ( const CMmsRecipient& );
       
   100 
       
   101     private:    // Data
       
   102         TInt16 iMaxRetries; // override for max retries
       
   103 
       
   104     };
       
   105 
       
   106 inline void CMmsRecipient::SetMaxRetries( TInt16 aMaxRetries )
       
   107     {
       
   108     iMaxRetries = aMaxRetries;
       
   109     }
       
   110 
       
   111 inline TInt16 CMmsRecipient::MaxRetries()
       
   112     {
       
   113     return iMaxRetries;
       
   114     }
       
   115 
       
   116 /**
       
   117 * Scheduling info for message entries.
       
   118 */
       
   119 class CMmsScheduledEntry :public CMsvScheduledEntry
       
   120     {
       
   121     public:  // Constructors and destructor
       
   122         
       
   123         /**
       
   124         * Two-phased constructor.
       
   125         */
       
   126         static CMmsScheduledEntry* NewL( const TMsvEntry& aEntry );
       
   127         
       
   128         /**
       
   129         * Destructor.
       
   130         */
       
   131         virtual ~CMmsScheduledEntry();
       
   132 
       
   133     public: // New functions
       
   134         
       
   135         /**
       
   136         * Get access to recipient.
       
   137         * @return reference to recipient member
       
   138         */
       
   139         inline CMsvRecipient& MmsRecipient() const;
       
   140 
       
   141     public: // Functions from base classes
       
   142 
       
   143         /**
       
   144         * From CMsvScheduledEntry Check if message can be sent.
       
   145         * Called by CMsvScheduleSend::CanSchedule
       
   146         * @param  aErrorActions
       
   147         * @param  aAction
       
   148         * @return ETrue if can send to any of the recipients of iEntry,
       
   149         *     Otherwise returns EFalse        
       
   150         */
       
   151         TBool CanSendToAnyRecipients( const CMsvSendErrorActions& aErrorActions, TMsvSendErrorAction& aAction );
       
   152         
       
   153         /**
       
   154         * From CMsvScheduledEntry Check if message can be sent.
       
   155         * Called by CMsvScheduleSend::CanSchedule
       
   156         * @param  aAction
       
   157         * @return ETrue if can send to any of the recipients of iEntry,
       
   158         *     Otherwise returns EFalse        
       
   159         */
       
   160         TBool CanSendToAnyRecipients(const TMsvSendErrorAction& aAction );
       
   161         
       
   162         /**
       
   163         * From CMsvScheduledEntry Reset retry count.
       
   164         */
       
   165         void RecipientsResetRetries();
       
   166         
       
   167         /**
       
   168         * From CMsvScheduledEntry Increase retry count.
       
   169         */
       
   170         void RecipientsIncreaseRetries();
       
   171         
       
   172         /**
       
   173         * From CMsvScheduledEntry Mark sending failed.
       
   174         */
       
   175         void RecipientsSetFailed();
       
   176         
       
   177         /**
       
   178         * From CMsvScheduledEntry Query if all sent.
       
   179         * @return ETrue, if message sent, EFalse if not
       
   180         */
       
   181         TBool RecipientsAllSent() const;
       
   182         
       
   183         /**
       
   184         * From CMsvScheduledEntry Store recipient info
       
   185         * @param editable store
       
   186         */
       
   187         void RecipientsStoreL(CMsvStore& aStore) const;
       
   188 
       
   189         /**
       
   190         * From CMsvScheduledEntry Restore recipient info
       
   191         * @param readable store
       
   192         */
       
   193         void RecipientsRestoreL(CMsvStore& aStore);
       
   194 
       
   195     protected:  // New functions
       
   196         
       
   197     protected:  // Functions from base classes
       
   198         
       
   199     private:
       
   200 
       
   201         /**
       
   202         * By default Symbian OS constructor is private.
       
   203         */
       
   204         CMmsScheduledEntry( const TMsvEntry& aEntry );
       
   205         void ConstructL();
       
   206 
       
   207         /**
       
   208         * Check if the message should be resent or what
       
   209         * @param aRecipient scheduling info
       
   210         * @param aAction
       
   211         * @return ETrue, if message can still be sent
       
   212         */
       
   213         TBool CheckRecipient( CMsvRecipient& aRecipient, const TMsvSendErrorAction& aAction );
       
   214 
       
   215         // By default, prohibit copy constructor
       
   216         CMmsScheduledEntry( const CMmsScheduledEntry& );
       
   217         // Prohibit assignment operator
       
   218         CMmsScheduledEntry& operator= ( const CMmsScheduledEntry& );
       
   219 
       
   220     public:     // Data
       
   221     
       
   222     protected:  // Data
       
   223 
       
   224     private:    // Data
       
   225         CMmsRecipient* iRecipient; // scheduling information only
       
   226 
       
   227     public:     // Friend classes
       
   228     protected:  // Friend classes
       
   229     private:    // Friend classes
       
   230 
       
   231     };
       
   232 
       
   233 inline CMsvRecipient& CMmsScheduledEntry::MmsRecipient() const
       
   234     {
       
   235     return *iRecipient;
       
   236     }
       
   237 
       
   238 #endif      // MMSSCHEDULEDENTRY_H   
       
   239             
       
   240 // End of File