LLPreviewNotecard Class Reference

#include <llpreviewnotecard.h>

Inheritance diagram for LLPreviewNotecard:

Inheritance graph
[legend]
Collaboration diagram for LLPreviewNotecard:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLPreviewNotecard (const std::string &name, const LLRect &rect, const std::string &title, const LLUUID &item_id, const LLUUID &object_id=LLUUID::null, const LLUUID &asset_id=LLUUID::null, BOOL show_keep_discard=FALSE, LLPointer< LLViewerInventoryItem > inv_item=NULL)
virtual bool saveItem (LLPointer< LLInventoryItem > *itemptr)
virtual void draw ()
virtual BOOL handleKeyHere (KEY key, MASK mask, BOOL called_from_parent)
virtual void setEnabled (BOOL enabled)
virtual void reshape (S32 width, S32 height, BOOL called_from_parent=TRUE)
virtual BOOL canClose ()
virtual BOOL postBuild ()
const LLInventoryItemgetDragItem ()
bool hasEmbeddedInventory ()
void refreshFromInventory ()

Protected Member Functions

virtual void loadAsset ()
bool saveIfNeeded (LLInventoryItem *copyitem=NULL)

Static Protected Member Functions

static LLPreviewNotecardgetInstance (const LLUUID &uuid)
static void onLoadComplete (LLVFS *vfs, const LLUUID &asset_uuid, LLAssetType::EType type, void *user_data, S32 status, LLExtStat ext_status)
static void onClickSave (void *data)
static void onSaveComplete (const LLUUID &asset_uuid, void *user_data, S32 status, LLExtStat ext_status)
static void handleSaveChangesDialog (S32 option, void *userdata)

Protected Attributes

LLViewerTextEditormEditor
LLButtonmSaveBtn
LLUUID mAssetID
LLUUID mNotecardItemID
LLUUID mObjectID

Detailed Description

Definition at line 48 of file llpreviewnotecard.h.


Constructor & Destructor Documentation

LLPreviewNotecard::LLPreviewNotecard ( const std::string &  name,
const LLRect rect,
const std::string &  title,
const LLUUID item_id,
const LLUUID object_id = LLUUID::null,
const LLUUID asset_id = LLUUID::null,
BOOL  show_keep_discard = FALSE,
LLPointer< LLViewerInventoryItem inv_item = NULL 
)

---------------------------------------------------------------------------- Class LLPreviewNotecard ----------------------------------------------------------------------------

Definition at line 81 of file llpreviewnotecard.cpp.

References LLUICtrlFactory::buildFloater(), LLAgent::changeCameraToDefault(), LLPanel::childSetAction(), LLPanel::childSetCommitCallback(), LLPanel::childSetPrevalidate(), LLPanel::childSetText(), LLPanel::childSetVisible(), FALSE, gAgent, LLInventoryItem::getDescription(), LLRectBase< Type >::getHeight(), LLFloater::getHost(), LLPreview::getItem(), LLViewerUICtrlFactory::getViewerTextEditorByName(), LLRectBase< Type >::getWidth(), gUICtrlFactory, LLUUID::isNull(), mAssetID, onClickSave(), LLPreview::onDiscardBtn(), LLPreview::onKeepBtn(), LLPreview::onText(), LLLineEditor::prevalidatePrintableNotPipe(), reshape(), LLTextEditor::setHandleEditKeysDirectly(), LLView::setRect(), LLTextEditor::setSourceID(), LLFloater::setTitle(), LLTextEditor::setWordWrap(), and TRUE.


Member Function Documentation

BOOL LLPreviewNotecard::canClose (  )  [virtual]

Reimplemented from LLFloater.

Definition at line 219 of file llpreviewnotecard.cpp.

References LLViewerWindow::alertXml(), FALSE, LLViewerUICtrlFactory::getViewerTextEditorByName(), gViewerWindow, handleSaveChangesDialog(), LLTextEditor::isPristine(), LLPreview::mForceClose, and TRUE.

void LLPreviewNotecard::draw (  )  [virtual]

Reimplemented from LLFloater.

Definition at line 189 of file llpreviewnotecard.cpp.

References LLPanel::childSetEnabled(), LLFloater::draw(), LLView::getEnabled(), LLViewerUICtrlFactory::getViewerTextEditorByName(), and LLTextEditor::isPristine().

const LLInventoryItem * LLPreviewNotecard::getDragItem (  ) 

Definition at line 238 of file llpreviewnotecard.cpp.

References LLViewerTextEditor::getDragItem(), LLViewerUICtrlFactory::getViewerTextEditorByName(), and NULL.

Referenced by LLToolDragAndDrop::locateInventory().

LLPreviewNotecard * LLPreviewNotecard::getInstance ( const LLUUID uuid  )  [static, protected]

Definition at line 428 of file llpreviewnotecard.cpp.

References end, NULL, and LLPreview::sInstances.

Referenced by onLoadComplete().

BOOL LLPreviewNotecard::handleKeyHere ( KEY  key,
MASK  mask,
BOOL  called_from_parent 
) [virtual]

Reimplemented from LLPanel.

Definition at line 204 of file llpreviewnotecard.cpp.

References FALSE, LLView::getEnabled(), LLView::getVisible(), MASK_CONTROL, saveIfNeeded(), and TRUE.

void LLPreviewNotecard::handleSaveChangesDialog ( S32  option,
void userdata 
) [static, protected]

Definition at line 621 of file llpreviewnotecard.cpp.

References app_abort_quit(), onClickSave(), and TRUE.

Referenced by canClose().

bool LLPreviewNotecard::hasEmbeddedInventory (  ) 

Definition at line 249 of file llpreviewnotecard.cpp.

References LLViewerUICtrlFactory::getViewerTextEditorByName(), LLViewerTextEditor::hasEmbeddedInventory(), and NULL.

void LLPreviewNotecard::loadAsset (  )  [protected, virtual]

Reimplemented from LLPreview.

Definition at line 265 of file llpreviewnotecard.cpp.

References LLAgent::allowOperation(), LLPanel::childGetText(), LLPanel::childSetVisible(), FALSE, LLViewerObjectList::findObject(), gAgent, gAssetStorage, LLInventoryItem::getAssetUUID(), LLAgent::getID(), LLAssetStorage::getInvItemAsset(), LLPreview::getItem(), LLPermissions::getOwner(), LLInventoryItem::getPermissions(), LLAgent::getSessionID(), LLInventoryObject::getType(), LLInventoryObject::getUUID(), LLViewerUICtrlFactory::getViewerTextEditorByName(), gObjectList, GP_OBJECT_MANIPULATE, LLHost::invalid, LLAgent::isGodlike(), LLUUID::isNull(), llendl, llwarns, LLViewerTextEditor::makePristine(), mAssetID, LLPreview::mAssetStatus, LLPreview::mItemUUID, LLPreview::mObjectUUID, LLUUID::notNull(), LLStringBase< char >::null, onLoadComplete(), PERM_COPY, PERM_MODIFY, LLPreview::PREVIEW_ASSET_LOADED, LLPreview::PREVIEW_ASSET_LOADING, LLTextEditor::setEnabled(), LLUUID::setNull(), LLTextEditor::setText(), and TRUE.

Referenced by refreshFromInventory().

void LLPreviewNotecard::onClickSave ( void data  )  [static, protected]

Definition at line 440 of file llpreviewnotecard.cpp.

Referenced by handleSaveChangesDialog(), and LLPreviewNotecard().

void LLPreviewNotecard::onLoadComplete ( LLVFS vfs,
const LLUUID asset_uuid,
LLAssetType::EType  type,
void user_data,
S32  status,
LLExtStat  ext_status 
) [static, protected]

Definition at line 352 of file llpreviewnotecard.cpp.

References LLAgent::allowOperation(), gAgent, getInstance(), LLPreview::getItem(), LLInventoryItem::getPermissions(), LLVFile::getSize(), LLViewerUICtrlFactory::getViewerTextEditorByName(), GP_OBJECT_MANIPULATE, gViewerStats, LLViewerTextEditor::importBuffer(), LLViewerStats::incStat(), LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_ERR_FILE_EMPTY, LL_ERR_INSUFFICIENT_PERMISSIONS, llendl, llinfos, llwarns, LLViewerTextEditor::makePristine(), LLPreview::mAssetStatus, modifiable, PERM_MODIFY, LLPreview::PREVIEW_ASSET_ERROR, LLPreview::PREVIEW_ASSET_LOADED, LLVFile::read(), LLVFile::READ, S32, setEnabled(), LLTextEditor::setText(), LLNotifyBox::showXml(), and LLViewerStats::ST_DOWNLOAD_FAILED.

Referenced by loadAsset().

void LLPreviewNotecard::onSaveComplete ( const LLUUID asset_uuid,
void user_data,
S32  status,
LLExtStat  ext_status 
) [static, protected]

Definition at line 543 of file llpreviewnotecard.cpp.

References LLViewerWindow::alertXml(), LLFloater::close(), LLViewerTextEditor::copyInventory(), dialog_refresh_all(), FALSE, LLPreview::find(), LLViewerObjectList::findObject(), gDirUtilp, LLAssetStorage::getErrorString(), LLDir::getExpandedFilename(), LLViewerObject::getInventoryObject(), LLInventoryModel::getItem(), LLViewerUICtrlFactory::getViewerTextEditorByName(), gInventory, gObjectList, gViewerWindow, LLUUID::isNull(), LL_MAX_PATH, LL_PATH_CACHE, llendl, llwarns, LLPreview::mCloseAfterSave, LLSaveNotecardInfo::mCopyItem, LLSaveNotecardInfo::mItemUUID, LLSaveNotecardInfo::mObjectUUID, LLSaveNotecardInfo::mSelf, LLSaveNotecardInfo::mTransactionID, LLInventoryModel::notifyObservers(), LLPointer< Type >::notNull(), NULL, LLFile::remove(), LLInventoryItem::setAssetUUID(), LLViewerInventoryItem::setTransactionID(), TASK_INVENTORY_ITEM_KEY, LLUUID::toString(), LLViewerObject::updateInventory(), LLInventoryModel::updateItem(), and UUID_STR_LENGTH.

Referenced by saveIfNeeded().

BOOL LLPreviewNotecard::postBuild (  )  [virtual]

Reimplemented from LLPanel.

Definition at line 150 of file llpreviewnotecard.cpp.

References LLUICtrlFactory::getTextEditorByName(), gUICtrlFactory, LLViewerTextEditor::makePristine(), mNotecardItemID, mObjectID, LLViewerTextEditor::setNotecardInfo(), and TRUE.

void LLPreviewNotecard::refreshFromInventory (  ) 

Definition at line 259 of file llpreviewnotecard.cpp.

References lldebugs, llendl, and loadAsset().

void LLPreviewNotecard::reshape ( S32  width,
S32  height,
BOOL  called_from_parent = TRUE 
) [virtual]

Reimplemented from LLView.

Definition at line 644 of file llpreviewnotecard.cpp.

References gSavedSettings, LLFloater::isMinimized(), LLView::mRect, LLView::reshape(), and LLControlGroup::setRect().

Referenced by LLPreviewNotecard().

bool LLPreviewNotecard::saveIfNeeded ( LLInventoryItem copyitem = NULL  )  [protected]

Definition at line 464 of file llpreviewnotecard.cpp.

References LLVFile::APPEND, LLAssetType::AT_NOTECARD, LLViewerTextEditor::exportBuffer(), FALSE, gAgent, gAssetStorage, LLViewerRegion::getCapability(), LLPreview::getItem(), LLAgent::getRegion(), LLAgent::getSecureSessionID(), LLViewerUICtrlFactory::getViewerTextEditorByName(), gVFS, LLUUID::isNull(), LLTextEditor::isPristine(), llendl, llinfos, llwarns, LLViewerTextEditor::makePristine(), LLPreview::mAssetStatus, LLPreview::mItemUUID, LLPreview::mObjectUUID, onSaveComplete(), LLHTTPClient::post(), LLPreview::PREVIEW_ASSET_LOADING, S32, setEnabled(), LLVFile::setMaxSize(), size, LLAssetStorage::storeAssetData(), and LLVFile::write().

Referenced by handleKeyHere(), and saveItem().

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

Reimplemented from LLPreview.

Definition at line 161 of file llpreviewnotecard.cpp.

References LLPointer< Type >::notNull(), NULL, and saveIfNeeded().

void LLPreviewNotecard::setEnabled ( BOOL  enabled  )  [virtual]

Reimplemented from LLView.

Definition at line 176 of file llpreviewnotecard.cpp.

References LLPanel::childSetEnabled(), LLPanel::childSetVisible(), LLViewerUICtrlFactory::getViewerTextEditorByName(), and LLTextEditor::isPristine().

Referenced by onLoadComplete(), and saveIfNeeded().


Member Data Documentation

LLUUID LLPreviewNotecard::mAssetID [protected]

Definition at line 109 of file llpreviewnotecard.h.

Referenced by LLPreviewNotecard(), and loadAsset().

LLViewerTextEditor* LLPreviewNotecard::mEditor [protected]

Definition at line 106 of file llpreviewnotecard.h.

LLUUID LLPreviewNotecard::mNotecardItemID [protected]

Definition at line 111 of file llpreviewnotecard.h.

Referenced by postBuild().

LLUUID LLPreviewNotecard::mObjectID [protected]

Reimplemented from LLPreview.

Definition at line 112 of file llpreviewnotecard.h.

Referenced by postBuild().

LLButton* LLPreviewNotecard::mSaveBtn [protected]

Definition at line 107 of file llpreviewnotecard.h.


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