]>
vaikene.ee Git - evaf/blob - src/libs/Common/prop.h
1574f2546cb3744b2ad51a9b419d02007eb7908f
3 * @brief Implementation of the iProp interface
6 * Copyright (c) 2011 Enar Vaikene
8 * This file is part of the eVaf C++ cross-platform application development framework.
10 * This file can be used under the terms of the GNU General Public License
11 * version 3.0 as published by the Free Software Foundation and appearing in
12 * the file LICENSE included in the packaging of this file. Please review the
13 * the following information to ensure the GNU General Public License version
14 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
20 #ifndef __COMMON_PROP_H
21 # define __COMMON_PROP_H
34 * Implementation of the iProp interface.
36 * This class implements the iProp interface for global properties and variables.
37 * Persistent properties are stored in the file '.\<appname\>.dat' in the directory
38 * returned with the eVaf::Common::iApp::dataRootDir() function. The file is in the
39 * QSettings::IniFormat format.
41 class Prop
: public iProp
52 * Returns the current implementation of the iProp interface
54 iProp
* _interface() const;
57 * Initializes the iProp interface implementation
58 * @return True if succeeded; false if not
63 * Finalizes the iProp interface implementation
71 virtual QVariant
getValue(QString
const & name
, QVariant
const & defaultValue
) const;
73 virtual void setValue(QString
const & name
, QVariant
const & value
, bool persistent
= false);
78 /// List of properties
79 QHash
<QString
, QVariant
> mProps
;
81 /// Persistent property values
82 QSettings
* mPersistentProps
;
86 } // namespace eVaf::Common::Internal
87 } // namespace eVaf::Common