From: Abdelrazak Younes Date: Wed, 3 Jan 2007 08:53:54 +0000 (+0000) Subject: Prepare for external/internal clipboard merging. X-Git-Tag: 1.6.10~11380 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6fcb3fe6a2cab344b2cb15ac5c81cee831c7b886;p=features.git Prepare for external/internal clipboard merging. * Clipboard.h: new isInternal() pure virtual method * Selection.h: new isInternal() pure virtual method * GuiClipboard, GuiSelection: implement new method. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16476 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/Clipboard.h b/src/frontends/Clipboard.h index 9e831a455e..817b78144c 100644 --- a/src/frontends/Clipboard.h +++ b/src/frontends/Clipboard.h @@ -39,6 +39,10 @@ public: * the clipboard. */ virtual void put(docstring const &) = 0; + + /// state of clipboard. + /// \retval true if the system clipboard has been set within LyX. + virtual bool isInternal() const = 0; }; } // namespace frontend diff --git a/src/frontends/Selection.h b/src/frontends/Selection.h index e99bf924e0..94410c498f 100644 --- a/src/frontends/Selection.h +++ b/src/frontends/Selection.h @@ -43,6 +43,10 @@ public: * This should be called whenever some text is highlighted. */ virtual void put(docstring const &) = 0; + + /// state of clipboard. + /// \retval true if the system clipboard has been set within LyX. + virtual bool isInternal() const = 0; }; } // namespace frontend diff --git a/src/frontends/qt4/GuiClipboard.C b/src/frontends/qt4/GuiClipboard.C index ea7d891ad3..fe45d65691 100644 --- a/src/frontends/qt4/GuiClipboard.C +++ b/src/frontends/qt4/GuiClipboard.C @@ -50,5 +50,11 @@ void GuiClipboard::put(docstring const & str) QClipboard::Clipboard); } + +bool GuiClipboard::isInternal() const +{ + return qApp->clipboard()->ownsClipboard(); +} + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/GuiClipboard.h b/src/frontends/qt4/GuiClipboard.h index 5f577edf93..74fac3b7f7 100644 --- a/src/frontends/qt4/GuiClipboard.h +++ b/src/frontends/qt4/GuiClipboard.h @@ -32,6 +32,7 @@ public: //@{ docstring const get() const; void put(docstring const & str); + bool isInternal() const; //@} }; diff --git a/src/frontends/qt4/GuiSelection.C b/src/frontends/qt4/GuiSelection.C index 83c3dfb625..3142781abd 100644 --- a/src/frontends/qt4/GuiSelection.C +++ b/src/frontends/qt4/GuiSelection.C @@ -62,5 +62,11 @@ void GuiSelection::put(docstring const & str) QClipboard::Selection); } + +bool GuiSelection::isInternal() const +{ + return qApp->clipboard()->ownsSelection(); +} + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/GuiSelection.h b/src/frontends/qt4/GuiSelection.h index ed6210f713..fffb803b90 100644 --- a/src/frontends/qt4/GuiSelection.h +++ b/src/frontends/qt4/GuiSelection.h @@ -33,6 +33,7 @@ public: void haveSelection(bool own); docstring const get() const; void put(docstring const & str); + bool isInternal() const; //@} };