This introduces a new LFUN LFUN_INSET_COPY_AS, which copies a certain Inset to the clipboard. For InsetInfo this is the text that is visible, but this could also replace LFUN_LABEL_COPY_AS_REF, by copying the INSET to the clipboard as a reference, and also a Math inset to copy to the clipboard as latex (including $'s or \[..\]).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34223
a592a061-630c-0410-9148-
cb99ea01b6c8
Menu "context-info"
Submenu "Document Info|D" "buffer-info"
Separator
+ Item "Copy Text|o" "inset-copy-as"
Item "Settings...|S" "inset-settings info"
End
// 345
LFUN_PREVIEW_INSERT, // vfr, 20100328
LFUN_FORWARD_SEARCH,
+ LFUN_INSET_COPY_AS, // vfr, 20100419
LFUN_LASTACTION // end of the table
};
*/
{ LFUN_BUFFER_ZOOM_OUT, "buffer-zoom-out", ReadOnly, Buffer },
-
+/*!
+ * \var lyx::FuncCode lyx::LFUN_INSET_COPY_AS
+ * \li Action: Copies the inset to the clipboard as a certain type
+ * \li Syntax: inset-copy-as [<TYPE>]
+ * \li Params: <TYPE>: The type as which the inset is copied. This
+ can vary from inset to inset.
+ * \li Sample: InsetInfo is copied as text
+ * \li Origin: vfr, 18 Apr 2010
+ * \endvar
+ */
+ { LFUN_INSET_COPY_AS, "inset-copy-as", ReadOnly | NoUpdate | AtPoint, Edit },
{ LFUN_NOACTION, "", Noop, Hidden }
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#include "Buffer.h"
#include "BufferParams.h"
#include "BufferView.h"
+#include "CutAndPaste.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
#include "InsetGraphics.h"
return InsetCollapsable::getStatus(cur, cmd, flag);
case LFUN_INSET_DIALOG_UPDATE:
+ case LFUN_INSET_COPY_AS:
flag.setEnabled(true);
return true;
setInfo(to_utf8(cmd.argument()));
break;
+ case LFUN_INSET_COPY_AS: {
+ cap::clearSelection();
+ Cursor copy(cur);
+ copy.pushBackward(*this);
+ copy.pit() = 0;
+ copy.pos() = 0;
+ copy.resetAnchor();
+ copy.pit() = copy.lastpit();
+ copy.pos() = copy.lastpos();
+ copy.setSelection();
+ cap::copySelection(copy);
+ break;
+ }
+
default:
InsetCollapsable::doDispatch(cur, cmd);
break;