PageRenderTime 43ms CodeModel.GetById 9ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llpreviewtexture.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 99 lines | 56 code | 15 blank | 28 comment | 0 complexity | 4aff7edad1470c56071890d05e13061a MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llpreviewtexture.h
  3. * @brief LLPreviewTexture class definition
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLPREVIEWTEXTURE_H
  27. #define LL_LLPREVIEWTEXTURE_H
  28. #include "llpreview.h"
  29. #include "llbutton.h"
  30. #include "llframetimer.h"
  31. #include "llviewertexture.h"
  32. class LLComboBox;
  33. class LLImageRaw;
  34. class LLPreviewTexture : public LLPreview
  35. {
  36. public:
  37. LLPreviewTexture(const LLSD& key);
  38. ~LLPreviewTexture();
  39. virtual void draw();
  40. virtual BOOL canSaveAs() const;
  41. virtual void saveAs();
  42. virtual void loadAsset();
  43. virtual EAssetStatus getAssetStatus();
  44. virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
  45. virtual void onFocusReceived();
  46. static void onFileLoadedForSave(
  47. BOOL success,
  48. LLViewerFetchedTexture *src_vi,
  49. LLImageRaw* src,
  50. LLImageRaw* aux_src,
  51. S32 discard_level,
  52. BOOL final,
  53. void* userdata );
  54. void openToSave();
  55. static void onSaveAsBtn(void* data);
  56. /*virtual*/ void setObjectID(const LLUUID& object_id);
  57. protected:
  58. void init();
  59. /* virtual */ BOOL postBuild();
  60. bool setAspectRatio(const F32 width, const F32 height);
  61. static void onAspectRatioCommit(LLUICtrl*,void* userdata);
  62. private:
  63. void updateImageID(); // set what image is being uploaded.
  64. void updateDimensions();
  65. LLUUID mImageID;
  66. LLPointer<LLViewerFetchedTexture> mImage;
  67. S32 mImageOldBoostLevel;
  68. std::string mSaveFileName;
  69. LLFrameTimer mSavedFileTimer;
  70. BOOL mLoadingFullImage;
  71. BOOL mShowKeepDiscard;
  72. BOOL mCopyToInv;
  73. // Save the image once it's loaded.
  74. BOOL mPreviewToSave;
  75. // This is stored off in a member variable, because the save-as
  76. // button and drag and drop functionality need to know.
  77. BOOL mIsCopyable;
  78. BOOL mUpdateDimensions;
  79. S32 mLastHeight;
  80. S32 mLastWidth;
  81. F32 mAspectRatio;
  82. LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ;
  83. };
  84. #endif // LL_LLPREVIEWTEXTURE_H