KContacts

picture.h
1 /*
2  This file is part of the KContacts framework.
3  SPDX-FileCopyrightText: 2002 Tobias Koenig <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef KCONTACTS_PICTURE_H
9 #define KCONTACTS_PICTURE_H
10 
11 #include "kcontacts_export.h"
12 
13 #include <QDataStream>
14 #include <QString>
15 #include <QSharedDataPointer>
16 
17 class QImage;
18 
19 namespace KContacts {
20 class PicturePrivate;
21 
26 class KCONTACTS_EXPORT Picture
27 {
28  friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Picture &);
29  friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Picture &);
30 
31 public:
35  Picture();
36 
42  Picture(const QString &url);
43 
49  Picture(const QImage &data);
50 
58  Picture(const Picture &picture);
59 
63  ~Picture();
64 
65  typedef QVector<Picture> List;
73  Picture &operator=(const Picture &other);
74 
78  Q_REQUIRED_RESULT bool operator==(const Picture &other) const;
79 
83  Q_REQUIRED_RESULT bool operator!=(const Picture &other) const;
84 
88  Q_REQUIRED_RESULT bool isEmpty() const;
89 
98  void setUrl(const QString &url);
99 
109  void setUrl(const QString &url, const QString &type);
110 
119  void setData(const QImage &data);
120 
129  void setRawData(const QByteArray &rawData, const QString &type);
130 
138  Q_REQUIRED_RESULT bool isIntern() const;
139 
143  Q_REQUIRED_RESULT QString url() const;
144 
148  Q_REQUIRED_RESULT QImage data() const;
149 
155  Q_REQUIRED_RESULT QByteArray rawData() const;
156 
160  Q_REQUIRED_RESULT QString type() const;
161 
165  Q_REQUIRED_RESULT QString toString() const;
166 
167 private:
169 };
170 
174 KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const Picture &picture);
175 
179 KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, Picture &picture);
180 }
181 Q_DECLARE_TYPEINFO(KContacts::Picture, Q_MOVABLE_TYPE);
182 #endif
QDataStream & operator>>(QDataStream &in, KDateTime::Spec &spec)
A class to store a picture of an addressee.
Definition: picture.h:26
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jul 9 2020 22:54:11 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.