PageRenderTime 40ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llui/lliconctrl.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 94 lines | 44 code | 16 blank | 34 comment | 0 complexity | 511a8b00493c91803f3a3199e8e9e26e MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lliconctrl.h
  3. * @brief LLIconCtrl base class
  4. *
  5. * $LicenseInfo:firstyear=2001&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_LLICONCTRL_H
  27. #define LL_LLICONCTRL_H
  28. #include "lluuid.h"
  29. #include "v4color.h"
  30. #include "lluictrl.h"
  31. #include "lluiimage.h"
  32. #include "stdenums.h"
  33. class LLTextBox;
  34. class LLUICtrlFactory;
  35. //
  36. // Classes
  37. //
  38. //
  39. class LLIconCtrl
  40. : public LLUICtrl
  41. {
  42. public:
  43. struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
  44. {
  45. Optional<LLUIImage*> image;
  46. Optional<LLUIColor> color;
  47. Optional<bool> use_draw_context_alpha;
  48. Ignored scale_image;
  49. Params();
  50. };
  51. protected:
  52. LLIconCtrl(const Params&);
  53. friend class LLUICtrlFactory;
  54. public:
  55. virtual ~LLIconCtrl();
  56. // llview overrides
  57. virtual void draw();
  58. // lluictrl overrides
  59. virtual void setValue(const LLSD& value );
  60. std::string getImageName() const;
  61. void setColor(const LLColor4& color) { mColor = color; }
  62. void setImage(LLPointer<LLUIImage> image) { mImagep = image; }
  63. const LLPointer<LLUIImage> getImage() { return mImagep; }
  64. private:
  65. void setIconImageDrawSize() ;
  66. protected:
  67. S32 mPriority;
  68. //the output size of the icon image if set.
  69. S32 mDrawWidth ;
  70. S32 mDrawHeight ;
  71. // If set to true (default), use the draw context transparency.
  72. // If false, will use transparency returned by getCurrentTransparency(). See STORM-698.
  73. bool mUseDrawContextAlpha;
  74. private:
  75. LLUIColor mColor;
  76. LLPointer<LLUIImage> mImagep;
  77. };
  78. #endif