PageRenderTime 17ms CodeModel.GetById 1ms app.highlight 12ms RepoModel.GetById 1ms 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
  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
 28#include "lldarray.h"	// *TODO: convert to std::vector
 29#include "llfoldertype.h"
 30#include "llfontgl.h"	// just for StyleFlags enum
 31#include "llinventorytype.h"
 32#include "llpermissionsflags.h"
 33#include "llpointer.h"
 34#include "llwearabletype.h"
 35
 36
 37class LLFolderViewItem;
 38class LLFolderView;
 39class LLFontGL;
 40class LLInventoryModel;
 41class LLMenuGL;
 42class LLScrollContainer;
 43class LLUIImage;
 44class LLUUID;
 45
 46// This is an abstract base class that users of the folderview classes
 47// would use to catch the useful events emitted from the folder
 48// views.
 49class LLFolderViewEventListener
 50{
 51public:
 52	virtual ~LLFolderViewEventListener( void ) {}
 53	virtual const std::string& getName() const = 0;
 54	virtual const std::string& getDisplayName() const = 0;
 55	virtual const LLUUID& getUUID() const = 0;
 56	virtual time_t getCreationDate() const = 0;	// UTC seconds
 57	virtual PermissionMask getPermissionMask() const = 0;
 58	virtual LLFolderType::EType getPreferredType() const = 0;
 59	virtual LLPointer<LLUIImage> getIcon() const = 0;
 60	virtual LLPointer<LLUIImage> getOpenIcon() const { return getIcon(); }
 61	virtual LLFontGL::StyleFlags getLabelStyle() const = 0;
 62	virtual std::string getLabelSuffix() const = 0;
 63	virtual void openItem( void ) = 0;
 64	virtual void closeItem( void ) = 0;
 65	virtual void previewItem( void ) = 0;
 66	virtual void selectItem(void) = 0;
 67	virtual void showProperties(void) = 0;
 68	virtual BOOL isItemRenameable() const = 0;
 69	virtual BOOL renameItem(const std::string& new_name) = 0;
 70	virtual BOOL isItemMovable( void ) const = 0;		// Can be moved to another folder
 71	virtual BOOL isItemRemovable( void ) const = 0;		// Can be destroyed
 72	virtual BOOL isItemInTrash( void) const { return FALSE; } // TODO: make into pure virtual.
 73	virtual BOOL removeItem() = 0;
 74	virtual void removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batch) = 0;
 75	virtual void move( LLFolderViewEventListener* parent_listener ) = 0;
 76	virtual BOOL isItemCopyable() const = 0;
 77	virtual BOOL copyToClipboard() const = 0;
 78	virtual void cutToClipboard() = 0;
 79	virtual BOOL isClipboardPasteable() const = 0;
 80	virtual void pasteFromClipboard() = 0;
 81	virtual void pasteLinkFromClipboard() = 0;
 82	virtual void buildContextMenu(LLMenuGL& menu, U32 flags) = 0;
 83	virtual BOOL isUpToDate() const = 0;
 84	virtual BOOL hasChildren() const = 0;
 85	virtual LLInventoryType::EType getInventoryType() const = 0;
 86	virtual void performAction(LLInventoryModel* model, std::string action) = 0;
 87	virtual LLWearableType::EType getWearableType() const = 0;
 88	
 89	// This method should be called when a drag begins. returns TRUE
 90	// if the drag can begin, otherwise FALSE.
 91	virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const = 0;
 92	
 93	// This method will be called to determine if a drop can be
 94	// performed, and will set drop to TRUE if a drop is
 95	// requested. Returns TRUE if a drop is possible/happened,
 96	// otherwise FALSE.
 97	virtual BOOL dragOrDrop(MASK mask, BOOL drop,
 98							EDragAndDropType cargo_type,
 99							void* cargo_data,
100							std::string& tooltip_msg) = 0;
101};
102
103#endif