PageRenderTime 38ms CodeModel.GetById 17ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1
  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. #ifndef LL_LLPANELTELEPORTHISTORY_H
  28. #define LL_LLPANELTELEPORTHISTORY_H
  29. #include "lluictrlfactory.h"
  30. #include "llpanelplacestab.h"
  31. #include "llteleporthistory.h"
  32. #include "llmenugl.h"
  33. class LLTeleportHistoryStorage;
  34. class LLAccordionCtrl;
  35. class LLAccordionCtrlTab;
  36. class LLFlatListView;
  37. class LLMenuButton;
  38. class LLTeleportHistoryPanel : public LLPanelPlacesTab
  39. {
  40. public:
  41. // *TODO: derive from LLListContextMenu?
  42. class ContextMenu
  43. {
  44. public:
  45. ContextMenu();
  46. void show(LLView* spawning_view, S32 index, S32 x, S32 y);
  47. private:
  48. LLContextMenu* createMenu();
  49. void onTeleport();
  50. void onInfo();
  51. void onCopyToClipboard();
  52. static void gotSLURLCallback(const std::string& slurl);
  53. LLContextMenu* mMenu;
  54. S32 mIndex;
  55. };
  56. LLTeleportHistoryPanel();
  57. virtual ~LLTeleportHistoryPanel();
  58. /*virtual*/ BOOL postBuild();
  59. /*virtual*/ void draw();
  60. /*virtual*/ void onSearchEdit(const std::string& string);
  61. /*virtual*/ void onShowOnMap();
  62. /*virtual*/ void onShowProfile();
  63. /*virtual*/ void onTeleport();
  64. ///*virtual*/ void onCopySLURL();
  65. /*virtual*/ void updateVerbs();
  66. /*virtual*/ bool isSingleItemSelected();
  67. private:
  68. void onDoubleClickItem();
  69. void onReturnKeyPressed();
  70. void onAccordionTabRightClick(LLView *view, S32 x, S32 y, MASK mask);
  71. void onAccordionTabOpen(LLAccordionCtrlTab *tab);
  72. void onAccordionTabClose(LLAccordionCtrlTab *tab);
  73. void onExpandAllFolders();
  74. void onCollapseAllFolders();
  75. void onClearTeleportHistory();
  76. bool onClearTeleportHistoryDialog(const LLSD& notification, const LLSD& response);
  77. void refresh();
  78. void getNextTab(const LLDate& item_date, S32& curr_tab, LLDate& tab_date);
  79. void onTeleportHistoryChange(S32 removed_index);
  80. void replaceItem(S32 removed_index);
  81. void showTeleportHistory();
  82. void handleItemSelect(LLFlatListView* );
  83. LLFlatListView* getFlatListViewFromTab(LLAccordionCtrlTab *);
  84. bool isActionEnabled(const LLSD& userdata) const;
  85. void setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed);
  86. bool isAccordionCollapsedByUser(LLUICtrl* acc_tab);
  87. void onAccordionExpand(LLUICtrl* ctrl, const LLSD& param);
  88. static void confirmTeleport(S32 hist_idx);
  89. static bool onTeleportConfirmation(const LLSD& notification, const LLSD& response, S32 hist_idx);
  90. LLTeleportHistoryStorage* mTeleportHistory;
  91. LLAccordionCtrl* mHistoryAccordion;
  92. LLFlatListView* mLastSelectedFlatlList;
  93. S32 mLastSelectedItemIndex;
  94. bool mDirty;
  95. S32 mCurrentItem;
  96. typedef LLDynamicArray<LLAccordionCtrlTab*> item_containers_t;
  97. item_containers_t mItemContainers;
  98. ContextMenu mContextMenu;
  99. LLContextMenu* mAccordionTabMenu;
  100. LLHandle<LLView> mGearMenuHandle;
  101. LLMenuButton* mMenuGearButton;
  102. boost::signals2::connection mTeleportHistoryChangedConnection;
  103. };
  104. #endif //LL_LLPANELTELEPORTHISTORY_H