PageRenderTime 43ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/lltoastpanel.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 70 lines | 25 code | 9 blank | 36 comment | 0 complexity | e81c7feae9dd420df991599f8828f9d3 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lltoastpanel.h
  3. * @brief Creates a panel of a specific kind for a toast.
  4. *
  5. * $LicenseInfo:firstyear=2003&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_LLTOASTPANEL_H
  27. #define LL_LLTOASTPANEL_H
  28. #include "llpanel.h"
  29. #include "lltextbox.h"
  30. #include "llnotificationptr.h"
  31. #include <string>
  32. class LLToastPanelBase: public LLPanel
  33. {
  34. public:
  35. virtual void init(LLSD& data){};
  36. };
  37. /**
  38. * Base class for all panels that can be added to the toast.
  39. * All toast panels should contain necessary logic for representing certain notification
  40. * but shouldn't contain logic related to this panel lifetime control and positioning
  41. * on the parent view.
  42. */
  43. class LLToastPanel: public LLPanel {
  44. public:
  45. LLToastPanel(const LLNotificationPtr&);
  46. virtual ~LLToastPanel() = 0;
  47. virtual std::string getTitle();
  48. virtual const LLUUID& getID();
  49. static const S32 MIN_PANEL_HEIGHT;
  50. /**
  51. * Builder method for constructing notification specific panels.
  52. * Normally type of created panels shouldn't be publicated and should be hidden
  53. * from other functionality.
  54. */
  55. static LLToastPanel* buidPanelFromNotification(
  56. const LLNotificationPtr& notification);
  57. protected:
  58. LLNotificationPtr mNotification;
  59. void snapToMessageHeight(LLTextBase* message, S32 maxLineCount);
  60. };
  61. #endif /* LL_TOASTPANEL_H */