PageRenderTime 28ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llui/llwindowshade.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 78 lines | 41 code | 12 blank | 25 comment | 0 complexity | 97042d75771b446039521bc689f81dbd MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llwindowshade.h
  3. * @brief Notification dialog that slides down and optionally disabled a piece of UI
  4. *
  5. * $LicenseInfo:firstyear=2006&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_LLWINDOWSHADE_H
  27. #define LL_LLWINDOWSHADE_H
  28. #include "lluictrl.h"
  29. #include "llnotifications.h"
  30. #include "lluiimage.h"
  31. class LLWindowShade : public LLUICtrl
  32. {
  33. public:
  34. struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
  35. {
  36. Optional<LLUIImage*> bg_image;
  37. Optional<LLUIColor> text_color,
  38. shade_color;
  39. Optional<bool> modal,
  40. can_close;
  41. Params();
  42. };
  43. void show(LLNotificationPtr);
  44. /*virtual*/ void draw();
  45. void hide();
  46. bool isShown() const;
  47. void setBackgroundImage(LLUIImage* image);
  48. void setTextColor(LLColor4 color);
  49. void setCanClose(bool can_close);
  50. private:
  51. void displayLatestNotification();
  52. LLNotificationPtr getCurrentNotification();
  53. friend class LLUICtrlFactory;
  54. LLWindowShade(const Params& p);
  55. void initFromParams(const Params& params);
  56. void onCloseNotification();
  57. void onClickNotificationButton(const std::string& name);
  58. void onEnterNotificationText(LLUICtrl* ctrl, const std::string& name);
  59. void onClickIgnore(LLUICtrl* ctrl);
  60. std::vector<LLNotificationPtr> mNotifications;
  61. LLSD mNotificationResponse;
  62. bool mModal;
  63. S32 mFormHeight;
  64. LLUIColor mTextColor;
  65. };
  66. #endif // LL_LLWINDOWSHADE_H