kopete/libkopete
#include <kopetepicture.h>
Public Member Functions | |
Picture () | |
Picture (const QString &path) | |
Picture (const QImage &image) | |
Picture (const KABC::Picture &picture) | |
Picture (const Picture &other) | |
~Picture () | |
QString | base64 () |
void | clear () |
QImage | image () |
bool | isNull () |
Picture & | operator= (const Picture &other) |
QString | path () |
void | setPicture (const QImage &image) |
void | setPicture (const QString &path) |
void | setPicture (const KABC::Picture &picture) |
Detailed Description
Represent a picture in Kopete context.
It kept a cache of a QImage object, a base64 string and a path to a image file. It ensure that all source are synced. Interally, the image is stored in PNG format when possible. It can happen that the image path do not return a PNG file.
You can only use an QImage and a image path to create/update the picture. If the picture doesn't exist as a file, it generate a local copy into ~/.kde/share/apps/kopete/metacontactpicturecache
This class is implicitly shared, so don't use it as a pointer.
How to use this class:
Definition at line 61 of file kopetepicture.h.
Constructor & Destructor Documentation
Kopete::Picture::Picture | ( | ) |
Create a empty Kopete::Picture.
Definition at line 42 of file kopetepicture.cpp.
|
explicit |
Create a picture from a local path.
Definition at line 47 of file kopetepicture.cpp.
|
explicit |
Create a picture from a QImage.
Definition at line 53 of file kopetepicture.cpp.
|
explicit |
Create a picture from a KABC::Picture.
Definition at line 59 of file kopetepicture.cpp.
Kopete::Picture::Picture | ( | const Picture & | other | ) |
Copy a picture.
It doesn't create a full copy, it just make a reference.
Definition at line 65 of file kopetepicture.cpp.
Kopete::Picture::~Picture | ( | ) |
Delete the Kopete::Picture.
Definition at line 69 of file kopetepicture.cpp.
Member Function Documentation
QString Kopete::Picture::base64 | ( | ) |
Return the current picture as a base64 string.
The base64 is used to include the picture into a XML/XHTML context.
Definition at line 90 of file kopetepicture.cpp.
void Kopete::Picture::clear | ( | ) |
Reset the picture.
Definition at line 146 of file kopetepicture.cpp.
QImage Kopete::Picture::image | ( | ) |
Return the current picture as QImage.
QImage can used to draw the image on a context.
- Returns
- the QImage cache of current picture.
Definition at line 78 of file kopetepicture.cpp.
bool Kopete::Picture::isNull | ( | ) |
Check if the picture is null.
Definition at line 134 of file kopetepicture.cpp.
Assignment operator.
Like the copy constructor, it just make a reference.
Definition at line 72 of file kopetepicture.cpp.
QString Kopete::Picture::path | ( | ) |
Return the local path of the current picture.
Definition at line 108 of file kopetepicture.cpp.
void Kopete::Picture::setPicture | ( | const QImage & | image | ) |
Set the picture content.
- Parameters
-
image the picture as a QImage.
Definition at line 154 of file kopetepicture.cpp.
void Kopete::Picture::setPicture | ( | const QString & | path | ) |
Set the picture content.
- Parameters
-
path the path to the picture.
Definition at line 165 of file kopetepicture.cpp.
void Kopete::Picture::setPicture | ( | const KABC::Picture & | picture | ) |
Set the picture content.
Definition at line 175 of file kopetepicture.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.