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

kopete/libkopete

  • Kopete
  • Picture
Public Member Functions | List of all members
Kopete::Picture Class Reference

#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:

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 larou.nosp@m.che@.nosp@m.kde.o.nosp@m.rg

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.

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 QImage &  image)

Set the picture content.

Parameters
imagethe picture as a QImage.

Definition at line 154 of file kopetepicture.cpp.

void Kopete::Picture::setPicture ( const QString &  path)

Set the picture content.

Parameters
paththe path to the picture.

Definition at line 165 of file kopetepicture.cpp.

void Kopete::Picture::setPicture ( const KABC::Picture &  picture)

Set the picture content.

Parameters
picturea KABC Picture.

Definition at line 175 of file kopetepicture.cpp.


The documentation for this class was generated from the following files:
  • kopetepicture.h
  • kopetepicture.cpp
This file is part of the KDE documentation.
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.

kopete/libkopete

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

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal