messagingfw/scheduledsendmtm/schedulesendmtm/inc/ScheduleBaseServerMtm.h
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     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 
       
    17 #ifndef SCHEDULE_BASE_SERVER_MTM_H_
       
    18 #define SCHEDULE_BASE_SERVER_MTM_H_
       
    19 
       
    20 //
       
    21 //
       
    22 //	CScheduleBaseServerMtm Declaration
       
    23 //
       
    24 //
       
    25 
       
    26  
       
    27 
       
    28 #include <mtsr.h>
       
    29 #include <barsc.h>
       
    30 
       
    31 
       
    32 class CMsvScheduleSend;
       
    33 class CMsvSysAgentActions;
       
    34 class TMsvSendErrorAction;
       
    35 class TMsvSchedulePackage;
       
    36 class CRepository;
       
    37 
       
    38 class CScheduleBaseServerMtm : public CBaseServerMtm
       
    39 /**
       
    40 Base class for Server MTMs that support scheduling.
       
    41 
       
    42 It contains pure virtual functions which must be implemented by the Server 
       
    43 MTM. These functions are not required for interoperability with any other 
       
    44 classes, however they are essential functionality that must be implemented 
       
    45 by a Server MTM that support scheduling.
       
    46 
       
    47 CScheduleBaseServerMtm uses a class derived from CMsvScheduleSend to
       
    48 interface with the task scheduler.
       
    49 
       
    50 @see CMsvScheduleSend
       
    51 @publishedAll
       
    52 @released
       
    53 */
       
    54 	{
       
    55 protected:
       
    56 
       
    57 //	--- Construction ---
       
    58 
       
    59 	IMPORT_C CScheduleBaseServerMtm(CRegisteredMtmDll& aRegisteredMtmDll, CMsvServerEntry* aServerEntry);
       
    60 
       
    61 //	--- Send the Scheduled Messages ---
       
    62 
       
    63 	IMPORT_C virtual void SendScheduledL(CMsvEntrySelection& aSelection, const TBool aMove, const TDesC8& aParameter, TRequestStatus& aStatus);
       
    64 	IMPORT_C virtual void ScheduleL(CMsvEntrySelection& aSelection, const TBool aMove, const TDesC8& aParameter, TRequestStatus& aStatus);
       
    65 	IMPORT_C virtual void ConstructL();
       
    66 	IMPORT_C void LoadResourceFileL(const TDesC& aResFileName);
       
    67 
       
    68 // Other Schedule Commands
       
    69 
       
    70 	IMPORT_C virtual void CheckScheduleL(const CMsvEntrySelection& aSelection, const TDesC8& aParameter, TRequestStatus& aStatus);
       
    71 	IMPORT_C virtual void DeleteScheduleL(const CMsvEntrySelection& aSelection, const TDesC8& aParameter, TRequestStatus& aStatus);
       
    72 
       
    73 //	--- Pure virtual functions that must be implemented in a derived class ---
       
    74 
       
    75 	/**
       
    76 	Populates a TMsvSchedulePackage object with scheduling information.
       
    77 	
       
    78 	@param aParameter Parameter information for the package
       
    79 	@param aMove Flag that signals whether a move or copy is required
       
    80 	@param aPackage On return, a populated object
       
    81 	*/
       
    82 	virtual void PopulateSchedulePackage(const TDesC8& aParameter, const TBool aMove, TMsvSchedulePackage& aPackage) const = 0;
       
    83 	
       
    84 	/**
       
    85 	Loads the resource file (if any) for the MTM.
       
    86 	*/
       
    87 	virtual void LoadResourceFileL() = 0;
       
    88 
       
    89 
       
    90 	IMPORT_C void Queue(TRequestStatus& aStatus);
       
    91 
       
    92 	IMPORT_C void LoadScheduleSettingsL(CRepository& aRepository, TBool aRestoreErrorsFromResource = EFalse, TInt aErrorsResourceId = 0);
       
    93 
       
    94 protected:
       
    95 
       
    96 	IMPORT_C ~CScheduleBaseServerMtm();
       
    97 
       
    98 private:
       
    99 
       
   100 	void RequestComplete(TRequestStatus* aStatus, TInt aError);
       
   101 
       
   102 protected:
       
   103 
       
   104 //	--- Data Member ---
       
   105 
       
   106 	/** Message scheduler. */
       
   107 	CMsvScheduleSend* iScheduleSend; //Should be constructed and deleted by the derived class
       
   108 
       
   109 	/** MTM resource file. */
       
   110 	RResourceFile iResourceFile;
       
   111 	/** File server handle. */
       
   112 	RFs iFs;
       
   113 	/** Asynchronous status word. */
       
   114 	TRequestStatus* iReport;
       
   115 	};
       
   116 
       
   117 #endif