lltransfertargetvfile.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLTRANSFERTARGETVFILE_H
00033 #define LL_LLTRANSFERTARGETVFILE_H
00034 
00035 #include "lltransfermanager.h"
00036 #include "llassetstorage.h"
00037 #include "llvfile.h"
00038 
00039 class LLVFile;
00040 
00041 // Lame, an S32 for now until I figure out the deal with how we want to do
00042 // error codes.
00043 typedef void (*LLTTVFCompleteCallback)(
00044         S32 status,
00045         const LLUUID& file_id,
00046         LLAssetType::EType file_type,
00047         void* user_data, LLExtStat ext_status );
00048 
00049 class LLTransferTargetParamsVFile : public LLTransferTargetParams
00050 {
00051 public:
00052         LLTransferTargetParamsVFile();
00053 
00054         void setAsset(const LLUUID& asset_id, LLAssetType::EType asset_type);
00055         void setCallback(LLTTVFCompleteCallback cb, void* user_data);
00056 
00057         LLUUID getAssetID() const                                               { return mAssetID; }
00058         LLAssetType::EType getAssetType() const                 { return mAssetType; }
00059 
00060         friend class LLTransferTargetVFile;
00061 protected:
00062         bool unpackParams(LLDataPacker& dp);
00063 
00064         LLUUID                          mAssetID;
00065         LLAssetType::EType      mAssetType;
00066 
00067         LLTTVFCompleteCallback  mCompleteCallback;
00068         void*                                   mUserDatap;
00069         S32                                             mErrCode;
00070         LLVFSThread::handle_t   mHandle;
00071 };
00072 
00073 
00074 class LLTransferTargetVFile : public LLTransferTarget
00075 {
00076 public:
00077         LLTransferTargetVFile(const LLUUID& uuid, LLTransferSourceType src_type);
00078         virtual ~LLTransferTargetVFile();
00079 
00080         //static void requestTransfer(LLTransferTargetChannel* channelp,
00081         //                                                      const char* local_filename,
00082         //                                                      const LLTransferSourceParams& source_params,
00083         //                                                      LLTTVFCompleteCallback callback);
00084 
00085         static void updateQueue(bool shutdown = false);
00086         
00087 protected:
00088         virtual bool unpackParams(LLDataPacker& dp);
00089         /*virtual*/ void applyParams(const LLTransferTargetParams& params);
00090         /*virtual*/ LLTSCode dataCallback(const S32 packet_id, U8* in_datap, const S32 in_size);
00091         /*virtual*/ void completionCallback(const LLTSCode status);
00092 
00093         LLTransferTargetParamsVFile mParams;
00094 
00095         BOOL mNeedsCreate;
00096         LLUUID mTempID;
00097 };
00098 
00099 #endif // LL_LLTRANSFERTARGETFILE_H

Generated on Thu Jul 1 06:09:23 2010 for Second Life Viewer by  doxygen 1.4.7