PageRenderTime 44ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llpanelblockedlist.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 111 lines | 47 code | 21 blank | 43 comment | 0 complexity | 6706a31d0449327a9fb6c617f5edba19 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llpanelblockedlist.h
  3. * @brief Container for blocked Residents & Objects list
  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. #ifndef LL_LLPANELBLOCKEDLIST_H
  27. #define LL_LLPANELBLOCKEDLIST_H
  28. #include "llpanel.h"
  29. #include "llmutelist.h"
  30. #include "llfloater.h"
  31. // #include <vector>
  32. // class LLButton;
  33. // class LLLineEditor;
  34. // class LLMessageSystem;
  35. // class LLUUID;
  36. class LLAvatarName;
  37. class LLScrollListCtrl;
  38. class LLPanelBlockedList
  39. : public LLPanel, public LLMuteListObserver
  40. {
  41. public:
  42. LLPanelBlockedList();
  43. ~LLPanelBlockedList();
  44. virtual BOOL postBuild();
  45. virtual void draw();
  46. virtual void onOpen(const LLSD& key);
  47. void selectBlocked(const LLUUID& id);
  48. /**
  49. * Shows current Panel in side tray and select passed blocked item.
  50. *
  51. * @param idToSelect - LLUUID of blocked Resident or Object to be selected.
  52. * If it is LLUUID::null, nothing will be selected.
  53. */
  54. static void showPanelAndSelect(const LLUUID& idToSelect);
  55. // LLMuteListObserver callback interface implementation.
  56. /* virtual */ void onChange() { refreshBlockedList();}
  57. private:
  58. void refreshBlockedList();
  59. void updateButtons();
  60. // UI callbacks
  61. void onBackBtnClick();
  62. void onRemoveBtnClick();
  63. void onPickBtnClick();
  64. void onBlockByNameClick();
  65. void callbackBlockPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names);
  66. static void callbackBlockByName(const std::string& text);
  67. private:
  68. LLScrollListCtrl* mBlockedList;
  69. };
  70. //-----------------------------------------------------------------------------
  71. // LLFloaterGetBlockedObjectName()
  72. //-----------------------------------------------------------------------------
  73. // Class for handling mute object by name floater.
  74. class LLFloaterGetBlockedObjectName : public LLFloater
  75. {
  76. friend class LLFloaterReg;
  77. public:
  78. typedef boost::function<void (const std::string&)> get_object_name_callback_t;
  79. virtual BOOL postBuild();
  80. virtual BOOL handleKeyHere(KEY key, MASK mask);
  81. static LLFloaterGetBlockedObjectName* show(get_object_name_callback_t callback);
  82. private:
  83. LLFloaterGetBlockedObjectName(const LLSD& key);
  84. virtual ~LLFloaterGetBlockedObjectName();
  85. // UI Callbacks
  86. void applyBlocking();
  87. void cancelBlocking();
  88. get_object_name_callback_t mGetObjectNameCallback;
  89. };
  90. #endif // LL_LLPANELBLOCKEDLIST_H