krita

kis_exif_info.h

00001 /*
00002  * This file is part of Krita
00003  *
00004  *  Copyright (c) 2006 Cyrille Berger <cberger@cberger.net>
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  */
00020 #ifndef KIS_DOCUMENT_INFO_EXIF_H
00021 #define KIS_DOCUMENT_INFO_EXIF_H
00022 
00023 #include "kis_exif_value.h"
00024 
00025 #include <qdom.h> 
00026 #include <qmap.h>
00027 
00028 class KisExifInfo
00029 {
00030     public:
00031         KisExifInfo();
00032         virtual ~KisExifInfo();
00033 
00034         virtual bool load(const QDomElement& elmt);
00035         virtual QDomElement save(QDomDocument& doc);
00036 
00037         bool getValue(QString name, ExifValue& value)
00038         {
00039             if ( m_values.find( name ) == m_values.end() ) {
00040                 return false;
00041             }
00042             else {
00043                 value = m_values[name];
00044                 return true;
00045             }
00046         }
00047         void setValue(QString name, ExifValue value)
00048         {
00049             m_values[name] = value;
00050         }
00051         typedef QMap<QString, ExifValue> evMap;
00052         evMap::const_iterator begin() const { return m_values.begin(); }
00053         evMap::const_iterator end() const { return m_values.end(); }
00054     private:
00055         evMap m_values;
00056 };
00057 
00058 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys