PageRenderTime 42ms CodeModel.GetById 20ms app.highlight 9ms RepoModel.GetById 11ms app.codeStats 0ms

/indra/newview/llpanelteleporthistory.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 128 lines | 76 code | 24 blank | 28 comment | 0 complexity | 6081055c9f17b0454e644b7ac83feafa MD5 | raw file
  1/** 
  2 * @file llpanelteleporthistory.h
  3 * @brief Teleport history represented by a scrolling list
  4 * class definition
  5 *
  6 * $LicenseInfo:firstyear=2009&license=viewerlgpl$
  7 * Second Life Viewer Source Code
  8 * Copyright (C) 2010, Linden Research, Inc.
  9 * 
 10 * This library is free software; you can redistribute it and/or
 11 * modify it under the terms of the GNU Lesser General Public
 12 * License as published by the Free Software Foundation;
 13 * version 2.1 of the License only.
 14 * 
 15 * This library is distributed in the hope that it will be useful,
 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 18 * Lesser General Public License for more details.
 19 * 
 20 * You should have received a copy of the GNU Lesser General Public
 21 * License along with this library; if not, write to the Free Software
 22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 23 * 
 24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 25 * $/LicenseInfo$
 26 */
 27
 28#ifndef LL_LLPANELTELEPORTHISTORY_H
 29#define LL_LLPANELTELEPORTHISTORY_H
 30
 31#include "lluictrlfactory.h"
 32
 33#include "llpanelplacestab.h"
 34#include "llteleporthistory.h"
 35#include "llmenugl.h"
 36
 37class LLTeleportHistoryStorage;
 38class LLAccordionCtrl;
 39class LLAccordionCtrlTab;
 40class LLFlatListView;
 41class LLMenuButton;
 42
 43class LLTeleportHistoryPanel : public LLPanelPlacesTab
 44{
 45public:
 46	// *TODO: derive from LLListContextMenu?
 47	class ContextMenu
 48	{
 49	public:
 50		ContextMenu();
 51		void show(LLView* spawning_view, S32 index, S32 x, S32 y);
 52
 53	private:
 54		LLContextMenu* createMenu();
 55		void onTeleport();
 56		void onInfo();
 57		void onCopyToClipboard();
 58
 59		static void gotSLURLCallback(const std::string& slurl);
 60
 61		LLContextMenu* mMenu;
 62		S32 mIndex;
 63	};
 64
 65	LLTeleportHistoryPanel();
 66	virtual ~LLTeleportHistoryPanel();
 67
 68	/*virtual*/ BOOL postBuild();
 69	/*virtual*/ void draw();
 70
 71	/*virtual*/ void onSearchEdit(const std::string& string);
 72	/*virtual*/ void onShowOnMap();
 73	/*virtual*/ void onShowProfile();
 74	/*virtual*/ void onTeleport();
 75	///*virtual*/ void onCopySLURL();
 76	/*virtual*/ void updateVerbs();
 77	/*virtual*/ bool isSingleItemSelected();
 78
 79private:
 80
 81	void onDoubleClickItem();
 82	void onReturnKeyPressed();
 83	void onAccordionTabRightClick(LLView *view, S32 x, S32 y, MASK mask);
 84	void onAccordionTabOpen(LLAccordionCtrlTab *tab);
 85	void onAccordionTabClose(LLAccordionCtrlTab *tab);
 86	void onExpandAllFolders();
 87	void onCollapseAllFolders();
 88	void onClearTeleportHistory();
 89	bool onClearTeleportHistoryDialog(const LLSD& notification, const LLSD& response);
 90
 91	void refresh();
 92	void getNextTab(const LLDate& item_date, S32& curr_tab, LLDate& tab_date);
 93	void onTeleportHistoryChange(S32 removed_index);
 94	void replaceItem(S32 removed_index);
 95	void showTeleportHistory();
 96	void handleItemSelect(LLFlatListView* );
 97	LLFlatListView* getFlatListViewFromTab(LLAccordionCtrlTab *);
 98	bool isActionEnabled(const LLSD& userdata) const;
 99
100	void setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed);
101	bool isAccordionCollapsedByUser(LLUICtrl* acc_tab);
102	void onAccordionExpand(LLUICtrl* ctrl, const LLSD& param);
103
104	static void confirmTeleport(S32 hist_idx);
105	static bool onTeleportConfirmation(const LLSD& notification, const LLSD& response, S32 hist_idx);
106
107	LLTeleportHistoryStorage*	mTeleportHistory;
108	LLAccordionCtrl*		mHistoryAccordion;
109
110	LLFlatListView*			mLastSelectedFlatlList;
111	S32				mLastSelectedItemIndex;
112	bool				mDirty;
113	S32				mCurrentItem;
114
115	typedef LLDynamicArray<LLAccordionCtrlTab*> item_containers_t;
116	item_containers_t mItemContainers;
117
118	ContextMenu mContextMenu;
119	LLContextMenu*			mAccordionTabMenu;
120	LLHandle<LLView>		mGearMenuHandle;
121	LLMenuButton*			mMenuGearButton;
122
123	boost::signals2::connection mTeleportHistoryChangedConnection;
124};
125
126
127
128#endif //LL_LLPANELTELEPORTHISTORY_H