]> git.lyx.org Git - features.git/commitdiff
Prepare for external/internal clipboard merging.
authorAbdelrazak Younes <younes@lyx.org>
Wed, 3 Jan 2007 08:53:54 +0000 (08:53 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 3 Jan 2007 08:53:54 +0000 (08:53 +0000)
* 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

src/frontends/Clipboard.h
src/frontends/Selection.h
src/frontends/qt4/GuiClipboard.C
src/frontends/qt4/GuiClipboard.h
src/frontends/qt4/GuiSelection.C
src/frontends/qt4/GuiSelection.h

index 9e831a455eb6048bb8c5daf26d304cce73cfc4e6..817b78144c22ed4c79af9e530b559f03e9198a22 100644 (file)
@@ -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
index e99bf924e073630243c1624ed36a79dd9ed85f2c..94410c498f12c05211794ee016b685a2d43dcde3 100644 (file)
@@ -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
index ea7d891ad32026c1bd27621c3e756a258b2ccf62..fe45d656919201cfdb9ae103543fbd3e6b0e57a2 100644 (file)
@@ -50,5 +50,11 @@ void GuiClipboard::put(docstring const & str)
                                   QClipboard::Clipboard);
 }
 
+
+bool GuiClipboard::isInternal() const
+{
+       return qApp->clipboard()->ownsClipboard();
+}
+
 } // namespace frontend
 } // namespace lyx
index 5f577edf93519db482f62f6c39c4610fe2c564e1..74fac3b7f78c5402b7469f13529583a496b66ffd 100644 (file)
@@ -32,6 +32,7 @@ public:
        //@{
        docstring const get() const;
        void put(docstring const & str);
+       bool isInternal() const;
        //@}
 };
 
index 83c3dfb625bcefb028be1e492232a8c23275048d..3142781abd356c3d11c191eb569a91c16b16a9e7 100644 (file)
@@ -62,5 +62,11 @@ void GuiSelection::put(docstring const & str)
                                   QClipboard::Selection);
 }
 
+
+bool GuiSelection::isInternal() const
+{
+       return qApp->clipboard()->ownsSelection();
+}
+
 } // namespace frontend
 } // namespace lyx
index ed6210f7133859525d799b5da98637a628227588..fffb803b90f4bd5de8932dc1d46c2a8fbc1e4c6e 100644 (file)
@@ -33,6 +33,7 @@ public:
        void haveSelection(bool own);
        docstring const get() const;
        void put(docstring const & str);
+       bool isInternal() const;
        //@}
 };