PageRenderTime 116ms CodeModel.GetById 106ms app.highlight 8ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llfloatergesture.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 107 lines | 48 code | 11 blank | 48 comment | 0 complexity | c97f303f76b15fb86822c7e28ca8d5d2 MD5 | raw file
  1/** 
  2 * @file llfloatergesture.h
  3 * @brief Read-only list of gestures from your inventory.
  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
 27/**
 28 * (Also has legacy gesture editor for testing.)
 29 */
 30
 31#ifndef LL_LLFLOATERGESTURE_H
 32#define LL_LLFLOATERGESTURE_H
 33#include <vector> 
 34
 35#include "llfloater.h"
 36#include "llinventoryobserver.h"
 37
 38class LLScrollContainer;
 39class LLView;
 40class LLButton;
 41class LLLineEditor;
 42class LLComboBox;
 43class LLViewerGesture;
 44class LLGestureOptions;
 45class LLScrollListCtrl;
 46class LLFloaterGestureObserver;
 47class LLFloaterGestureInventoryObserver;
 48class LLMultiGesture;
 49class LLMenuGL;
 50
 51class LLFloaterGesture
 52:	public LLFloater, LLInventoryFetchDescendentsObserver
 53{
 54	LOG_CLASS(LLFloaterGesture);
 55public:
 56	LLFloaterGesture(const LLSD& key);
 57	virtual ~LLFloaterGesture();
 58
 59	virtual BOOL postBuild();
 60	virtual void done ();
 61	void refreshAll();
 62	/**
 63	 * @brief Add new scrolllistitem into gesture_list.
 64	 * @param  item_id inventory id of gesture
 65	 * @param  gesture can be NULL , if item was not loaded yet
 66	 */
 67	void addGesture(const LLUUID& item_id, LLMultiGesture* gesture, LLCtrlListInterface * list);
 68
 69protected:
 70	// Reads from the gesture manager's list of active gestures
 71	// and puts them in this list.
 72	void buildGestureList();
 73	void playGesture(LLUUID item_id);
 74private:
 75	void addToCurrentOutFit();
 76	/**
 77	 * @brief  This method is using to collect selected items. 
 78	 * In some places gesture_list can be rebuilt by gestureObservers during  iterating data from LLScrollListCtrl::getAllSelected().
 79	 * Therefore we have to copy these items to avoid viewer crash.
 80	 * @see LLFloaterGesture::onActivateBtnClick
 81	 */
 82	void getSelectedIds(uuid_vec_t& ids);
 83	bool isActionEnabled(const LLSD& command);
 84	/**
 85	 * @brief Activation rules:
 86	 *  According to Gesture Spec:
 87	 *  1. If all selected gestures are active: set to inactive
 88	 *  2. If all selected gestures are inactive: set to active
 89	 *  3. If selected gestures are in a mixed state: set all to active
 90	 */
 91	void onActivateBtnClick();
 92	void onClickEdit();
 93	void onClickPlay();
 94	void onClickNew();
 95	void onCommitList();
 96	void onCopyPasteAction(const LLSD& command);
 97	void onDeleteSelected();
 98
 99	LLUUID mSelectedID;
100	LLUUID mGestureFolderID;
101	LLScrollListCtrl* mGestureList;
102
103	LLFloaterGestureObserver* mObserver;
104};
105
106
107#endif