llfloaterbulkpermission.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**
  2. * @file llfloaterbulkpermissions.h
  3. * @brief Allow multiple task inventory properties to be set in one go.
  4. * @author Michelle2 Zenovka
  5. *
  6. * $LicenseInfo:firstyear=2008&license=viewergpl$
  7. *
  8. * Copyright (c) 2008-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_LLBULKPERMISSION_H
  34. #define LL_LLBULKPERMISSION_H
  35. #include <vector>
  36. #include "llfloater.h"
  37. #include "llinventory.h"
  38. #include "llviewerinventory.h"
  39. #include "llviewerobject.h"
  40. #include "llvoinventorylistener.h"
  41. class LLScrollListCtrl;
  42. class LLFloaterBulkPermission final
  43. : public LLFloater,
  44. public LLFloaterSingleton<LLFloaterBulkPermission>,
  45. public LLVOInventoryListener
  46. {
  47. protected:
  48. LOG_CLASS(LLFloaterBulkPermission);
  49. public:
  50. LLFloaterBulkPermission(const LLSD& seed);
  51. private:
  52. ~LLFloaterBulkPermission() override {}
  53. bool start(); // Returns true if the queue has started, otherwise false.
  54. bool nextObject();
  55. bool popNext();
  56. // This is the callback method for the viewer object currently being worked
  57. // on.
  58. void inventoryChanged(LLViewerObject* obj,
  59. LLInventoryObject::object_list_t* inv,
  60. S32 serial_num, void* queue) override;
  61. // This is called by inventoryChanged
  62. void handleInventory(LLViewerObject* viewer_obj,
  63. LLInventoryObject::object_list_t* inv);
  64. void updateInventory(LLViewerObject* object, LLViewerInventoryItem* item);
  65. // Read the settings and Apply the permissions
  66. void doApply();
  67. // Returns true if all permission changes are done
  68. LL_INLINE bool isDone() const
  69. {
  70. return mCurrentObjectID.isNull() || mObjectIDs.size() == 0;
  71. }
  72. private:
  73. static void setAllChecked(bool check);
  74. LL_INLINE static void onCheckAll(void*) { setAllChecked(true); }
  75. LL_INLINE static void onUncheckAll(void*) { setAllChecked(false); }
  76. static void onHelpBtn(void* user_data);
  77. static void onCloseBtn(void* user_data);
  78. static void onApplyBtn(void* user_data);
  79. static void onCommitCopy(LLUICtrl* ctrl, void* data);
  80. private:
  81. LLUUID mID;
  82. LLUUID mCurrentObjectID;
  83. uuid_vec_t mObjectIDs; // Object Queue
  84. bool mDone;
  85. };
  86. #endif