PageRenderTime 23ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llfoldervieweventlistener.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 103 lines | 63 code | 7 blank | 33 comment | 0 complexity | 19d3d02253a8e55a8c170079d537f377 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llfoldervieweventlistener.h
  3. *
  4. * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  5. * Second Life Viewer Source Code
  6. * Copyright (C) 2010, Linden Research, Inc.
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation;
  11. * version 2.1 of the License only.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  23. * $/LicenseInfo$
  24. */
  25. #ifndef LLFOLDERVIEWEVENTLISTENER_H
  26. #define LLFOLDERVIEWEVENTLISTENER_H
  27. #include "lldarray.h" // *TODO: convert to std::vector
  28. #include "llfoldertype.h"
  29. #include "llfontgl.h" // just for StyleFlags enum
  30. #include "llinventorytype.h"
  31. #include "llpermissionsflags.h"
  32. #include "llpointer.h"
  33. #include "llwearabletype.h"
  34. class LLFolderViewItem;
  35. class LLFolderView;
  36. class LLFontGL;
  37. class LLInventoryModel;
  38. class LLMenuGL;
  39. class LLScrollContainer;
  40. class LLUIImage;
  41. class LLUUID;
  42. // This is an abstract base class that users of the folderview classes
  43. // would use to catch the useful events emitted from the folder
  44. // views.
  45. class LLFolderViewEventListener
  46. {
  47. public:
  48. virtual ~LLFolderViewEventListener( void ) {}
  49. virtual const std::string& getName() const = 0;
  50. virtual const std::string& getDisplayName() const = 0;
  51. virtual const LLUUID& getUUID() const = 0;
  52. virtual time_t getCreationDate() const = 0; // UTC seconds
  53. virtual PermissionMask getPermissionMask() const = 0;
  54. virtual LLFolderType::EType getPreferredType() const = 0;
  55. virtual LLPointer<LLUIImage> getIcon() const = 0;
  56. virtual LLPointer<LLUIImage> getOpenIcon() const { return getIcon(); }
  57. virtual LLFontGL::StyleFlags getLabelStyle() const = 0;
  58. virtual std::string getLabelSuffix() const = 0;
  59. virtual void openItem( void ) = 0;
  60. virtual void closeItem( void ) = 0;
  61. virtual void previewItem( void ) = 0;
  62. virtual void selectItem(void) = 0;
  63. virtual void showProperties(void) = 0;
  64. virtual BOOL isItemRenameable() const = 0;
  65. virtual BOOL renameItem(const std::string& new_name) = 0;
  66. virtual BOOL isItemMovable( void ) const = 0; // Can be moved to another folder
  67. virtual BOOL isItemRemovable( void ) const = 0; // Can be destroyed
  68. virtual BOOL isItemInTrash( void) const { return FALSE; } // TODO: make into pure virtual.
  69. virtual BOOL removeItem() = 0;
  70. virtual void removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batch) = 0;
  71. virtual void move( LLFolderViewEventListener* parent_listener ) = 0;
  72. virtual BOOL isItemCopyable() const = 0;
  73. virtual BOOL copyToClipboard() const = 0;
  74. virtual void cutToClipboard() = 0;
  75. virtual BOOL isClipboardPasteable() const = 0;
  76. virtual void pasteFromClipboard() = 0;
  77. virtual void pasteLinkFromClipboard() = 0;
  78. virtual void buildContextMenu(LLMenuGL& menu, U32 flags) = 0;
  79. virtual BOOL isUpToDate() const = 0;
  80. virtual BOOL hasChildren() const = 0;
  81. virtual LLInventoryType::EType getInventoryType() const = 0;
  82. virtual void performAction(LLInventoryModel* model, std::string action) = 0;
  83. virtual LLWearableType::EType getWearableType() const = 0;
  84. // This method should be called when a drag begins. returns TRUE
  85. // if the drag can begin, otherwise FALSE.
  86. virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const = 0;
  87. // This method will be called to determine if a drop can be
  88. // performed, and will set drop to TRUE if a drop is
  89. // requested. Returns TRUE if a drop is possible/happened,
  90. // otherwise FALSE.
  91. virtual BOOL dragOrDrop(MASK mask, BOOL drop,
  92. EDragAndDropType cargo_type,
  93. void* cargo_data,
  94. std::string& tooltip_msg) = 0;
  95. };
  96. #endif