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