c2bClipboard.h 1.27 KB
Newer Older
1
/***************************************************************************
2
 *   Copyright (C) 2004-2018 by Pere Constans
3
 *   constans@molspaces.com
4
 *   cb2Bib version 1.9.9. Licensed under the GNU GPL version 3.
5 6 7 8 9 10
 *   See the LICENSE file that comes with this distribution.
 ***************************************************************************/
#ifndef C2BCLIPBOARD_H
#define C2BCLIPBOARD_H

#include <QObject>
11

12 13 14 15 16 17 18
#include <QClipboard>
#include <QTimer>


/**
    cb2Bib Clipboard

19
    Implements clipboard functionality as required by cb2Bib This should fix
20 21
    acrobat, mozilla, qt 3.3.3 issues Using clipboardPoll

22
    STATUS: DEPRECATED
23 24
*/

25
#ifdef C2B_USE_CBPOLL
26 27 28 29 30 31 32
class clipboardPoll;
#endif

class c2bClipboard : public QObject
{
    Q_OBJECT
public:
33
    explicit c2bClipboard(QObject* parento = 0);
34 35
    ~c2bClipboard();

36

37
    void setConnected(bool);
38 39 40 41 42 43 44


signals:
    void cbDataChanged(const QString&);


private:
45 46 47 48 49 50
    QClipboard* _cb;
    QString _cb_text;
    QString _cbs_text;
    bool _is_connected;
    bool _supports_selection;
    uint _interval;
51
#ifdef C2B_USE_CBPOLL
52
    clipboardPoll* _poll;
53 54 55
#else
    QTimer* _timer;
#endif
56 57 58 59 60 61 62 63 64 65 66


private slots:
    void checkData();
    void dataChanged();
    void newClipboardData(bool selectionMode);
    void selectionChanged();

};

#endif