PageRenderTime 36ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llpanelgroup.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 173 lines | 88 code | 47 blank | 38 comment | 0 complexity | a306f68a6efef8533019011e8712949f MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llpanelgroup.h
  3. *
  4. * $LicenseInfo:firstyear=2006&license=viewerlgpl$
  5. * Second Life Viewer Source Code
  6. * Copyright (C) 2010, Linden Research, Inc.
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation;
  11. * version 2.1 of the License only.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  23. * $/LicenseInfo$
  24. */
  25. #ifndef LL_LLPANELGROUP_H
  26. #define LL_LLPANELGROUP_H
  27. #include "llgroupmgr.h"
  28. #include "llpanel.h"
  29. #include "lltimer.h"
  30. #include "llvoiceclient.h"
  31. class LLOfferInfo;
  32. const S32 UPDATE_MEMBERS_PER_FRAME = 500;
  33. // Forward declares
  34. class LLPanelGroupTab;
  35. class LLTabContainer;
  36. class LLAgent;
  37. class LLPanelGroup : public LLPanel,
  38. public LLGroupMgrObserver,
  39. public LLVoiceClientStatusObserver
  40. {
  41. public:
  42. LLPanelGroup();
  43. virtual ~LLPanelGroup();
  44. virtual BOOL postBuild();
  45. void setGroupID(const LLUUID& group_id);
  46. void draw();
  47. void onOpen(const LLSD& key);
  48. // Group manager observer trigger.
  49. virtual void changed(LLGroupChange gc);
  50. // Implements LLVoiceClientStatusObserver::onChange() to enable the call
  51. // button when voice is available
  52. /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
  53. void showNotice(const std::string& subject,
  54. const std::string& message,
  55. const bool& has_inventory,
  56. const std::string& inventory_name,
  57. LLOfferInfo* inventory_offer);
  58. void notifyObservers();
  59. bool apply();
  60. void refreshData();
  61. void callGroup();
  62. void chatGroup();
  63. virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
  64. static void refreshCreatedGroup(const LLUUID& group_id);
  65. static void showNotice(const std::string& subject,
  66. const std::string& message,
  67. const LLUUID& group_id,
  68. const bool& has_inventory,
  69. const std::string& inventory_name,
  70. LLOfferInfo* inventory_offer);
  71. protected:
  72. virtual void update(LLGroupChange gc);
  73. void onBtnCreate();
  74. void onBackBtnClick();
  75. void onBtnJoin();
  76. void onBtnCancel();
  77. static void onBtnApply(void*);
  78. static void onBtnRefresh(void*);
  79. static void onBtnGroupCallClicked(void*);
  80. static void onBtnGroupChatClicked(void*);
  81. void reposButton(const std::string& name);
  82. void reposButtons();
  83. protected:
  84. bool apply(LLPanelGroupTab* tab);
  85. LLTimer mRefreshTimer;
  86. BOOL mSkipRefresh;
  87. std::string mDefaultNeedsApplyMesg;
  88. std::string mWantApplyMesg;
  89. std::vector<LLPanelGroupTab* > mTabs;
  90. LLButton* mButtonJoin;
  91. LLUICtrl* mJoinText;
  92. };
  93. class LLPanelGroupTab : public LLPanel
  94. {
  95. public:
  96. LLPanelGroupTab();
  97. virtual ~LLPanelGroupTab();
  98. // Triggered when the tab becomes active.
  99. virtual void activate() { }
  100. // Triggered when the tab becomes inactive.
  101. virtual void deactivate() { }
  102. // Asks if something needs to be applied.
  103. // If returning true, this function should modify the message to the user.
  104. virtual bool needsApply(std::string& mesg) { return false; }
  105. // Asks if there is currently a modal dialog being shown.
  106. virtual BOOL hasModal() { return mHasModal; }
  107. // Request to apply current data.
  108. // If returning fail, this function should modify the message to the user.
  109. virtual bool apply(std::string& mesg) { return true; }
  110. // Request a cancel of changes
  111. virtual void cancel() { }
  112. // Triggered when group information changes in the group manager.
  113. virtual void update(LLGroupChange gc) { }
  114. // This just connects the help button callback.
  115. virtual BOOL postBuild();
  116. virtual BOOL isVisibleByAgent(LLAgent* agentp);
  117. virtual void setGroupID(const LLUUID& id) {mGroupID = id;};
  118. void notifyObservers() {};
  119. const LLUUID& getGroupID() const { return mGroupID;}
  120. virtual void setupCtrls (LLPanel* parent) {};
  121. protected:
  122. LLUUID mGroupID;
  123. BOOL mAllowEdit;
  124. BOOL mHasModal;
  125. };
  126. #endif // LL_LLPANELGROUP_H