libKipi
imageinfo.cpp
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of kipi-plugins project
4 * http://www.kipi-plugins.org
5 *
6 * Date : 2004-07-22
7 * Description : image info.
8 *
9 * Copyright (C) 2004-2007 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 * Copyright (C) 2004-2005 by Renchi Raju <renchi.raju at kdemail.net>
11 * Copyright (C) 2004-2005 by Jesper K. Pedersen <blackie at kde.org>
12 * Copyright (C) 2004-2005 by Aurelien Gateau <aurelien dot gateau at free.fr>
13 *
14 * This program is free software; you can redistribute it
15 * and/or modify it under the terms of the GNU General
16 * Public License as published by the Free Software Foundation;
17 * either version 2, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * ============================================================ */
25
26// Local includes.
27
28#include "imageinfo.h"
29#include "KDStream.h"
30#include "imageinfoshared.h"
31
34QString KIPI::ImageInfo::toString( const QVariant& data ) const
35{
36 QString string;
37 KDStream stream( &string );
38 stream << data
39 << flush ;
40 return string;
41}
42
47{
48 return _data->title();
49}
50
55{
56 return _data->path();
57}
58
63{
64 return _data->description();
65}
66
72QDateTime KIPI::ImageInfo::time( TimeSpec spec ) const
73{
74 return _data->time( spec );
75}
76
85QMap<QString,QVariant> KIPI::ImageInfo::attributes() const
86{
87 return _data->attributes();
88}
89
94{
95 return _data->size();
96}
97
99 : _data( shared )
100{
101}
102
104{
105 _data = rhs._data;
106 _data->addRef();
107}
108
110{
111 _data->removeRef();
112}
113
114void KIPI::ImageInfo::setTitle( const QString& name )
115{
116 _data->setTitle( name );
117}
118
119void KIPI::ImageInfo::setDescription( const QString& description )
120{
121 _data->setDescription( description );
122}
123
125{
126 _data->clearAttributes();
127}
128
129void KIPI::ImageInfo::addAttributes( const QMap<QString,QVariant>& attributes )
130{
131 _data->addAttributes( attributes );
132}
133
141{
142 return _data->angle();
143}
144
149{
150 _data->setAngle( angle );
151}
152
159{
160 return _data->isTimeExact();
161}
162
163void KIPI::ImageInfo::setTime( const QDateTime& time, TimeSpec spec )
164{
165 _data->setTime( time, spec );
166}
167
172{
173 _data->cloneData( other._data );
174}
KDStream & flush(KDStream &stream)
Definition KDStream.cpp:274
Streaming operators for Qt classes.
Definition KDStream.h:87
Definition imageinfoshared.h:50
Definition imageinfo.h:55
ImageInfo(ImageInfoShared *)
Definition imageinfo.cpp:98
int size() const
Definition imageinfo.cpp:93
void setAngle(int)
Definition imageinfo.cpp:148
QDateTime time(TimeSpec spec=FromInfo) const
Definition imageinfo.cpp:72
KURL path() const
Definition imageinfo.cpp:54
~ImageInfo()
Definition imageinfo.cpp:109
int angle() const
Definition imageinfo.cpp:140
bool isTimeExact() const
Definition imageinfo.cpp:158
void setTitle(const QString &name)
Definition imageinfo.cpp:114
void setTime(const QDateTime &time, TimeSpec spec=FromInfo)
Definition imageinfo.cpp:163
QString title() const
Definition imageinfo.cpp:46
void clearAttributes()
Definition imageinfo.cpp:124
QString description() const
Definition imageinfo.cpp:62
QMap< QString, QVariant > attributes() const
Definition imageinfo.cpp:85
void cloneData(const ImageInfo &other)
Definition imageinfo.cpp:171
QString toString(const QVariant &) const
Definition imageinfo.cpp:34
void setDescription(const QString &description)
Definition imageinfo.cpp:119
void addAttributes(const QMap< QString, QVariant > &)
Definition imageinfo.cpp:129
TimeSpec
Definition imageinfo.h:49