PageRenderTime 83ms CodeModel.GetById 39ms RepoModel.GetById 1ms app.codeStats 1ms

/indra/newview/llfloatersnapshot.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 104 lines | 60 code | 18 blank | 26 comment | 0 complexity | 32866f11064e731de84ed19a88f4c05b MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llfloatersnapshot.h
  3. * @brief Snapshot preview window, allowing saving, e-mailing, etc.
  4. *
  5. * $LicenseInfo:firstyear=2004&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_LLFLOATERSNAPSHOT_H
  27. #define LL_LLFLOATERSNAPSHOT_H
  28. #include "llimage.h"
  29. #include "llfloater.h"
  30. class LLSpinCtrl;
  31. class LLFloaterSnapshot : public LLFloater
  32. {
  33. LOG_CLASS(LLFloaterSnapshot);
  34. public:
  35. typedef enum e_snapshot_format
  36. {
  37. SNAPSHOT_FORMAT_PNG,
  38. SNAPSHOT_FORMAT_JPEG,
  39. SNAPSHOT_FORMAT_BMP
  40. } ESnapshotFormat;
  41. LLFloaterSnapshot(const LLSD& key);
  42. virtual ~LLFloaterSnapshot();
  43. /*virtual*/ BOOL postBuild();
  44. /*virtual*/ void draw();
  45. /*virtual*/ void onOpen(const LLSD& key);
  46. /*virtual*/ void onClose(bool app_quitting);
  47. /*virtual*/ S32 notify(const LLSD& info);
  48. static void update();
  49. // TODO: create a snapshot model instead
  50. static LLFloaterSnapshot* getInstance();
  51. static void saveTexture();
  52. static BOOL saveLocal();
  53. static void preUpdate();
  54. static void postUpdate();
  55. static void postSave();
  56. static void postPanelSwitch();
  57. static LLPointer<LLImageFormatted> getImageData();
  58. static const LLVector3d& getPosTakenGlobal();
  59. static void setAgentEmail(const std::string& email);
  60. static const LLRect& getThumbnailPlaceholderRect() { return sThumbnailPlaceholder->getRect(); }
  61. private:
  62. static LLUICtrl* sThumbnailPlaceholder;
  63. LLUICtrl *mRefreshBtn, *mRefreshLabel;
  64. LLUICtrl *mSucceessLblPanel, *mFailureLblPanel;
  65. class Impl;
  66. Impl& impl;
  67. };
  68. class LLSnapshotFloaterView : public LLFloaterView
  69. {
  70. public:
  71. struct Params
  72. : public LLInitParam::Block<Params, LLFloaterView::Params>
  73. {
  74. };
  75. protected:
  76. LLSnapshotFloaterView (const Params& p);
  77. friend class LLUICtrlFactory;
  78. public:
  79. virtual ~LLSnapshotFloaterView();
  80. /*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
  81. /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
  82. /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
  83. /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
  84. };
  85. extern LLSnapshotFloaterView* gSnapshotFloaterView;
  86. #endif // LL_LLFLOATERSNAPSHOT_H