File indexing completed on 2024-03-24 15:27:38
0001 /* This file is part of the KDE libraries 0002 Copyright (C) 2007 Olivier Goffart 0003 0004 This library is free software; you can redistribute it and/or 0005 modify it under the terms of the GNU Library General Public 0006 License as published by the Free Software Foundation; either 0007 version 2 of the License, or (at your option) any later version. 0008 0009 This library is distributed in the hope that it will be useful, 0010 but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 Library General Public License for more details. 0013 0014 You should have received a copy of the GNU Library General Public License 0015 along with this library; see the file COPYING.LIB. If not, write to 0016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #ifndef KCOLORDIALOGP_H 0021 #define KCOLORDIALOGP_H 0022 0023 #include <QWidget> 0024 0025 namespace KDEPrivate 0026 { 0027 0028 /** 0029 * A color palette in table form. 0030 * 0031 * @author Waldo Bastian <bastian@kde.org> 0032 **/ 0033 class KColorTable : public QWidget 0034 { 0035 Q_OBJECT 0036 public: 0037 KDELIBS4SUPPORT_DEPRECATED explicit KColorTable(QWidget *parent, int minWidth = 210, int cols = 16); 0038 ~KColorTable() override; 0039 0040 void addToCustomColors(const QColor &); 0041 void addToRecentColors(const QColor &); 0042 0043 QString name() const; 0044 0045 public Q_SLOTS: 0046 void setColors(const QString &collectionName); 0047 0048 Q_SIGNALS: 0049 void colorSelected(const QColor &, const QString &); 0050 void colorDoubleClicked(const QColor &, const QString &); 0051 0052 private: 0053 Q_PRIVATE_SLOT(d, void slotColorCellSelected(int index, const QColor &)) 0054 Q_PRIVATE_SLOT(d, void slotColorCellDoubleClicked(int index, const QColor &)) 0055 Q_PRIVATE_SLOT(d, void slotColorTextSelected(const QString &colorText)) 0056 Q_PRIVATE_SLOT(d, void slotSetColors(const QString &_collectionName)) 0057 Q_PRIVATE_SLOT(d, void slotShowNamedColorReadError(void)) 0058 0059 void readNamedColor(void); 0060 0061 private: 0062 virtual void setPalette(const QPalette &p) 0063 { 0064 QWidget::setPalette(p); 0065 } 0066 0067 private: 0068 class KColorTablePrivate; 0069 friend class KColorTablePrivate; 0070 KColorTablePrivate *const d; 0071 0072 Q_DISABLE_COPY(KColorTable) 0073 }; 0074 0075 } 0076 0077 #endif