• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

kopete/libkopete

Kopete::Picture

Kopete::Picture Class Reference

#include <kopetepicture.h>

List of all members.


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:

 Kopete::Picture picture;
 picture.setPicture(QImage());
 picture.setPicture(QString("/tmp/image.png"));
 
 QString base64 = picture.base64();
 QString path = picture.path();
 QImage image = picture.image();

Author:
Michaƫl Larouche <larouche@kde.org>

Definition at line 61 of file kopetepicture.h.


Public Member Functions

QString base64 ()
void clear ()
QImage image ()
bool isNull ()
Picture & operator= (const Picture &other)
QString path ()
 Picture (const Picture &other)
 Picture (const KABC::Picture &picture)
 Picture (const QImage &image)
 Picture (const QString &path)
 Picture ()
void setPicture (const KABC::Picture &picture)
void setPicture (const QString &path)
void setPicture (const QImage &image)
 ~Picture ()

Constructor & Destructor Documentation

Kopete::Picture::Picture (  ) 

Create a empty Kopete::Picture.

Definition at line 42 of file kopetepicture.cpp.

Kopete::Picture::Picture ( const QString &  path  )  [explicit]

Create a picture from a local path.

Definition at line 47 of file kopetepicture.cpp.

Kopete::Picture::Picture ( const QImage &  image  )  [explicit]

Create a picture from a QImage.

Definition at line 53 of file kopetepicture.cpp.

Kopete::Picture::Picture ( const KABC::Picture &  picture  )  [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.

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

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 KABC::Picture &  picture  ) 

Set the picture content.

Parameters:
picture a KABC Picture.

Definition at line 175 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 QImage &  image  ) 

Set the picture content.

Parameters:
image the picture as a QImage.

Definition at line 154 of file kopetepicture.cpp.


The documentation for this class was generated from the following files:
  • kopetepicture.h
  • kopetepicture.cpp

kopete/libkopete

Skip menu "kopete/libkopete"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal