llpanelgroupnotices.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /**
  2. * @file llpanelgroupnotices.h
  3. * @brief A panel to display group notices.
  4. *
  5. * $LicenseInfo:firstyear=2006&license=viewergpl$
  6. *
  7. * Copyright (c) 2006-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLPANELGROUPNOTICES_H
  33. #define LL_LLPANELGROUPNOTICES_H
  34. #include "llinventory.h"
  35. #include "llpointer.h"
  36. #include "llpanelgroup.h"
  37. class LLLineEditor;
  38. class LLTextEditor;
  39. class LLButton;
  40. class LLIconCtrl;
  41. class LLCheckBoxCtrl;
  42. class LLScrollListCtrl;
  43. class LLPanelGroupNotices : public LLPanelGroupTab
  44. {
  45. protected:
  46. LOG_CLASS(LLPanelGroupNotices);
  47. public:
  48. LLPanelGroupNotices(const std::string& name, const LLUUID& group_id);
  49. virtual ~LLPanelGroupNotices();
  50. // LLPanelGroupTab
  51. static void* createTab(void* data);
  52. virtual void activate();
  53. //virtual bool needsApply(std::string& mesg);
  54. //virtual bool apply(std::string& mesg);
  55. //virtual void update();
  56. virtual bool postBuild();
  57. virtual bool isVisibleByAgent();
  58. void setItem(LLPointer<LLInventoryItem> inv_item);
  59. static void processGroupNoticesListReply(LLMessageSystem* msg,
  60. void** data);
  61. void showNotice(const std::string& subject, const std::string& message,
  62. bool has_inventory, const std::string& inventory_name,
  63. LLOfferInfo* inventory_offer);
  64. private:
  65. static void onClickRemoveAttachment(void* data);
  66. static void onClickOpenAttachment(void* data);
  67. static void onClickSendMessage(void* data);
  68. static void onClickNewMessage(void* data);
  69. static void onClickRefreshNotices(void* data);
  70. void processNotices(LLMessageSystem* msg);
  71. static void onSelectNotice(LLUICtrl* ctrl, void* data);
  72. enum ENoticeView
  73. {
  74. VIEW_PAST_NOTICE,
  75. CREATE_NEW_NOTICE
  76. };
  77. void arrangeNoticeView(ENoticeView view_type);
  78. private:
  79. LLPointer<LLInventoryItem> mInventoryItem;
  80. LLLineEditor* mCreateSubject;
  81. LLLineEditor* mCreateInventoryName;
  82. LLTextEditor* mCreateMessage;
  83. LLLineEditor* mViewSubject;
  84. LLLineEditor* mViewInventoryName;
  85. LLTextEditor* mViewMessage;
  86. LLButton* mBtnSendMessage;
  87. LLButton* mBtnNewMessage;
  88. LLButton* mBtnRemoveAttachment;
  89. LLButton* mBtnOpenAttachment;
  90. LLButton* mBtnGetPastNotices;
  91. LLPanel* mPanelCreateNotice;
  92. LLPanel* mPanelViewNotice;
  93. LLIconCtrl* mCreateInventoryIcon;
  94. LLIconCtrl* mViewInventoryIcon;
  95. LLScrollListCtrl* mNoticesList;
  96. std::string mNoNoticesStr;
  97. LLOfferInfo* mInventoryOffer;
  98. bool mInitOK;
  99. typedef fast_hmap<LLUUID, LLPanelGroupNotices*> instances_map_t;
  100. static instances_map_t sInstances;
  101. };
  102. #endif