LLPreview Class Reference

#include <llpreview.h>

Inheritance diagram for LLPreview:

Inheritance graph
[legend]
Collaboration diagram for LLPreview:

Collaboration graph
[legend]
List of all members.

Public Types

typedef enum LLPreview::e_asset_status EAssetStatus
 PREVIEW_ASSET_ERROR
 PREVIEW_ASSET_UNLOADED
 PREVIEW_ASSET_LOADING
 PREVIEW_ASSET_LOADED
enum  e_asset_status { PREVIEW_ASSET_ERROR, PREVIEW_ASSET_UNLOADED, PREVIEW_ASSET_LOADING, PREVIEW_ASSET_LOADED }

Public Member Functions

 LLPreview (const std::string &name)
 LLPreview (const std::string &name, const LLRect &rect, const std::string &title, const LLUUID &item_uuid, const LLUUID &object_uuid, BOOL allow_resize=FALSE, S32 min_width=0, S32 min_height=0, LLPointer< LLViewerInventoryItem > inv_item=NULL)
virtual ~LLPreview ()
void setItemID (const LLUUID &item_id)
void setObjectID (const LLUUID &object_id)
void setSourceID (const LLUUID &source_id)
const LLViewerInventoryItemgetItem () const
virtual BOOL handleMouseDown (S32 x, S32 y, MASK mask)
virtual BOOL handleMouseUp (S32 x, S32 y, MASK mask)
virtual BOOL handleHover (S32 x, S32 y, MASK mask)
virtual void open ()
virtual bool saveItem (LLPointer< LLInventoryItem > *itemptr)
void setAuxItem (const LLInventoryItem *item)
void addKeepDiscardButtons ()
void userSetShape (const LLRect &new_rect)
void userResized ()
virtual void loadAsset ()
virtual EAssetStatus getAssetStatus ()
void setNotecardInfo (const LLUUID &notecard_inv_id, const LLUUID &object_id)

Static Public Member Functions

static LLPreviewfind (const LLUUID &item_uuid)
static LLPreviewshow (const LLUUID &item_uuid, BOOL take_focus=TRUE)
static void hide (const LLUUID &item_uuid, BOOL no_saving=FALSE)
static void rename (const LLUUID &item_uuid, const std::string &new_name)
static bool save (const LLUUID &item_uuid, LLPointer< LLInventoryItem > *itemptr)
static void onBtnCopyToInv (void *userdata)
static void onKeepBtn (void *data)
static void onDiscardBtn (void *data)
static LLPreviewgetFirstPreviewForSource (const LLUUID &source_id)

Protected Types

typedef std::map< LLUUID,
LLPreview * > 
preview_map_t
typedef std::multimap< LLUUID,
LLViewHandle
preview_multimap_t

Protected Member Functions

virtual void onCommit ()
void addDescriptionUI ()

Static Protected Member Functions

static void onText (LLUICtrl *, void *userdata)
static void onRadio (LLUICtrl *, void *userdata)

Protected Attributes

LLUUID mItemUUID
LLUUID mSourceID
LLUUID mObjectUUID
LLRect mClientRect
LLPointer< LLInventoryItemmAuxItem
LLButtonmCopyToInvBtn
BOOL mForceClose
BOOL mUserResized
BOOL mCloseAfterSave
EAssetStatus mAssetStatus
LLUUID mNotecardInventoryID
LLUUID mObjectID
LLPointer< LLViewerInventoryItemmItem

Static Protected Attributes

static preview_multimap_t sPreviewsBySource
static preview_map_t sInstances

Detailed Description

Definition at line 64 of file llpreview.h.


Member Typedef Documentation

typedef enum LLPreview::e_asset_status LLPreview::EAssetStatus

typedef std::map<LLUUID, LLPreview*> LLPreview::preview_map_t [protected]

Definition at line 153 of file llpreview.h.

typedef std::multimap<LLUUID, LLViewHandle> LLPreview::preview_multimap_t [protected]

Definition at line 154 of file llpreview.h.


Member Enumeration Documentation

enum LLPreview::e_asset_status

Enumerator:
PREVIEW_ASSET_ERROR 
PREVIEW_ASSET_UNLOADED 
PREVIEW_ASSET_LOADING 
PREVIEW_ASSET_LOADED 

Definition at line 67 of file llpreview.h.


Constructor & Destructor Documentation

LLPreview::LLPreview ( const std::string &  name  ) 

Definition at line 62 of file llpreview.cpp.

References FALSE, LLFloater::mAutoFocus, and mAuxItem.

LLPreview::LLPreview ( const std::string &  name,
const LLRect rect,
const std::string &  title,
const LLUUID item_uuid,
const LLUUID object_uuid,
BOOL  allow_resize = FALSE,
S32  min_width = 0,
S32  min_height = 0,
LLPointer< LLViewerInventoryItem inv_item = NULL 
)

Definition at line 77 of file llpreview.cpp.

References FALSE, LLFloater::mAutoFocus, mAuxItem, mItemUUID, LLUUID::notNull(), and sInstances.

LLPreview::~LLPreview (  )  [virtual]

Definition at line 100 of file llpreview.cpp.

References gFocusMgr, mItemUUID, mSourceID, LLView::mViewHandle, LLUUID::notNull(), LLFocusMgr::releaseFocusIfNeeded(), sInstances, and sPreviewsBySource.


Member Function Documentation

void LLPreview::addDescriptionUI (  )  [protected]

void LLPreview::addKeepDiscardButtons (  ) 

LLPreview * LLPreview::find ( const LLUUID item_uuid  )  [static]

Definition at line 256 of file llpreview.cpp.

References end, NULL, and sInstances.

Referenced by LLInventoryGestureAvailable::done(), LLToolDragAndDrop::locateInventory(), LLPreviewGesture::onLoadComplete(), LLPreviewLSL::onSaveComplete(), LLPreviewNotecard::onSaveComplete(), LLPreviewGesture::onSaveComplete(), save(), LLPreviewGesture::show(), show(), LLUpdateTaskInventoryResponder::uploadComplete(), and LLUpdateAgentInventoryResponder::uploadComplete().

virtual EAssetStatus LLPreview::getAssetStatus (  )  [inline, virtual]

Reimplemented in LLFloaterAvatarInfo, LLPreviewLandmark, and LLPreviewTexture.

Definition at line 113 of file llpreview.h.

References mAssetStatus.

Referenced by LLPreviewLSL::LLPreviewLSL(), LLMultiPreview::open(), open(), and LLMultiPreview::tabOpen().

LLPreview * LLPreview::getFirstPreviewForSource ( const LLUUID source_id  )  [static]

Definition at line 487 of file llpreview.cpp.

References LLFloater::getFloaterByHandle(), NULL, and sPreviewsBySource.

const LLViewerInventoryItem * LLPreview::getItem (  )  const

Definition at line 162 of file llpreview.cpp.

References LLViewerObjectList::findObject(), LLViewerObject::getInventoryObject(), LLInventoryModel::getItem(), gInventory, gObjectList, LLUUID::isNull(), mItem, mItemUUID, mObjectUUID, and NULL.

Referenced by LLPreviewLandmark::draw(), LLPreviewLandmark::getAssetStatus(), LLPreviewLandmark::getName(), handleHover(), LLPreviewTexture::init(), LLPreviewAnim::LLPreviewAnim(), LLPreviewLSL::LLPreviewLSL(), LLPreviewNotecard::LLPreviewNotecard(), LLPreviewSound::LLPreviewSound(), LLPreviewTexture::LLPreviewTexture(), LLPreviewLSL::loadAsset(), LLPreviewNotecard::loadAsset(), LLPreviewLandmark::loadAsset(), LLPreviewGesture::loadAsset(), LLPreviewAnim::onClose(), onCommit(), LLPreviewNotecard::onLoadComplete(), LLPreviewGesture::postBuild(), LLPreviewGesture::refresh(), LLPreviewLSL::saveIfNeeded(), LLPreviewNotecard::saveIfNeeded(), and LLPreviewGesture::saveIfNeeded().

BOOL LLPreview::handleHover ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLView.

Definition at line 360 of file llpreview.cpp.

References LLPermissions::allowCopyBy(), LLToolDragAndDrop::beginDrag(), gAgent, LLAgent::getGroupID(), LLAgent::getID(), getItem(), LLPermissions::getOwner(), LLInventoryItem::getPermissions(), LLInventoryObject::getType(), LLInventoryObject::getUUID(), gToolDragAndDrop, LLView::handleHover(), LLToolDragAndDrop::handleHover(), LLView::hasMouseCapture(), LLUUID::isNull(), LLToolDragAndDrop::isOverThreshold(), LLView::localPointToScreen(), LLAssetType::lookupDragAndDropType(), mObjectUUID, S32, LLToolDragAndDrop::SOURCE_AGENT, LLToolDragAndDrop::SOURCE_LIBRARY, LLToolDragAndDrop::SOURCE_WORLD, and type.

BOOL LLPreview::handleMouseDown ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLFloater.

Definition at line 333 of file llpreview.cpp.

References LLFloater::bringToFront(), gFocusMgr, gToolDragAndDrop, LLFloater::handleMouseDown(), LLView::localPointToScreen(), mClientRect, LLRectBase< Type >::pointInRect(), S32, LLToolDragAndDrop::setDragStart(), LLFocusMgr::setMouseCapture(), and TRUE.

BOOL LLPreview::handleMouseUp ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLView.

Definition at line 350 of file llpreview.cpp.

References gFocusMgr, LLView::handleMouseUp(), LLView::hasMouseCapture(), NULL, LLFocusMgr::setMouseCapture(), and TRUE.

void LLPreview::hide ( const LLUUID item_uuid,
BOOL  no_saving = FALSE 
) [static]

Definition at line 306 of file llpreview.cpp.

References LLFloater::close(), end, mForceClose, sInstances, and TRUE.

Referenced by LLItemBridge::performAction(), LLInvFVBridge::removeBatchNoCheck(), LLTaskAnimationBridge::removeItem(), LLTaskGestureBridge::removeItem(), LLTaskNotecardBridge::removeItem(), LLFolderBridge::removeItem(), and LLItemBridge::removeItem().

virtual void LLPreview::loadAsset (  )  [inline, virtual]

Reimplemented in LLFloaterAvatarInfo, LLPreviewGesture, LLPreviewLandmark, LLPreviewNotecard, LLPreviewLSL, LLLiveLSLEditor, and LLPreviewTexture.

Definition at line 112 of file llpreview.h.

References mAssetStatus, and PREVIEW_ASSET_LOADED.

Referenced by LLMultiPreview::open(), open(), and LLMultiPreview::tabOpen().

void LLPreview::onBtnCopyToInv ( void userdata  )  [static]

Definition at line 413 of file llpreview.cpp.

References copy_inventory_from_notecard(), copy_inventory_item(), gAgent, LLAgent::getID(), LLPermissions::getOwner(), LLInventoryItem::getPermissions(), LLInventoryObject::getUUID(), LLUUID::notNull(), LLUUID::null, and NULL.

Referenced by LLPreviewTexture::init().

void LLPreview::onCommit (  )  [protected, virtual]

Reimplemented from LLUICtrl.

Definition at line 185 of file llpreview.cpp.

References LLSelectMgr::addAsIndividual(), LLAssetType::AT_OBJECT, LLPanel::childGetText(), LLSelectMgr::deselectAll(), FALSE, LLViewerObjectList::findObject(), gAgent, LLAgent::getAvatarObject(), LLAgent::getID(), getItem(), LLPermissions::getOwner(), LLInventoryItem::getPermissions(), LLInventoryObject::getType(), LLInventoryObject::getUUID(), LLVOAvatar::getWornAttachment(), gInventory, gObjectList, gSelectMgr, LLViewerInventoryItem::isComplete(), llendl, llwarns, mObjectUUID, LLUUID::notNull(), SELECT_ALL_TES, LLSelectMgr::selectionSetObjectDescription(), TASK_INVENTORY_ITEM_KEY, LLViewerObject::updateInventory(), and LLInventoryModel::updateItem().

void LLPreview::onDiscardBtn ( void data  )  [static]

Definition at line 448 of file llpreview.cpp.

References LLInventoryModel::accountForUpdate(), LLAssetType::AT_TRASH, FALSE, LLInventoryModel::findCategoryUUIDForType(), LLInventoryObject::getParentUUID(), gInventory, LLInventoryModel::notifyObservers(), TRUE, and LLInventoryModel::updateItem().

Referenced by LLPreviewTexture::init(), and LLPreviewNotecard::LLPreviewNotecard().

void LLPreview::onKeepBtn ( void data  )  [static]

Definition at line 441 of file llpreview.cpp.

Referenced by LLPreviewTexture::init(), and LLPreviewNotecard::LLPreviewNotecard().

void LLPreview::onRadio ( LLUICtrl ,
void userdata 
) [static, protected]

Definition at line 249 of file llpreview.cpp.

void LLPreview::onText ( LLUICtrl ,
void userdata 
) [static, protected]

Definition at line 242 of file llpreview.cpp.

Referenced by LLPreviewTexture::init(), LLPreviewAnim::LLPreviewAnim(), LLPreviewLSL::LLPreviewLSL(), LLPreviewNotecard::LLPreviewNotecard(), LLPreviewSound::LLPreviewSound(), and LLPreviewGesture::postBuild().

void LLPreview::open (  )  [virtual]

Reimplemented from LLFloater.

Reimplemented in LLPreviewLSL, and LLLiveLSLEditor.

Definition at line 395 of file llpreview.cpp.

References getAssetStatus(), LLFloater::getHost(), loadAsset(), LLFloater::open(), PREVIEW_ASSET_UNLOADED, and LLFloater::sHostp.

Referenced by LLTaskSoundBridge::openSoundPreview(), LLPreviewGesture::show(), show(), and LLFloaterAvatarInfo::show().

void LLPreview::rename ( const LLUUID item_uuid,
const std::string &  new_name 
) [static]

Definition at line 323 of file llpreview.cpp.

References end, LLFloater::setTitle(), and sInstances.

Referenced by LLObjectBridge::renameItem(), and LLItemBridge::renameItem().

bool LLPreview::save ( const LLUUID item_uuid,
LLPointer< LLInventoryItem > *  itemptr 
) [static]

Definition at line 290 of file llpreview.cpp.

References find(), and saveItem().

Referenced by LLViewerTextEditor::onNotecardDialog().

bool LLPreview::saveItem ( LLPointer< LLInventoryItem > *  itemptr  )  [virtual]

Reimplemented in LLPreviewNotecard.

Definition at line 406 of file llpreview.cpp.

Referenced by save().

void LLPreview::setAuxItem ( const LLInventoryItem item  )  [inline]

Definition at line 97 of file llpreview.h.

References mAuxItem.

Referenced by LLViewerTextEditor::openEmbeddedTexture().

void LLPreview::setItemID ( const LLUUID item_id  ) 

Definition at line 123 of file llpreview.cpp.

References mItemUUID, LLUUID::notNull(), and sInstances.

Referenced by LLPreviewGesture::init().

void LLPreview::setNotecardInfo ( const LLUUID notecard_inv_id,
const LLUUID object_id 
) [inline]

Definition at line 116 of file llpreview.h.

References mNotecardInventoryID, and mObjectID.

Referenced by LLViewerTextEditor::openEmbeddedTexture().

void LLPreview::setObjectID ( const LLUUID object_id  ) 

Definition at line 138 of file llpreview.cpp.

References mObjectUUID.

Referenced by LLPreviewGesture::init().

void LLPreview::setSourceID ( const LLUUID source_id  ) 

Definition at line 143 of file llpreview.cpp.

References mSourceID, LLView::mViewHandle, LLUUID::notNull(), and sPreviewsBySource.

Referenced by LLEmbeddedNotecardOpener::fire(), open_landmark(), open_notecard(), and open_texture().

LLPreview * LLPreview::show ( const LLUUID item_uuid,
BOOL  take_focus = TRUE 
) [static]

Definition at line 268 of file llpreview.cpp.

References find(), LLFloater::getFloaterHost(), LLFloater::getHost(), open(), LLFloater::setFocus(), and TRUE.

Referenced by LLEmbeddedNotecardOpener::fire(), open_landmark(), open_notecard(), open_texture(), LLViewerTextEditor::openEmbeddedTexture(), LLTaskAnimationBridge::openItem(), LLTaskGestureBridge::openItem(), LLTaskNotecardBridge::openItem(), LLTaskTextureBridge::openItem(), LLLSLTextBridge::openItem(), LLAnimationBridge::openItem(), LLGestureBridge::openItem(), LLTaskSoundBridge::openSoundPreview(), LLSoundBridge::openSoundPreview(), and LLAnimationBridge::performAction().

void LLPreview::userResized (  )  [inline]

Definition at line 110 of file llpreview.h.

References mUserResized, and TRUE.

Referenced by userSetShape().

void LLPreview::userSetShape ( const LLRect new_rect  )  [virtual]

Reimplemented from LLFloater.

Definition at line 498 of file llpreview.cpp.

References LLRectBase< Type >::getHeight(), LLRectBase< Type >::getWidth(), LLView::mRect, userResized(), and LLFloater::userSetShape().


Member Data Documentation

EAssetStatus LLPreview::mAssetStatus [protected]

Definition at line 151 of file llpreview.h.

Referenced by LLPreviewTexture::getAssetStatus(), LLPreviewLandmark::getAssetStatus(), getAssetStatus(), LLFloaterAvatarInfo::getAssetStatus(), LLPreviewTexture::loadAsset(), LLLiveLSLEditor::loadAsset(), LLPreviewLSL::loadAsset(), LLPreviewNotecard::loadAsset(), LLPreviewLandmark::loadAsset(), LLPreviewGesture::loadAsset(), loadAsset(), LLFloaterAvatarInfo::loadAsset(), LLLiveLSLEditor::onLoadComplete(), LLPreviewLSL::onLoadComplete(), LLPreviewNotecard::onLoadComplete(), and LLPreviewNotecard::saveIfNeeded().

LLPointer<LLInventoryItem> LLPreview::mAuxItem [protected]

Definition at line 139 of file llpreview.h.

Referenced by LLPreview(), and setAuxItem().

LLRect LLPreview::mClientRect [protected]

Definition at line 137 of file llpreview.h.

Referenced by LLPreviewTexture::draw(), handleMouseDown(), and LLPreviewTexture::updateAspectRatio().

BOOL LLPreview::mCloseAfterSave [protected]

Reimplemented in LLLiveLSLEditor.

Definition at line 149 of file llpreview.h.

Referenced by LLPreviewLSL::closeIfNeeded(), LLPreviewNotecard::onSaveComplete(), and LLPreviewGesture::onSaveComplete().

LLButton* LLPreview::mCopyToInvBtn [protected]

Definition at line 140 of file llpreview.h.

BOOL LLPreview::mForceClose [protected]

Definition at line 143 of file llpreview.h.

Referenced by LLPreviewNotecard::canClose(), LLPreviewGesture::canClose(), and hide().

LLPointer<LLViewerInventoryItem> LLPreview::mItem [protected]

Reimplemented in LLLiveLSLEditor.

Definition at line 160 of file llpreview.h.

Referenced by getItem().

LLUUID LLPreview::mItemUUID [protected]

Definition at line 129 of file llpreview.h.

Referenced by getItem(), LLPreview(), LLPreviewLSL::loadAsset(), LLPreviewNotecard::loadAsset(), LLPreviewGesture::loadAsset(), LLPreviewGesture::refresh(), LLPreviewTexture::saveAs(), LLPreviewLSL::saveIfNeeded(), LLPreviewNotecard::saveIfNeeded(), LLPreviewGesture::saveIfNeeded(), setItemID(), LLPreviewLSL::uploadAssetLegacy(), and ~LLPreview().

LLUUID LLPreview::mNotecardInventoryID [protected]

Definition at line 158 of file llpreview.h.

Referenced by setNotecardInfo().

LLUUID LLPreview::mObjectID [protected]

Reimplemented in LLPreviewAnim, LLPreviewNotecard, and LLLiveLSLEditor.

Definition at line 159 of file llpreview.h.

Referenced by setNotecardInfo().

LLUUID LLPreview::mObjectUUID [protected]

Definition at line 135 of file llpreview.h.

Referenced by getItem(), handleHover(), LLPreviewNotecard::loadAsset(), onCommit(), LLPreviewNotecard::saveIfNeeded(), LLPreviewGesture::saveIfNeeded(), and setObjectID().

LLUUID LLPreview::mSourceID [protected]

Definition at line 130 of file llpreview.h.

Referenced by setSourceID(), and ~LLPreview().

BOOL LLPreview::mUserResized [protected]

Definition at line 145 of file llpreview.h.

Referenced by LLPreviewTexture::updateAspectRatio(), and userResized().

LLPreview::preview_map_t LLPreview::sInstances [static, protected]

Reimplemented in LLLiveLSLEditor.

Definition at line 157 of file llpreview.h.

Referenced by find(), LLPreviewLSL::getInstance(), LLPreviewNotecard::getInstance(), hide(), LLPreview(), LLPreviewTexture::onFileLoadedForSave(), rename(), setItemID(), and ~LLPreview().

LLPreview::preview_multimap_t LLPreview::sPreviewsBySource [static, protected]

Definition at line 156 of file llpreview.h.

Referenced by getFirstPreviewForSource(), setSourceID(), and ~LLPreview().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:40 2010 for Second Life Viewer by  doxygen 1.4.7