PageRenderTime 35ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llui/llclipboard.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 72 lines | 27 code | 14 blank | 31 comment | 0 complexity | 6fe7bcdb92adf5b1a11233a27744623a MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llclipboard.h
  3. * @brief LLClipboard base class
  4. *
  5. * $LicenseInfo:firstyear=2001&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_LLCLIPBOARD_H
  27. #define LL_LLCLIPBOARD_H
  28. #include "llstring.h"
  29. #include "lluuid.h"
  30. #include "stdenums.h"
  31. #include "llinventory.h"
  32. class LLClipboard
  33. {
  34. public:
  35. LLClipboard();
  36. ~LLClipboard();
  37. /* We support two flavors of clipboard. The default is the explicitly
  38. copy-and-pasted clipboard. The second is the so-called 'primary' clipboard
  39. which is implicitly copied upon selection on platforms which expect this
  40. (i.e. X11/Linux). */
  41. void copyFromSubstring(const LLWString &copy_from, S32 pos, S32 len, const LLUUID& source_id = LLUUID::null );
  42. void copyFromString(const LLWString &copy_from, const LLUUID& source_id = LLUUID::null );
  43. BOOL canPasteString() const;
  44. const LLWString& getPasteWString(LLUUID* source_id = NULL);
  45. void copyFromPrimarySubstring(const LLWString &copy_from, S32 pos, S32 len, const LLUUID& source_id = LLUUID::null );
  46. BOOL canPastePrimaryString() const;
  47. const LLWString& getPastePrimaryWString(LLUUID* source_id = NULL);
  48. // Support clipboard for object known only by their uuid and asset type
  49. void setSourceObject(const LLUUID& source_id, LLAssetType::EType type);
  50. const LLInventoryObject* getSourceObject() { return mSourceItem; }
  51. private:
  52. LLUUID mSourceID;
  53. LLWString mString;
  54. LLInventoryObject* mSourceItem;
  55. };
  56. // Global singleton
  57. extern LLClipboard gClipboard;
  58. #endif // LL_LLCLIPBOARD_H