Warning, file /office/calligra/libs/widgets/KoColorPopupAction.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002  * Copyright (c) 2007 C. Boemann <cbo@boemann.dk>
0003  * Copyright (C) 2007 Fredy Yanardi <fyanardi@gmail.com>
0004  *
0005  * This library is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU Library General Public
0007  * License as published by the Free Software Foundation; either
0008  * version 2 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, write to
0017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019  */
0020 
0021 #ifndef KOCOLORPOPUPACTION_H
0022 #define KOCOLORPOPUPACTION_H
0023 
0024 #include <QAction>
0025 
0026 #include "kowidgets_export.h"
0027 
0028 class KoColor;
0029 
0030 /**
0031  * KoColorPopupAction makes use of KoColorSetWidget to show a widget for for choosing a color (colormanaged via pigment).
0032  * @see KoColorPopupAction
0033  */
0034 
0035 class KOWIDGETS_EXPORT KoColorPopupAction : public QAction
0036 {
0037     Q_OBJECT
0038 
0039 public:
0040     /**
0041       * Constructs a KoColorPopupAction with the specified parent.
0042       *
0043       * @param parent The parent for this action.
0044       */
0045     explicit KoColorPopupAction(QObject *parent = nullptr);
0046 
0047     /**
0048      * Destructor
0049      */
0050     ~KoColorPopupAction() override;
0051 
0052 public Q_SLOTS:
0053     /// Sets a new color to be displayed
0054     void setCurrentColor( const QColor &color );
0055 
0056     /// Sets a new color to be displayed
0057     void setCurrentColor( const KoColor &color );
0058 
0059     /// Returns the current color
0060     QColor currentColor() const;
0061 
0062     /// Returns the current color as a KoColor
0063     KoColor currentKoColor() const;
0064 
0065     /// update the icon - only needed if you resize the iconsize in the widget that shows the action
0066     void updateIcon();
0067 
0068 Q_SIGNALS:
0069     /**
0070      * Emitted every time the color changes (by calling setColor() or
0071      * by user interaction.
0072      * @param color the new color
0073      */
0074     void colorChanged(const KoColor &color);
0075 
0076 private Q_SLOTS:
0077     void emitColorChanged();
0078     void colorWasSelected(const KoColor &color, bool final);
0079     void colorWasEdited( const KoColor &color );
0080     void opacityWasChanged( int opacity );
0081     void slotTriggered(bool);
0082 
0083 private:
0084     class KoColorPopupActionPrivate;
0085     KoColorPopupActionPrivate * const d;
0086 };
0087 
0088 #endif
0089