00001
00032 #ifndef LL_LLPREVIEWTEXTURE_H
00033 #define LL_LLPREVIEWTEXTURE_H
00034
00035 #include "llpreview.h"
00036 #include "llbutton.h"
00037 #include "llframetimer.h"
00038 #include "llviewerimage.h"
00039
00040 class LLImageRaw;
00041
00042 class LLPreviewTexture : public LLPreview
00043 {
00044 public:
00045 LLPreviewTexture(
00046 const std::string& name,
00047 const LLRect& rect,
00048 const std::string& title,
00049 const LLUUID& item_uuid,
00050 const LLUUID& object_id,
00051 BOOL show_keep_discard = FALSE);
00052 LLPreviewTexture(
00053 const std::string& name,
00054 const LLRect& rect,
00055 const std::string& title,
00056 const LLUUID& asset_id,
00057 BOOL copy_to_inv = FALSE);
00058 ~LLPreviewTexture();
00059
00060 virtual void draw();
00061
00062 virtual BOOL canSaveAs() const;
00063 virtual void saveAs();
00064
00065 virtual void loadAsset();
00066 virtual EAssetStatus getAssetStatus();
00067
00068 static void saveToFile(void* userdata);
00069 static void onFileLoadedForSave(
00070 BOOL success,
00071 LLViewerImage *src_vi,
00072 LLImageRaw* src,
00073 LLImageRaw* aux_src,
00074 S32 discard_level,
00075 BOOL final,
00076 void* userdata );
00077
00078
00079 protected:
00080 void init();
00081
00082 virtual const char *getTitleName() const { return "Texture"; }
00083
00084 private:
00085 void updateDimensions();
00086 LLUUID mImageID;
00087 LLPointer<LLViewerImage> mImage;
00088 BOOL mLoadingFullImage;
00089 LLString mSaveFileName;
00090 LLFrameTimer mSavedFileTimer;
00091 BOOL mShowKeepDiscard;
00092 BOOL mCopyToInv;
00093
00094
00095
00096 BOOL mIsCopyable;
00097
00098 S32 mLastHeight;
00099 S32 mLastWidth;
00100 };
00101
00102
00103 #endif // LL_LLPREVIEWTEXTURE_H