llpanelgroupbulk.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /**
  2. * @file llpanelgroupbulk.h
  3. * @brief Header file for llpanelgroupbulk
  4. * @author [email protected]
  5. *
  6. * $LicenseInfo:firstyear=2006&license=viewergpl$
  7. *
  8. * Copyright (c) 2006-2009, Linden Research, Inc.
  9. *
  10. * Second Life Viewer Source Code
  11. * The source code in this file ("Source Code") is provided by Linden Lab
  12. * to you under the terms of the GNU General Public License, version 2.0
  13. * ("GPL"), unless you have obtained a separate licensing agreement
  14. * ("Other License"), formally executed by you and Linden Lab. Terms of
  15. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  16. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  17. *
  18. * There are special exceptions to the terms and conditions of the GPL as
  19. * it is applied to this Source Code. View the full text of the exception
  20. * in the file doc/FLOSS-exception.txt in this software distribution, or
  21. * online at
  22. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  23. *
  24. * By copying, modifying or distributing this software, you acknowledge
  25. * that you have read and understood your obligations described above,
  26. * and agree to abide by those obligations.
  27. *
  28. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  29. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  30. * COMPLETENESS OR PERFORMANCE.
  31. * $/LicenseInfo$
  32. */
  33. #ifndef LL_LLPANELGROUPBULK_H
  34. #define LL_LLPANELGROUPBULK_H
  35. #include "llerror.h"
  36. #include "llpanel.h"
  37. #include "lluuid.h"
  38. class LLAvatarName;
  39. class LLComboBox;
  40. class LLFloater;
  41. class LLGroupMgrGroupData;
  42. class LLNameListCtrl;
  43. class LLPanelGroupBulkImpl;
  44. class LLTextBox;
  45. // Base panel class for bulk group invite / ban floaters
  46. class LLPanelGroupBulk : public LLPanel
  47. {
  48. protected:
  49. LOG_CLASS(LLPanelGroupBulk);
  50. public:
  51. LLPanelGroupBulk(const LLUUID& group_id, LLFloater* parent);
  52. ~LLPanelGroupBulk() override;
  53. void clear() override;
  54. virtual void update();
  55. void draw() override;
  56. static void callbackClickSubmit(void* userdata) {}
  57. virtual void submit() = 0;
  58. // this callback is being used to add a user whose fullname isn't been
  59. // loaded before invoking of addUsers().
  60. virtual void addUserCallback(const LLUUID& id,
  61. const LLAvatarName& av_name);
  62. virtual void addUsers(uuid_vec_t& agent_ids);
  63. protected:
  64. virtual void updateGroupName();
  65. virtual void updateGroupData();
  66. public:
  67. LLPanelGroupBulkImpl* mImplementation;
  68. protected:
  69. bool mPendingGroupPropertiesUpdate;
  70. bool mPendingRoleDataUpdate;
  71. bool mPendingMemberDataUpdate;
  72. };
  73. class LLPanelGroupBulkImpl
  74. {
  75. protected:
  76. LOG_CLASS(LLPanelGroupBulkImpl);
  77. public:
  78. LLPanelGroupBulkImpl(const LLUUID& group_id, LLFloater* parent);
  79. ~LLPanelGroupBulkImpl();
  80. static void callbackClickAdd(void* userdata);
  81. static void callbackClickRemove(void* userdata);
  82. static void callbackClickCancel(void* userdata);
  83. static void callbackSelect(LLUICtrl* ctrl, void* userdata);
  84. static void callbackAddUsers(const std::vector<std::string>&,
  85. const uuid_vec_t& agent_ids, void* user_data);
  86. static void onAvatarNameCache(const LLUUID& agent_id,
  87. const LLAvatarName& av_name,
  88. void* user_data);
  89. void handleRemove();
  90. void handleSelection();
  91. void addUsers(const std::vector<std::string>& names,
  92. const uuid_vec_t& agent_ids);
  93. void setGroupName(std::string name);
  94. public:
  95. // Max invites per request. 100 to match server cap.
  96. static constexpr S32 MAX_GROUP_INVITES = 100;
  97. LLFloater* mParentFloater;
  98. LLUUID mGroupID;
  99. LLNameListCtrl* mBulkAgentList;
  100. LLButton* mOKButton;
  101. LLButton* mRemoveButton;
  102. LLTextBox* mGroupName;
  103. std::string mLoadingText;
  104. std::string mTooManySelected;
  105. uuid_list_t mInviteeIDs;
  106. // The following are for the LLPanelGroupInvite subclass only. These aren't
  107. // needed for LLPanelGroupBulkBan, but if we have to add another group bulk
  108. // floater for some reason, we'll have these objects too.
  109. LLComboBox* mRoleNames;
  110. bool mConfirmedOwnerInvite;
  111. bool mListFullNotificationSent;
  112. std::string mOwnerWarning;
  113. std::string mAlreadyInGroup;
  114. };
  115. #endif // LL_LLPANELGROUPBULK_H