PageRenderTime 34ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llpreviewnotecard.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 107 lines | 43 code | 26 blank | 38 comment | 0 complexity | ed297938a8524d6176f42ab7aa514877 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llpreviewnotecard.h
  3. * @brief LLPreviewNotecard class header file
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLPREVIEWNOTECARD_H
  27. #define LL_LLPREVIEWNOTECARD_H
  28. #include "llpreview.h"
  29. #include "llassetstorage.h"
  30. #include "lliconctrl.h"
  31. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  32. // Class LLPreviewNotecard
  33. //
  34. // This class allows us to edit notecards
  35. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36. class LLViewerTextEditor;
  37. class LLButton;
  38. class LLPreviewNotecard : public LLPreview
  39. {
  40. public:
  41. LLPreviewNotecard(const LLSD& key);
  42. virtual ~LLPreviewNotecard();
  43. bool saveItem();
  44. // llview
  45. virtual void draw();
  46. virtual BOOL handleKeyHere(KEY key, MASK mask);
  47. virtual void setEnabled( BOOL enabled );
  48. // llfloater
  49. virtual BOOL canClose();
  50. // llpanel
  51. virtual BOOL postBuild();
  52. // reach into the text editor, and grab the drag item
  53. const LLInventoryItem* getDragItem();
  54. // return true if there is any embedded inventory.
  55. bool hasEmbeddedInventory();
  56. // After saving a notecard, the tcp based upload system will
  57. // change the asset, therefore, we need to re-fetch it from the
  58. // asset system. :(
  59. void refreshFromInventory(const LLUUID& item_id = LLUUID::null);
  60. protected:
  61. void updateTitleButtons();
  62. virtual void loadAsset();
  63. bool saveIfNeeded(LLInventoryItem* copyitem = NULL);
  64. void deleteNotecard();
  65. static void onLoadComplete(LLVFS *vfs,
  66. const LLUUID& asset_uuid,
  67. LLAssetType::EType type,
  68. void* user_data, S32 status, LLExtStat ext_status);
  69. static void onClickSave(void* data);
  70. static void onClickDelete(void* data);
  71. static void onSaveComplete(const LLUUID& asset_uuid,
  72. void* user_data,
  73. S32 status, LLExtStat ext_status);
  74. bool handleSaveChangesDialog(const LLSD& notification, const LLSD& response);
  75. protected:
  76. LLViewerTextEditor* mEditor;
  77. LLButton* mSaveBtn;
  78. LLUUID mAssetID;
  79. LLUUID mObjectID;
  80. };
  81. #endif // LL_LLPREVIEWNOTECARD_H