From 420b91db29485df39fd6e724e782c449158811cb Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 2 Jan 2007 08:33:20 +0000 Subject: Print done when done. --- indra/llui/llclipboard.cpp | 71 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 indra/llui/llclipboard.cpp (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp new file mode 100644 index 0000000000..f2b546ec28 --- /dev/null +++ b/indra/llui/llclipboard.cpp @@ -0,0 +1,71 @@ +/** + * @file llclipboard.cpp + * @brief LLClipboard base class + * + * Copyright (c) 2001-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#include "linden_common.h" + +#include "llclipboard.h" + +#include "llerror.h" +#include "llmath.h" +#include "llstring.h" +#include "llview.h" +#include "llwindow.h" + +// Global singleton +LLClipboard gClipboard; + + +LLClipboard::LLClipboard() +{ +} + + +LLClipboard::~LLClipboard() +{ +} + + +void LLClipboard::copyFromSubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id ) +{ + mSourceID = source_id; + mString = src.substr(pos, len); + LLView::getWindow()->copyTextToClipboard( mString ); +} + + +LLWString LLClipboard::getPasteWString( LLUUID* source_id ) +{ + if( mSourceID.notNull() ) + { + LLWString temp_string; + LLView::getWindow()->pasteTextFromClipboard(temp_string); + + if( temp_string != mString ) + { + mSourceID.setNull(); + mString = temp_string; + } + } + else + { + LLView::getWindow()->pasteTextFromClipboard(mString); + } + + if( source_id ) + { + *source_id = mSourceID; + } + + return mString; +} + + +BOOL LLClipboard::canPasteString() +{ + return LLView::getWindow()->isClipboardTextAvailable(); +} -- cgit v1.3