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: williamr@2: #ifndef SCHEDULE_BASE_SERVER_MTM_H_ williamr@2: #define SCHEDULE_BASE_SERVER_MTM_H_ williamr@2: williamr@2: ///////////////////////////////////////////////////////////////////////////// williamr@2: // williamr@2: // CScheduleBaseServerMtm Declaration williamr@2: // williamr@2: ///////////////////////////////////////////////////////////////////////////// williamr@2: williamr@2: williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: williamr@2: class CMsvScheduleSend; williamr@2: class CMsvSysAgentActions; williamr@2: class TMsvSendErrorAction; williamr@2: class TMsvSchedulePackage; williamr@2: class CRepository; williamr@2: williamr@2: class CScheduleBaseServerMtm : public CBaseServerMtm williamr@2: /** williamr@2: Base class for Server MTMs that support scheduling. williamr@2: williamr@2: It contains pure virtual functions which must be implemented by the Server williamr@2: MTM. These functions are not required for interoperability with any other williamr@2: classes, however they are essential functionality that must be implemented williamr@2: by a Server MTM that support scheduling. williamr@2: williamr@2: CScheduleBaseServerMtm uses a class derived from CMsvScheduleSend to williamr@2: interface with the task scheduler. williamr@2: williamr@2: @see CMsvScheduleSend williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: protected: williamr@2: williamr@2: // --- Construction --- williamr@2: williamr@2: IMPORT_C CScheduleBaseServerMtm(CRegisteredMtmDll& aRegisteredMtmDll, CMsvServerEntry* aServerEntry); williamr@2: williamr@2: // --- Send the Scheduled Messages --- williamr@2: williamr@2: IMPORT_C virtual void SendScheduledL(CMsvEntrySelection& aSelection, const TBool aMove, const TDesC8& aParameter, TRequestStatus& aStatus); williamr@2: IMPORT_C virtual void ScheduleL(CMsvEntrySelection& aSelection, const TBool aMove, const TDesC8& aParameter, TRequestStatus& aStatus); williamr@2: IMPORT_C virtual void ConstructL(); williamr@2: IMPORT_C void LoadResourceFileL(const TDesC& aResFileName); williamr@2: williamr@2: // Other Schedule Commands williamr@2: williamr@2: IMPORT_C virtual void CheckScheduleL(const CMsvEntrySelection& aSelection, const TDesC8& aParameter, TRequestStatus& aStatus); williamr@2: IMPORT_C virtual void DeleteScheduleL(const CMsvEntrySelection& aSelection, const TDesC8& aParameter, TRequestStatus& aStatus); williamr@2: williamr@2: // --- Pure virtual functions that must be implemented in a derived class --- williamr@2: williamr@2: /** williamr@2: Populates a TMsvSchedulePackage object with scheduling information. williamr@2: williamr@2: @param aParameter Parameter information for the package williamr@2: @param aMove Flag that signals whether a move or copy is required williamr@2: @param aPackage On return, a populated object williamr@2: */ williamr@2: virtual void PopulateSchedulePackage(const TDesC8& aParameter, const TBool aMove, TMsvSchedulePackage& aPackage) const = 0; williamr@2: williamr@2: /** williamr@2: Loads the resource file (if any) for the MTM. williamr@2: */ williamr@2: virtual void LoadResourceFileL() = 0; williamr@2: williamr@2: williamr@2: IMPORT_C void Queue(TRequestStatus& aStatus); williamr@2: williamr@2: IMPORT_C void LoadScheduleSettingsL(CRepository& aRepository, TBool aRestoreErrorsFromResource = EFalse, TInt aErrorsResourceId = 0); williamr@2: williamr@2: protected: williamr@2: williamr@2: IMPORT_C ~CScheduleBaseServerMtm(); williamr@2: williamr@2: private: williamr@2: williamr@2: void RequestComplete(TRequestStatus* aStatus, TInt aError); williamr@2: williamr@2: protected: williamr@2: williamr@2: // --- Data Member --- williamr@2: williamr@2: /** Message scheduler. */ williamr@2: CMsvScheduleSend* iScheduleSend; //Should be constructed and deleted by the derived class williamr@2: williamr@2: /** MTM resource file. */ williamr@2: RResourceFile iResourceFile; williamr@2: /** File server handle. */ williamr@2: RFs iFs; williamr@2: /** Asynchronous status word. */ williamr@2: TRequestStatus* iReport; williamr@2: }; williamr@2: williamr@2: #endif