KContacts::Picture

Search for usage in LXR

KContacts::Picture Class Reference

#include <picture.h>

Public Types

typedef QList< PictureList
 

Properties

QImage data
 
bool isEmpty
 
bool isIntern
 
QString url
 

Public Member Functions

 Picture ()
 
 Picture (const Picture &picture)
 
 Picture (const QImage &data)
 
 Picture (const QString &url)
 
 ~Picture ()
 
QImage data () const
 
bool isEmpty () const
 
bool isIntern () const
 
bool operator!= (const Picture &other) const
 
Pictureoperator= (const Picture &other)
 
bool operator== (const Picture &other) const
 
QByteArray rawData () const
 
void setData (const QImage &data)
 
void setRawData (const QByteArray &rawData, 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
 

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 26 of file picture.h.

Member Typedef Documentation

◆ List

Definition at line 71 of file picture.h.

Property Documentation

◆ data

QImage KContacts::Picture::data
readwrite

Definition at line 32 of file picture.h.

◆ isEmpty

bool KContacts::Picture::isEmpty
read

Definition at line 35 of file picture.h.

◆ isIntern

bool KContacts::Picture::isIntern
read

Definition at line 34 of file picture.h.

◆ url

QString KContacts::Picture::url
readwrite

Definition at line 33 of file picture.h.

Constructor & Destructor Documentation

◆ Picture() [1/4]

Picture::Picture ( )

Creates an empty picture.

Definition at line 46 of file picture.cpp.

◆ Picture() [2/4]

Picture::Picture ( const QString & url)

Creates a picture which points to the given url.

Parameters
urlA URL that describes the location of the picture file.

Definition at line 51 of file picture.cpp.

◆ Picture() [3/4]

Picture::Picture ( const QImage & data)

Creates a picture with the given data.

Parameters
dataThe raw data of the picture.

Definition at line 57 of file picture.cpp.

◆ Picture() [4/4]

Picture::Picture ( const Picture & picture)

Copy constructor.

Fast operation, Picture's data is implicitly shared.

Parameters
pictureThe Picture instance to copy from

Definition at line 63 of file picture.cpp.

◆ ~Picture()

Picture::~Picture ( )

Destructor.

Definition at line 68 of file picture.cpp.

Member Function Documentation

◆ data()

QImage Picture::data ( ) const

Returns the image data of this picture.

Definition at line 175 of file picture.cpp.

◆ isEmpty()

bool Picture::isEmpty ( ) const

Returns true, if the picture is empty.

Definition at line 123 of file picture.cpp.

◆ isIntern()

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 165 of file picture.cpp.

◆ operator!=()

bool Picture::operator!= ( const Picture & other) const

Not-Equal operator.

Definition at line 118 of file picture.cpp.

◆ operator=()

Picture & Picture::operator= ( const Picture & other)

Assignment operator.

Fast operation, Picture's data is implicitly shared.

Parameters
otherThe Picture instance to assign to this

Definition at line 72 of file picture.cpp.

◆ operator==()

bool Picture::operator== ( const Picture & other) const

Equality operator.

Definition at line 81 of file picture.cpp.

◆ rawData()

QByteArray Picture::rawData ( ) const

Returns the raw data of this picture.

Since
4.10

Definition at line 184 of file picture.cpp.

◆ setData()

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
dataThe image data of the picture.

Definition at line 143 of file picture.cpp.

◆ setRawData()

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
rawDataThe raw data of the picture.
typeThe encoding format of the image, e.g. jpeg or png
Since
4.10

Definition at line 157 of file picture.cpp.

◆ setUrl() [1/2]

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
urlThe location URL of the picture file.

Definition at line 129 of file picture.cpp.

◆ setUrl() [2/2]

void Picture::setUrl ( const QString & url,
const QString & type )

Sets a URL for the location of the picture file.

When using this function, isIntern() will return 'false' until you use setData().

Parameters
urlThe location URL of the picture file.
typeThe encoding format of the image, e.g. jpeg or png
Since
4.10

Definition at line 136 of file picture.cpp.

◆ toString()

QString Picture::toString ( ) const

Returns string representation of the picture.

Definition at line 202 of file picture.cpp.

◆ type()

QString Picture::type ( ) const

Returns the type of this picture.

Definition at line 197 of file picture.cpp.

◆ url()

QString Picture::url ( ) const

Returns the location URL of this picture.

Definition at line 170 of file picture.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.