kabc
#include <picture.h>
Public Types | |
typedef QList< Picture > | List |
Public Member Functions | |
Picture () | |
Picture (const QString &url) | |
Picture (const QImage &data) | |
Picture (const Picture &picture) | |
~Picture () | |
QImage | data () const |
bool | isEmpty () const |
bool | isIntern () const |
bool | operator!= (const Picture &) const |
Picture & | operator= (const Picture &other) |
bool | operator== (const Picture &) const |
QByteArray | rawData () const |
void | setData (const QImage &data) |
void | setRawData (const QByteArray &rawData, const QString &type) |
void KABC_DEPRECATED | setType (const QString &type) |
void | setUrl (const QString &url) |
void | setUrl (const QString &url, const QString &type) |
QString | toString () const |
QString | type () const |
QString | url () const |
Friends | |
QDataStream & | operator<< (QDataStream &, const Picture &) |
QDataStream & | operator>> (QDataStream &, Picture &) |
Detailed Description
A class to store a picture of an addressee.
It can store the data directly or an url reference to a picture.
Constructor & Destructor Documentation
Picture::Picture | ( | ) |
Creates an empty picture.
Definition at line 59 of file picture.cpp.
Picture::Picture | ( | const QString & | url | ) |
Creates a picture which points to the given url.
- Parameters
-
url A URL that describes the location of the picture file.
Definition at line 64 of file picture.cpp.
Picture::Picture | ( | const QImage & | data | ) |
Creates a picture with the given data.
- Parameters
-
data The raw data of the picture.
Definition at line 70 of file picture.cpp.
Picture::Picture | ( | const Picture & | picture | ) |
Copy constructor.
Fast operation, Picture's data is implicitly shared.
- Parameters
-
picture The Picture instance to copy from
Definition at line 76 of file picture.cpp.
Picture::~Picture | ( | ) |
Destructor.
Definition at line 81 of file picture.cpp.
Member Function Documentation
QImage Picture::data | ( | ) | const |
Returns the image data of this picture.
Definition at line 194 of file picture.cpp.
bool Picture::isEmpty | ( | ) | const |
Returns true, if the picture is empty.
Definition at line 136 of file picture.cpp.
bool Picture::isIntern | ( | ) | const |
Returns whether the picture is described by a URL (extern) or by the raw data (intern).
When this method returns 'true' you can use data() to get the raw data. Otherwise you can request the URL of this picture by url() and load the raw data from that location.
Definition at line 184 of file picture.cpp.
bool Picture::operator!= | ( | const Picture & | p | ) | const |
Not-Equal operator.
Definition at line 131 of file picture.cpp.
Assignment operator.
Fast operation, Picture's data is implicitly shared.
- Parameters
-
other The Picture instance to assign to this
Definition at line 85 of file picture.cpp.
bool Picture::operator== | ( | const Picture & | p | ) | const |
Equality operator.
Definition at line 94 of file picture.cpp.
QByteArray Picture::rawData | ( | ) | const |
void Picture::setData | ( | const QImage & | data | ) |
Sets the image data of the picture.
When using this function, isIntern() will return 'true' until you use setUrl(). This also sets type to "png" or "jpeg" depending on whether the image has an alpha channel or not.
- Parameters
-
data The image data of the picture.
Definition at line 157 of file picture.cpp.
void Picture::setRawData | ( | const QByteArray & | rawData, |
const QString & | type | ||
) |
Sets the raw data of the picture.
When using this function, isIntern() will return 'true' until you use setUrl().
- Parameters
-
rawData The raw data of the picture. type The encoding format of the image, e.g. jpeg or png
- Since
- 4.10
Definition at line 171 of file picture.cpp.
void Picture::setType | ( | const QString & | type | ) |
Sets the type of the picture.
- Parameters
-
type the picture's data type
- Deprecated:
- type should only be set along with setRawData()
Definition at line 179 of file picture.cpp.
void Picture::setUrl | ( | const QString & | url | ) |
Sets a URL for the location of the picture file.
When using this function, isIntern() will return 'false' until you use setData(). This also clears the type, as it is unknown.
- Parameters
-
url The location URL of the picture file.
Definition at line 143 of file picture.cpp.
Sets a URL for the location of the picture file.
When using this function, isIntern() will return 'false' until you use setData().
- Parameters
-
url The location URL of the picture file. type The encoding format of the image, e.g. jpeg or png
- Since
- 4.10
Definition at line 150 of file picture.cpp.
QString Picture::toString | ( | ) | const |
Returns string representation of the picture.
Definition at line 221 of file picture.cpp.
QString Picture::type | ( | ) | const |
Returns the type of this picture.
Definition at line 216 of file picture.cpp.
QString Picture::url | ( | ) | const |
Returns the location URL of this picture.
Definition at line 189 of file picture.cpp.
Friends And Related Function Documentation
|
friend |
Serializes the picture
object into the stream
.
|
friend |
Initializes the picture
object from the stream
.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.