Index: src/libchcore/IFeedbackHandler.h =================================================================== diff -u -r7d59ab9183c933f2fc2682a95fb5d26cf2f952d7 -r671f4b1792a20d98b186f4e0a9cc6a620dede019 --- src/libchcore/IFeedbackHandler.h (.../IFeedbackHandler.h) (revision 7d59ab9183c933f2fc2682a95fb5d26cf2f952d7) +++ src/libchcore/IFeedbackHandler.h (.../IFeedbackHandler.h) (revision 671f4b1792a20d98b186f4e0a9cc6a620dede019) @@ -20,77 +20,45 @@ #define __FEEDBACKHANDLERBASE_H__ #include "libchcore.h" +#include "EFeedbackResult.h" #include "TString.h" +#include "TFileInfo.h" +#include "ISerializerRowReader.h" +#include "ISerializerRowData.h" BEGIN_CHCORE_NAMESPACE -class TFileInfo; -typedef boost::shared_ptr TFileInfoPtr; - -enum EFileError +enum class EFileError { - eDeleteError, ///< Problem occured when tried to delete the fs object - eSeekError, ///< Problem occured when tried to set file pointer - eResizeError, ///< Problem occured when tried to change size of the fs object - eReadError, ///< Problem occured when tried to read data from file - eWriteError, ///< Problem occured when tried to write data to a file - eFastMoveError, ///< Problem occured when tried to perform fast move operation (that does not involve copying contents) - eCreateError ///< Problem occured when tried to create the fs object + eDeleteError, ///< Problem occurred when tried to delete the fs object + eSeekError, ///< Problem occurred when tried to set file pointer + eResizeError, ///< Problem occurred when tried to change size of the fs object + eReadError, ///< Problem occurred when tried to read data from file + eWriteError, ///< Problem occurred when tried to write data to a file + eFastMoveError, ///< Problem occurred when tried to perform fast move operation (that does not involve copying contents) + eCreateError ///< Problem occurred when tried to create the fs object }; -struct FEEDBACK_ALREADYEXISTS -{ - TFileInfoPtr spSrcFileInfo; - TFileInfoPtr spDstFileInfo; -}; - -struct FEEDBACK_FILEERROR -{ - TString strSrcPath; - TString strDstPath; - EFileError eFileError; // error type - ulong_t ulError; // system error -}; - -struct FEEDBACK_NOTENOUGHSPACE -{ - ull_t ullRequiredSize; - TString strSrcPath; - TString strDstPath; -}; - class LIBCHCORE_API IFeedbackHandler { public: - enum EFeedbackType - { - eFT_Unknown = 0, - // requests for use feedback - eFT_FileAlreadyExists, - eFT_FileError, - eFT_NotEnoughSpace, - // notifications - eFT_OperationFinished, ///< Task has finished processing - eFT_OperationError, ///< Error encountered while processing task - eFT_LastType - }; + virtual ~IFeedbackHandler(); - enum EFeedbackResult - { - eResult_Unknown = 0, - eResult_Overwrite, - eResult_CopyRest, - eResult_Skip, - eResult_Cancel, - eResult_Pause, - eResult_Retry, - eResult_Ignore - }; + // requests with some processing data + virtual EFeedbackResult FileError(const TString& strSrcPath, const TString& strDstPath, EFileError eFileError, unsigned long ulError) = 0; + virtual EFeedbackResult FileAlreadyExists(const TFileInfoPtr& spSrcFileInfo, const TFileInfoPtr& spDstFileInfo) = 0; + virtual EFeedbackResult NotEnoughSpace(const TString& strSrcPath, const TString& strDstPath, unsigned long long ullRequiredSize) = 0; -public: - virtual ~IFeedbackHandler(); + // no-data requests + virtual EFeedbackResult OperationFinished() = 0; + virtual EFeedbackResult OperationError() = 0; - virtual unsigned long long RequestFeedback(unsigned long long ullFeedbackID, void* pFeedbackParam) = 0; + // reset permanent states + virtual void RestoreDefaults() = 0; + + //serialization + virtual void Store(const ISerializerContainerPtr& spContainer) const = 0; + virtual void Load(const ISerializerContainerPtr& spContainer) = 0; }; typedef boost::shared_ptr IFeedbackHandlerPtr;