1 /*
2  * %kadu copyright begin%
3  * Copyright 2012 Bartosz Brachaczek (b.brachaczek@gmail.com)
4  * Copyright 2013, 2014 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com)
5  * %kadu copyright end%
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (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, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef VARIANT_WRAPPER_H
22 #define VARIANT_WRAPPER_H
23 
24 #include "exports.h"
25 
26 class QVariant;
27 
28 /**
29  * @addtogroup Misc
30  * @{
31  */
32 
33 /**
34  * @class VariantWrapper
35  * @short Interface class for getting and setting a single QVariant value.
36  * @author Bartosz 'beevvy' Brachaczek
37  */
38 class KADUAPI VariantWrapper
39 {
40 public:
~VariantWrapper()41 	virtual ~VariantWrapper() {}
42 
43 	/**
44 	 * @short Returns value stored by the underlying resource.
45 	 * @author Bartosz 'beevvy' Brachaczek
46 	 * @param defaultValue value which will returned if no value has been ever set on the underlying resource
47 	 * @return value stored by the underlying resource or @p defaultValue
48 	 *
49 	 * Returns value stored by the underlying resource. If no value has been
50 	 * ever set on the underlying resource, @p defaultValue is returned.
51 	 */
52 	virtual QVariant get(const QVariant &defaultValue = QVariant()) const = 0;
53 
54 	/**
55 	 * @short Sets passed value on the underlying resource.
56 	 * @author Bartosz 'beevvy' Brachaczek
57 	 * @param value value which will be set on the underlying resource
58 	 */
59 	virtual void set(const QVariant &value) = 0;
60 
61 };
62 
63 /**
64  * @}
65  */
66 
67 #endif // VARIANT_WRAPPER_H
68