PageRenderTime 22ms CodeModel.GetById 7ms app.highlight 9ms RepoModel.GetById 2ms 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
 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
27#ifndef LL_LLCLIPBOARD_H
28#define LL_LLCLIPBOARD_H
29
30
31#include "llstring.h"
32#include "lluuid.h"
33#include "stdenums.h"
34#include "llinventory.h"
35
36
37class LLClipboard
38{
39public:
40	LLClipboard();
41	~LLClipboard();
42
43	/* We support two flavors of clipboard.  The default is the explicitly
44	   copy-and-pasted clipboard.  The second is the so-called 'primary' clipboard
45	   which is implicitly copied upon selection on platforms which expect this
46	   (i.e. X11/Linux). */
47
48	void		copyFromSubstring(const LLWString &copy_from, S32 pos, S32 len, const LLUUID& source_id = LLUUID::null );
49	void		copyFromString(const LLWString &copy_from, const LLUUID& source_id = LLUUID::null );
50	BOOL		canPasteString() const;
51	const LLWString&	getPasteWString(LLUUID* source_id = NULL);
52
53	void		copyFromPrimarySubstring(const LLWString &copy_from, S32 pos, S32 len, const LLUUID& source_id = LLUUID::null );
54	BOOL		canPastePrimaryString() const;
55	const LLWString&	getPastePrimaryWString(LLUUID* source_id = NULL);	
56
57	// Support clipboard for object known only by their uuid and asset type
58	void		  setSourceObject(const LLUUID& source_id, LLAssetType::EType type);
59	const LLInventoryObject* getSourceObject() { return mSourceItem; }
60	
61private:
62	LLUUID      mSourceID;
63	LLWString	mString;
64	LLInventoryObject* mSourceItem;
65};
66
67
68// Global singleton
69extern LLClipboard gClipboard;
70
71
72#endif  // LL_LLCLIPBOARD_H