/indra/newview/llchatitemscontainerctrl.h

https://bitbucket.org/lindenlab/viewer-beta/ · C Header · 97 lines · 47 code · 22 blank · 28 comment · 0 complexity · 9e7febd987d193466778225aca83f811 MD5 · raw file

  1. /**
  2. * @file llchatitemscontainerctrl.h
  3. * @brief chat history scrolling panel implementation
  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_LLCHATITEMSCONTAINERCTRL_H_
  27. #define LL_LLCHATITEMSCONTAINERCTRL_H_
  28. #include "llchat.h"
  29. #include "llpanel.h"
  30. #include "llscrollbar.h"
  31. #include "llviewerchat.h"
  32. #include "lltoastpanel.h"
  33. typedef enum e_show_item_header
  34. {
  35. CHATITEMHEADER_SHOW_ONLY_NAME = 0,
  36. CHATITEMHEADER_SHOW_ONLY_ICON = 1,
  37. CHATITEMHEADER_SHOW_BOTH
  38. } EShowItemHeader;
  39. class LLNearbyChatToastPanel: public LLToastPanelBase
  40. {
  41. protected:
  42. LLNearbyChatToastPanel()
  43. :
  44. mIsDirty(false),
  45. mSourceType(CHAT_SOURCE_OBJECT)
  46. {};
  47. public:
  48. ~LLNearbyChatToastPanel(){}
  49. static LLNearbyChatToastPanel* createInstance();
  50. const LLUUID& getFromID() const { return mFromID;}
  51. const std::string& getFromName() const { return mFromName; }
  52. //void addText (const std::string& message , const LLStyle::Params& input_params = LLStyle::Params());
  53. //void setMessage (const LLChat& msg);
  54. void snapToMessageHeight ();
  55. bool canAddText ();
  56. void onMouseLeave (S32 x, S32 y, MASK mask);
  57. void onMouseEnter (S32 x, S32 y, MASK mask);
  58. BOOL handleMouseDown (S32 x, S32 y, MASK mask);
  59. BOOL handleMouseUp (S32 x, S32 y, MASK mask);
  60. virtual BOOL postBuild();
  61. void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE);
  62. void setHeaderVisibility(EShowItemHeader e);
  63. BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
  64. virtual void init(LLSD& data);
  65. virtual void addMessage(LLSD& data);
  66. virtual void draw();
  67. //*TODO REMOVE, why a dup of getFromID?
  68. const LLUUID& messageID() const { return mFromID;}
  69. private:
  70. LLUUID mFromID; // agent id or object id
  71. std::string mFromName;
  72. EChatSourceType mSourceType;
  73. bool mIsDirty;
  74. };
  75. #endif