[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
klfcolorchooser_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  * file klfcolorchooser_p.h
3  * This file is part of the KLatexFormula Project.
4  * Copyright (C) 2011 by Philippe Faist
5  * philippe.faist at bluewin.ch
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program; if not, write to the *
19  * Free Software Foundation, Inc., *
20  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  ***************************************************************************/
22 /* $Id: klfcolorchooser_p.h 603 2011-02-26 23:14:55Z phfaist $ */
23 
24 #ifndef KLFCOLORCHOOSER_P_H
25 #define KLFCOLORCHOOSER_P_H
26 
27 #include "klfcolorchooser.h"
28 
29 #define MAX_RECENT_COLORS 128
30 
31 
32 class KLF_EXPORT KLFColorList : public QObject
33 {
34  Q_OBJECT
35 
36  Q_PROPERTY(int maxSize READ maxSize WRITE setMaxSize)
37 public:
38  KLFColorList(int maxsize) : QObject(qApp) { _maxsize = maxsize; }
39 
40  int maxSize() const { return _maxsize; }
41 
43 
44 signals:
45  void listChanged();
46 
47 public slots:
48  void setMaxSize(int maxsize) { _maxsize = maxsize; }
49  void addColor(const QColor& color);
50  void removeColor(const QColor& color);
51  void notifyListChanged() { emit listChanged(); }
52 
53 private:
54  int _maxsize;
55 };
56 
57 
58 #endif
QList< QColor > list
KLFColorList(int maxsize)
void setMaxSize(int maxsize)
void notifyListChanged()
int maxSize() const

Generated by doxygen 1.8.6