00001 /*************************************************************************** 00002 * file klfcolorchooser_p.h 00003 * This file is part of the KLatexFormula Project. 00004 * Copyright (C) 2010 by Philippe Faist 00005 * philippe.faist at bluewin.ch 00006 * * 00007 * This program is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU General Public License as published by * 00009 * the Free Software Foundation; either version 2 of the License, or * 00010 * (at your option) any later version. * 00011 * * 00012 * This program is distributed in the hope that it will be useful, * 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00015 * GNU General Public License for more details. * 00016 * * 00017 * You should have received a copy of the GNU General Public License * 00018 * along with this program; if not, write to the * 00019 * Free Software Foundation, Inc., * 00020 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00021 ***************************************************************************/ 00022 /* $Id: klfcolorchooser_p.h 510 2010-09-22 23:33:10Z philippe $ */ 00023 00024 #ifndef KLFCOLORCHOOSER_P_H 00025 #define KLFCOLORCHOOSER_P_H 00026 00027 #include "klfcolorchooser.h" 00028 00029 #define MAX_RECENT_COLORS 128 00030 00031 00032 class KLF_EXPORT KLFColorList : public QObject 00033 { 00034 Q_OBJECT 00035 00036 Q_PROPERTY(int maxSize READ maxSize WRITE setMaxSize) 00037 public: 00038 KLFColorList(int maxsize) : QObject(qApp) { _maxsize = maxsize; } 00039 00040 int maxSize() const { return _maxsize; } 00041 00042 QList<QColor> list; 00043 00044 signals: 00045 void listChanged(); 00046 00047 public slots: 00048 void setMaxSize(int maxsize) { _maxsize = maxsize; } 00049 void addColor(const QColor& color); 00050 void removeColor(const QColor& color); 00051 void notifyListChanged() { emit listChanged(); } 00052 00053 private: 00054 int _maxsize; 00055 }; 00056 00057 00058 #endif