PageRenderTime 37ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llfloatergroups.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 128 lines | 64 code | 23 blank | 41 comment | 0 complexity | 3402038e8cddd6182ab0306d6dd37475 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llfloatergroups.h
  3. * @brief LLFloaterGroups class definition
  4. *
  5. * $LicenseInfo:firstyear=2002&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. /*
  27. * Shown from Edit -> Groups...
  28. * Shows the agent's groups and allows the edit window to be invoked.
  29. * Also overloaded to allow picking of a single group for assigning
  30. * objects and land to groups.
  31. */
  32. #ifndef LL_LLFLOATERGROUPS_H
  33. #define LL_LLFLOATERGROUPS_H
  34. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  35. // Class llfloatergroups
  36. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  37. #include "lluuid.h"
  38. #include "llfloater.h"
  39. #include <map>
  40. #include <boost/function.hpp>
  41. #include <boost/signals2.hpp>
  42. class LLUICtrl;
  43. class LLTextBox;
  44. class LLScrollListCtrl;
  45. class LLButton;
  46. class LLFloaterGroupPicker;
  47. class LLFloaterGroupPicker : public LLFloater
  48. {
  49. public:
  50. LLFloaterGroupPicker(const LLSD& seed);
  51. ~LLFloaterGroupPicker();
  52. // Note: Don't return connection; use boost::bind + boost::signals2::trackable to disconnect slots
  53. typedef boost::signals2::signal<void (LLUUID id)> signal_t;
  54. void setSelectGroupCallback(const signal_t::slot_type& cb) { mGroupSelectSignal.connect(cb); }
  55. void setPowersMask(U64 powers_mask);
  56. BOOL postBuild();
  57. // implementation of factory policy
  58. static LLFloaterGroupPicker* findInstance(const LLSD& seed);
  59. static LLFloaterGroupPicker* createInstance(const LLSD& seed);
  60. // for cases like inviting avatar to group we don't want the none option
  61. void removeNoneOption();
  62. protected:
  63. void ok();
  64. static void onBtnOK(void* userdata);
  65. static void onBtnCancel(void* userdata);
  66. protected:
  67. LLUUID mID;
  68. U64 mPowersMask;
  69. signal_t mGroupSelectSignal;
  70. typedef std::map<const LLUUID, LLFloaterGroupPicker*> instance_map_t;
  71. static instance_map_t sInstances;
  72. };
  73. class LLPanelGroups : public LLPanel, public LLOldEvents::LLSimpleListener
  74. {
  75. public:
  76. LLPanelGroups();
  77. virtual ~LLPanelGroups();
  78. //LLEventListener
  79. /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
  80. // clear the group list, and get a fresh set of info.
  81. void reset();
  82. protected:
  83. // initialize based on the type
  84. BOOL postBuild();
  85. // highlight_id is a group id to highlight
  86. void enableButtons();
  87. static void onGroupList(LLUICtrl* ctrl, void* userdata);
  88. static void onBtnCreate(void* userdata);
  89. static void onBtnActivate(void* userdata);
  90. static void onBtnInfo(void* userdata);
  91. static void onBtnIM(void* userdata);
  92. static void onBtnLeave(void* userdata);
  93. static void onBtnSearch(void* userdata);
  94. static void onBtnVote(void* userdata);
  95. static void onDoubleClickGroup(void* userdata);
  96. void create();
  97. void activate();
  98. void info();
  99. void startIM();
  100. void leave();
  101. void search();
  102. void callVote();
  103. static bool callbackLeaveGroup(const LLSD& notification, const LLSD& response);
  104. };
  105. #endif // LL_LLFLOATERGROUPS_H