#include <llpreviewnotecard.h>
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 | ~LLPreviewNotecard () |
virtual bool | saveItem (LLPointer< LLInventoryItem > *itemptr) |
virtual void | draw () |
virtual BOOL | handleKeyHere (KEY key, MASK mask) |
virtual void | setEnabled (BOOL enabled) |
virtual void | reshape (S32 width, S32 height, BOOL called_from_parent=TRUE) |
virtual BOOL | canClose () |
virtual BOOL | postBuild () |
const LLInventoryItem * | getDragItem () |
bool | hasEmbeddedInventory () |
void | refreshFromInventory () |
Protected Member Functions | |
virtual void | loadAsset () |
bool | saveIfNeeded (LLInventoryItem *copyitem=NULL) |
virtual const char * | getTitleName () const |
Static Protected Member Functions | |
static LLPreviewNotecard * | getInstance (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 | |
LLViewerTextEditor * | mEditor |
LLButton * | mSaveBtn |
LLUUID | mAssetID |
LLUUID | mNotecardItemID |
LLUUID | mObjectID |
Definition at line 48 of file llpreviewnotecard.h.
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 82 of file llpreviewnotecard.cpp.
References LLUICtrlFactory::buildFloater(), LLAgent::changeCameraToDefault(), LLPanel::childSetAction(), LLPanel::childSetCommitCallback(), LLPanel::childSetPrevalidate(), LLPanel::childSetText(), LLPanel::childSetVisible(), FALSE, gAgent, LLInventoryItem::getAssetUUID(), LLInventoryItem::getDescription(), LLRectBase< Type >::getHeight(), LLFloater::getHost(), LLSingleton< LLUICtrlFactory >::getInstance(), LLPreview::getItem(), LLRectBase< Type >::getWidth(), 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.
LLPreviewNotecard::~LLPreviewNotecard | ( | ) | [virtual] |
Definition at line 151 of file llpreviewnotecard.cpp.
bool LLPreviewNotecard::saveItem | ( | LLPointer< LLInventoryItem > * | itemptr | ) | [virtual] |
Reimplemented from LLPreview.
Definition at line 166 of file llpreviewnotecard.cpp.
References LLPointer< Type >::notNull(), NULL, and saveIfNeeded().
void LLPreviewNotecard::draw | ( | void | ) | [virtual] |
Reimplemented from LLPreview.
Definition at line 194 of file llpreviewnotecard.cpp.
References LLPanel::childSetEnabled(), LLPreview::draw(), LLView::getEnabled(), and LLTextEditor::isPristine().
Reimplemented from LLPanel.
Definition at line 209 of file llpreviewnotecard.cpp.
References LLPanel::handleKeyHere(), MASK_CONTROL, saveIfNeeded(), and TRUE.
void LLPreviewNotecard::setEnabled | ( | BOOL | enabled | ) | [virtual] |
Reimplemented from LLView.
Definition at line 181 of file llpreviewnotecard.cpp.
References LLPanel::childSetEnabled(), LLPanel::childSetVisible(), and LLTextEditor::isPristine().
Referenced by onLoadComplete(), and saveIfNeeded().
Reimplemented from LLFloater.
Definition at line 641 of file llpreviewnotecard.cpp.
References LLView::getRect(), gSavedSettings, LLFloater::isMinimized(), LLFloater::reshape(), and LLControlGroup::setRect().
Referenced by LLPreviewNotecard().
BOOL LLPreviewNotecard::canClose | ( | ) | [virtual] |
Reimplemented from LLFloater.
Definition at line 221 of file llpreviewnotecard.cpp.
References LLViewerWindow::alertXml(), FALSE, gViewerWindow, handleSaveChangesDialog(), LLTextEditor::isPristine(), LLPreview::mForceClose, and TRUE.
BOOL LLPreviewNotecard::postBuild | ( | void | ) | [virtual] |
Reimplemented from LLPanel.
Definition at line 155 of file llpreviewnotecard.cpp.
References LLViewerTextEditor::makePristine(), mNotecardItemID, mObjectID, LLViewerTextEditor::setNotecardInfo(), and TRUE.
const LLInventoryItem * LLPreviewNotecard::getDragItem | ( | ) |
Definition at line 240 of file llpreviewnotecard.cpp.
References LLViewerTextEditor::getDragItem(), and NULL.
Referenced by LLToolDragAndDrop::locateInventory().
bool LLPreviewNotecard::hasEmbeddedInventory | ( | ) |
Definition at line 251 of file llpreviewnotecard.cpp.
References LLViewerTextEditor::hasEmbeddedInventory(), and NULL.
Referenced by LLUpdateTaskInventoryResponder::uploadComplete(), and LLUpdateAgentInventoryResponder::uploadComplete().
void LLPreviewNotecard::refreshFromInventory | ( | ) |
Definition at line 259 of file llpreviewnotecard.cpp.
References lldebugs, llendl, and loadAsset().
Referenced by LLUpdateTaskInventoryResponder::uploadComplete(), and LLUpdateAgentInventoryResponder::uploadComplete().
void LLPreviewNotecard::loadAsset | ( | ) | [protected, virtual] |
Reimplemented from LLPreview.
Definition at line 265 of file llpreviewnotecard.cpp.
References LLAgent::allowOperation(), LLPanel::childSetVisible(), FALSE, LLViewerObjectList::findObject(), gAgent, gAssetStorage, LLInventoryItem::getAssetUUID(), LLViewerRegion::getHost(), LLAgent::getID(), LLAssetStorage::getInvItemAsset(), LLPreview::getItem(), LLPermissions::getOwner(), LLInventoryItem::getPermissions(), LLViewerObject::getRegion(), LLAgent::getSessionID(), LLPanel::getString(), LLInventoryObject::getType(), LLInventoryObject::getUUID(), 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().
bool LLPreviewNotecard::saveIfNeeded | ( | LLInventoryItem * | copyitem = NULL |
) | [protected] |
Definition at line 461 of file llpreviewnotecard.cpp.
References LLVFile::APPEND, LLAssetType::AT_NOTECARD, LLViewerTextEditor::exportBuffer(), FALSE, gAgent, gAssetStorage, LLUUID::generate(), LLViewerRegion::getCapability(), LLPreview::getItem(), LLAgent::getRegion(), LLAgent::getSecureSessionID(), gVFS, LLUUID::isNull(), LLTextEditor::isPristine(), llendl, llinfos, llwarns, LLTransactionID::makeAssetID(), LLViewerTextEditor::makePristine(), LLPreview::mAssetStatus, LLPreview::mItemUUID, LLPreview::mObjectUUID, onSaveComplete(), LLHTTPClient::post(), LLPreview::PREVIEW_ASSET_LOADING, S32, setEnabled(), LLVFile::setMaxSize(), LLAssetStorage::storeAssetData(), and LLVFile::write().
Referenced by handleKeyHere(), onClickSave(), and saveItem().
LLPreviewNotecard * LLPreviewNotecard::getInstance | ( | const LLUUID & | uuid | ) | [static, protected] |
Definition at line 425 of file llpreviewnotecard.cpp.
References NULL, and LLPreview::sInstances.
Referenced by onLoadComplete().
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, LLView::getChild(), LLSingleton< LLViewerStats >::getInstance(), getInstance(), LLPreview::getItem(), LLInventoryItem::getPermissions(), LLVFile::getSize(), GP_OBJECT_MANIPULATE, 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::onClickSave | ( | void * | data | ) | [static, protected] |
Definition at line 437 of file llpreviewnotecard.cpp.
References saveIfNeeded().
Referenced by handleSaveChangesDialog(), and LLPreviewNotecard().
void LLPreviewNotecard::onSaveComplete | ( | const LLUUID & | asset_uuid, | |
void * | user_data, | |||
S32 | status, | |||
LLExtStat | ext_status | |||
) | [static, protected] |
Definition at line 540 of file llpreviewnotecard.cpp.
References LLViewerWindow::alertXml(), LLFloater::close(), LLViewerTextEditor::copyInventory(), dialog_refresh_all(), FALSE, LLPreview::find(), LLViewerObjectList::findObject(), gDirUtilp, LLView::getChild(), LLAssetStorage::getErrorString(), LLDir::getExpandedFilename(), LLViewerObject::getInventoryObject(), LLInventoryModel::getItem(), 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(), LLInventoryModel::updateItem(), and UUID_STR_LENGTH.
Referenced by saveIfNeeded().
void LLPreviewNotecard::handleSaveChangesDialog | ( | S32 | option, | |
void * | userdata | |||
) | [static, protected] |
Definition at line 618 of file llpreviewnotecard.cpp.
References LLAppViewer::abortQuit(), LLAppViewer::instance(), onClickSave(), and TRUE.
Referenced by canClose().
virtual const char* LLPreviewNotecard::getTitleName | ( | ) | const [inline, protected, virtual] |
LLViewerTextEditor* LLPreviewNotecard::mEditor [protected] |
Definition at line 109 of file llpreviewnotecard.h.
LLButton* LLPreviewNotecard::mSaveBtn [protected] |
Definition at line 110 of file llpreviewnotecard.h.
LLUUID LLPreviewNotecard::mAssetID [protected] |
Definition at line 112 of file llpreviewnotecard.h.
Referenced by LLPreviewNotecard(), and loadAsset().
LLUUID LLPreviewNotecard::mNotecardItemID [protected] |
LLUUID LLPreviewNotecard::mObjectID [protected] |
Reimplemented from LLPreview.
Definition at line 115 of file llpreviewnotecard.h.
Referenced by postBuild().