kabc
KABC::Picture Class Reference
#include <picture.h>
Detailed Description
A class to store a picture of an addressee.It can store the data directly or an url reference to a picture.
Definition at line 37 of file picture.h.
Public Member Functions | |
QImage | data () const |
bool | isEmpty () const |
bool | isIntern () const |
bool | operator!= (const Picture &) const |
Picture & | operator= (const Picture &other) |
bool | operator== (const Picture &) const |
Picture (const Picture &picture) | |
Picture (const QImage &data) | |
Picture (const QString &url) | |
Picture () | |
void | setData (const QImage &data) |
void | setType (const QString &type) |
void | setUrl (const QString &url) |
QString | toString () const |
QString | type () const |
QString | url () const |
~Picture () | |
Friends | |
QDataStream & | operator<< (QDataStream &, const Picture &) |
QDataStream & | operator>> (QDataStream &, Picture &) |
Constructor & Destructor Documentation
Picture::Picture | ( | ) |
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 57 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 63 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 70 of file picture.cpp.
Picture::~Picture | ( | ) |
Member Function Documentation
QImage Picture::data | ( | ) | const |
bool Picture::isEmpty | ( | ) | const |
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 136 of file picture.cpp.
bool Picture::operator!= | ( | const Picture & | p | ) | const |
Assignment operator.
Fast operation, Picture's data is implicitly shared.
- Parameters:
-
other The Picture instance to assign to this
Definition at line 79 of file picture.cpp.
bool Picture::operator== | ( | const Picture & | p | ) | const |
void Picture::setData | ( | const QImage & | data | ) |
Sets the raw data of the picture.
When using this function, isIntern() will return 'true' until you use setUrl().
- Parameters:
-
data The raw data of the picture.
Definition at line 125 of file picture.cpp.
void Picture::setType | ( | const QString & | type | ) |
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().
- Parameters:
-
url The location URL of the picture file.
Definition at line 119 of file picture.cpp.
QString Picture::toString | ( | ) | const |
QString Picture::type | ( | ) | const |
QString Picture::url | ( | ) | const |
Friends And Related Function Documentation
QDataStream& operator<< | ( | QDataStream & | , | |
const Picture & | ||||
) | [friend] |
QDataStream& operator>> | ( | QDataStream & | , | |
Picture & | ||||
) | [friend] |
The documentation for this class was generated from the following files: