fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / kdeui / kernel / kclipboard.h
blob01b554b75ad2ae2e230f6c053bfbc1105ddcb6be
1 /* This file is part of the KDE libraries
2 Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2, as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
19 #ifndef KCLIPBOARD_H
20 #define KCLIPBOARD_H
22 #include <kdeui_export.h>
24 #include <QtCore/QObject>
25 #include <QtGui/QClipboard>
27 class QMimeData;
29 /**
30 * This class is only for internal use.
32 * @short Allowing to automatically synchronize the X11 Clipboard and Selection buffers.
33 * @author Carsten Pfeiffer <pfeiffer@kde.org>
35 class KDEUI_EXPORT KClipboardSynchronizer : public QObject
37 Q_OBJECT
39 public:
40 friend class KlipperWidget;
42 /**
43 * Returns the KClipboardSynchronizer singleton object.
44 * @return the KClipboardSynchronizer singleton object.
46 static KClipboardSynchronizer *self();
48 /**
49 * Configures KClipboardSynchronizer to synchronize the Selection to Clipboard whenever
50 * it changes.
52 * Default is false.
53 * @see isSynchronizing
55 static void setSynchronizing( bool sync );
57 /**
58 * Checks whether Clipboard and Selection will be synchronized upon changes.
59 * @returns whether Clipboard and Selection will be synchronized upon
60 * changes.
61 * @see setSynchronizing
63 static bool isSynchronizing();
65 /**
66 * Configures KClipboardSynchronizer to copy the Clipboard buffer to the Selection
67 * buffer whenever the Clipboard changes.
70 * @param enable true to enable implicit selection, false otherwise.
71 * Default is true.
72 * @see selectionSetting
74 static void setReverseSynchronizing( bool enable );
76 /**
77 * Checks whether the Clipboard buffer will be copied to the Selection
78 * buffer upon changes.
79 * @returns whether the Clipboard buffer will be copied to the Selection
80 * buffer upon changes.
81 * @see setSelectionSetting
83 static bool isReverseSynchronizing();
85 protected:
86 ~KClipboardSynchronizer();
88 private:
89 // needed by klipper
90 enum Configuration { Synchronize = 1 };
92 explicit KClipboardSynchronizer( QObject *parent = 0 );
94 class Private;
95 Private* const d;
97 Q_PRIVATE_SLOT(d, void _k_slotSelectionChanged())
98 Q_PRIVATE_SLOT(d, void _k_slotClipboardChanged())
99 Q_PRIVATE_SLOT(d, void _k_slotNotifyChange(int, int))
102 #endif // KCLIPBOARD_H