File indexing completed on 2024-04-21 14:54:20

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 1999 Reginald Stadlbauer <reggie@kde.org>
0004     SPDX-FileCopyrightText: 1999 Simon Hausmann <hausmann@kde.org>
0005     SPDX-FileCopyrightText: 2000 Nicolas Hadacek <haadcek@kde.org>
0006     SPDX-FileCopyrightText: 2000 Kurt Granroth <granroth@kde.org>
0007     SPDX-FileCopyrightText: 2000 Michael Koch <koch@kde.org>
0008     SPDX-FileCopyrightText: 2001 Holger Freyther <freyther@kde.org>
0009     SPDX-FileCopyrightText: 2002 Ellis Whitehead <ellis@kde.org>
0010     SPDX-FileCopyrightText: 2003 Andras Mantia <amantia@kde.org>
0011     SPDX-FileCopyrightText: 2005-2006 Hamish Rodda <rodda@kde.org>
0012 
0013     SPDX-License-Identifier: LGPL-2.0-only
0014 */
0015 
0016 #ifndef KPASTETEXTACTION_H
0017 #define KPASTETEXTACTION_H
0018 
0019 #include <QAction>
0020 #include <memory>
0021 
0022 #include <kconfigwidgets_export.h>
0023 
0024 class KPasteTextActionPrivate;
0025 
0026 #if KCONFIGWIDGETS_ENABLE_DEPRECATED_SINCE(5, 39)
0027 /**
0028  * @class KPasteTextAction kpastetextaction.h KPasteTextAction
0029  *
0030  * An action for pasting text from the clipboard.
0031  * It's useful for text handling applications as
0032  * when plugged into a toolbar it provides a menu
0033  * with the clipboard history if klipper is running.
0034  * If klipper is not running, the menu has only one
0035  * item: the current clipboard content.
0036  * @deprecated since 5.39
0037  */
0038 class KCONFIGWIDGETS_EXPORT KPasteTextAction : public QAction
0039 {
0040     Q_OBJECT
0041 public:
0042     /**
0043      * Constructs an action with the specified parent.
0044      *
0045      * @param parent The parent of this action.
0046      */
0047     KCONFIGWIDGETS_DEPRECATED_VERSION(5, 39, "No longer use this class")
0048     explicit KPasteTextAction(QObject *parent);
0049 
0050     /**
0051      * Constructs an action with text; a shortcut may be specified by
0052      * the ampersand character (e.g. \"&amp;Option\" creates a shortcut with key \e O )
0053      *
0054      * This is the most common KAction used when you do not have a
0055      * corresponding icon (note that it won't appear in the current version
0056      * of the "Edit ToolBar" dialog, because an action needs an icon to be
0057      * plugged in a toolbar...).
0058      *
0059      * @param text The text that will be displayed.
0060      * @param parent The parent of this action.
0061      */
0062     KCONFIGWIDGETS_DEPRECATED_VERSION(5, 39, "No longer use this class")
0063     KPasteTextAction(const QString &text, QObject *parent);
0064 
0065     /**
0066      * Constructs an action with text and an icon; a shortcut may be specified by
0067      * the ampersand character (e.g. \"&amp;Option\" creates a shortcut with key \e O )
0068      *
0069      * This is the other common KAction used.  Use it when you
0070      * \e do have a corresponding icon.
0071      *
0072      * @param icon The icon to display.
0073      * @param text The text that will be displayed.
0074      * @param parent The parent of this action.
0075      */
0076     KCONFIGWIDGETS_DEPRECATED_VERSION(5, 39, "No longer use this class")
0077     KPasteTextAction(const QIcon &icon, const QString &text, QObject *parent);
0078 
0079     ~KPasteTextAction() override;
0080 
0081     /**
0082      * Controls the behavior of the clipboard history menu popup.
0083      *
0084      * @param mode If false and the clipboard contains a non-text object
0085      *             the popup menu with the clipboard history will appear
0086      *             immediately as the user clicks the toolbar action; if
0087      *             true, the action works like the standard paste action
0088      *             even if the current clipboard object is not text.
0089      *             Default value is true.
0090      */
0091     void setMixedMode(bool mode);
0092 
0093 private:
0094     std::unique_ptr<KPasteTextActionPrivate> const d;
0095 };
0096 #endif
0097 
0098 #endif