Added a class to hold data from the commands
[dashstudio.git] / src / global / datasource.h
blobbd19c675e2a97932be216080a0d976672d28cb14
1 /***************************************************************************
2 * Copyright (C) 2007 by David Cuadrado *
3 * krawek@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 DATASOURCE_H
23 #define DATASOURCE_H
25 #include <QVariant>
27 /**
28 * @author David Cuadrado <krawek@gmail.com>
30 class DataSource
32 public:
33 enum Type {
34 Unknown = 0x00,
35 Project = 0x01,
36 Scene = 0x02,
37 Layer = 0x04,
38 Frame = 0x08,
39 Object = 0x10,
40 Library = 0x20,
41 All = Project | Scene | Layer | Frame | Object | Library
44 DataSource();
45 DataSource(Type type);
46 ~DataSource();
48 void setType(DataSource::Type type);
49 DataSource::Type type() const;
51 void setData(const QString &key, const QVariant &data);
52 QVariant data(const QString &key) const;
54 private:
55 struct Private;
56 Private *const d;
59 #endif