/indra/newview/llsidepanelinventory.h

https://bitbucket.org/lindenlab/viewer-beta/ · C Header · 132 lines · 75 code · 26 blank · 31 comment · 0 complexity · aa78f3186e8ebca87ac7a4c21db22ae2 MD5 · raw file

  1. /**
  2. * @file LLSidepanelInventory.h
  3. * @brief Side Bar "Inventory" panel
  4. *
  5. * $LicenseInfo:firstyear=2009&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_LLSIDEPANELINVENTORY_H
  27. #define LL_LLSIDEPANELINVENTORY_H
  28. #include "llpanel.h"
  29. class LLButton;
  30. class LLFolderViewItem;
  31. class LLInboxAddedObserver;
  32. class LLInventoryCategoriesObserver;
  33. class LLInventoryItem;
  34. class LLInventoryPanel;
  35. class LLLayoutPanel;
  36. class LLPanelMainInventory;
  37. class LLSidepanelItemInfo;
  38. class LLSidepanelTaskInfo;
  39. class LLSidepanelInventory : public LLPanel
  40. {
  41. public:
  42. LLSidepanelInventory();
  43. virtual ~LLSidepanelInventory();
  44. private:
  45. void updateInbox();
  46. public:
  47. void observeInboxCreation();
  48. void observeInboxModifications(const LLUUID& inboxID);
  49. /*virtual*/ BOOL postBuild();
  50. /*virtual*/ void onOpen(const LLSD& key);
  51. LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any.
  52. LLInventoryPanel* getInboxPanel() const { return mInventoryPanelInbox; }
  53. LLPanelMainInventory* getMainInventoryPanel() const { return mPanelMainInventory; }
  54. BOOL isMainInventoryPanelActive() const;
  55. void clearSelections(bool clearMain, bool clearInbox);
  56. std::set<LLUUID> getInboxSelectionList();
  57. void showItemInfoPanel();
  58. void showTaskInfoPanel();
  59. void showInventoryPanel();
  60. // checks can share selected item(s)
  61. bool canShare();
  62. void onToggleInboxBtn();
  63. void enableInbox(bool enabled);
  64. void openInbox();
  65. bool isInboxEnabled() const { return mInboxEnabled; }
  66. void updateVerbs();
  67. protected:
  68. // Tracks highlighted (selected) item in inventory panel.
  69. LLInventoryItem *getSelectedItem();
  70. U32 getSelectedCount();
  71. void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action);
  72. // "wear", "teleport", etc.
  73. void performActionOnSelection(const std::string &action);
  74. bool canWearSelected(); // check whether selected items can be worn
  75. void onInboxChanged(const LLUUID& inbox_id);
  76. //
  77. // UI Elements
  78. //
  79. private:
  80. LLPanel* mInventoryPanel; // Main inventory view
  81. LLInventoryPanel* mInventoryPanelInbox;
  82. LLSidepanelItemInfo* mItemPanel; // Individual item view
  83. LLSidepanelTaskInfo* mTaskPanel; // Individual in-world object view
  84. LLPanelMainInventory* mPanelMainInventory;
  85. protected:
  86. void onInfoButtonClicked();
  87. void onShareButtonClicked();
  88. void onShopButtonClicked();
  89. void onWearButtonClicked();
  90. void onPlayButtonClicked();
  91. void onTeleportButtonClicked();
  92. void onOverflowButtonClicked();
  93. void onBackButtonClicked();
  94. private:
  95. LLButton* mInfoBtn;
  96. LLButton* mShareBtn;
  97. LLButton* mWearBtn;
  98. LLButton* mPlayBtn;
  99. LLButton* mTeleportBtn;
  100. LLButton* mOverflowBtn;
  101. LLButton* mShopBtn;
  102. bool mInboxEnabled;
  103. LLInventoryCategoriesObserver* mCategoriesObserver;
  104. LLInboxAddedObserver* mInboxAddedObserver;
  105. };
  106. #endif //LL_LLSIDEPANELINVENTORY_H