PageRenderTime 102ms CodeModel.GetById 60ms app.highlight 8ms RepoModel.GetById 32ms app.codeStats 0ms

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