- Save/load palettes properly
[dashstudio.git] / src / components / colorpalette / private / cellscolor.h
blob87d3d55aaf73d5a18e79e8b838ffd8a54c38affd
1 /***************************************************************************
2 * Copyright (C) 2005 by Jorge Cuadrado *
3 * kuadrosxx@gmail.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
22 #ifndef COMPONENTSCELLSCOLOR_H
23 #define COMPONENTSCELLSCOLOR_H
25 #include <dgui/cellview.h>
27 namespace Component {
29 /**
30 * @author Jorge Cuadrado <kuadrosxx@gmail.com>
32 class CellsColor : public DGui::CellView
34 Q_OBJECT;
36 public:
37 enum Type {
38 Color = 0x01,
39 Gradient
42 CellsColor(QWidget *parent = 0);
43 ~CellsColor();
45 bool load(const QString &file);
47 void setReadOnly(bool enable);
48 void setType(Type type);
50 bool isReadOnly() const;
53 int type() const;
54 QString name() const;
55 void setName(const QString& name);
57 public slots:
58 void save();
59 void save( const QString& path);
61 protected:
62 void mousePressEvent(QMouseEvent* e);
63 void mouseMoveEvent(QMouseEvent* e);
64 void dragEnterEvent(QDragEnterEvent* e);
65 void dropEvent(QDropEvent* e);
67 private:
68 struct Private;
69 Private *const d;
74 #endif