lltransfertargetfile.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLTRANSFERTARGETFILE_H
00033 #define LL_LLTRANSFERTARGETFILE_H
00034 
00035 #include "lltransfermanager.h"
00036 
00037 typedef void (*LLTTFCompleteCallback)(const LLTSCode status, void *user_data);
00038 
00039 class LLTransferTargetParamsFile : public LLTransferTargetParams
00040 {
00041 public:
00042         LLTransferTargetParamsFile() : LLTransferTargetParams(LLTTT_FILE) {}
00043         void setFilename(const LLString& filename)      { mFilename = filename; }
00044         void setCallback(LLTTFCompleteCallback cb, void *user_data)             { mCompleteCallback = cb; mUserData = user_data; }
00045 
00046         friend class LLTransferTargetFile;
00047 protected:
00048         LLString                                mFilename;
00049         LLTTFCompleteCallback   mCompleteCallback;
00050         void *                                  mUserData;
00051 };
00052 
00053 
00054 class LLTransferTargetFile : public LLTransferTarget
00055 {
00056 public:
00057         LLTransferTargetFile(const LLUUID& uuid, LLTransferSourceType src_type);
00058         virtual ~LLTransferTargetFile();
00059 
00060         static void requestTransfer(LLTransferTargetChannel *channelp,
00061                                                                 const char *local_filename,
00062                                                                 const LLTransferSourceParams &source_params,
00063                                                                 LLTTFCompleteCallback callback);
00064 protected:
00065         virtual bool unpackParams(LLDataPacker& dp);
00066         /*virtual*/ void applyParams(const LLTransferTargetParams &params);
00067         /*virtual*/ LLTSCode dataCallback(const S32 packet_id, U8 *in_datap, const S32 in_size);
00068         /*virtual*/ void completionCallback(const LLTSCode status);
00069 
00070         LLTransferTargetParamsFile mParams;
00071 
00072         FILE *mFP;
00073 };
00074 
00075 #endif // LL_LLTRANSFERTARGETFILE_H

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