lib

KoPictureShared Class Reference

List of all members.

Detailed Description

Definition at line 44 of file KoPictureShared.h.


Public Member Functions

 KoPictureShared (void)
 ~KoPictureShared (void)
 KoPictureShared (const KoPictureShared &other)
KoPictureSharedoperator= (const KoPictureShared &other)
KoPictureType::Type getType (void) const
bool isNull (void) const
void draw (QPainter &painter, int x, int y, int width, int height, int sx=0, int sy=0, int sw=-1, int sh=-1, bool fastMode=false)
QDragObject * dragObject (QWidget *dragSource=0L, const char *name=0L)
bool load (QIODevice *io, const QString &extension)
bool loadFromBase64 (const QCString &str)
bool save (QIODevice *io) const
bool saveAsBase64 (KoXmlWriter &writer) const
void setExtension (const QString &extension)
QString getExtension (void) const
QSize getOriginalSize (void) const
void clearAndSetMode (const QString &newMode)
void clear (void)
bool loadFromFile (const QString &fileName)
bool loadXpm (QIODevice *io)
QPixmap generatePixmap (const QSize &size, bool smoothScale=false)
QString getMimeType (void) const
QImage generateImage (const QSize &size)
bool hasAlphaBuffer () const
void setAlphaBuffer (bool enable)
QImage createAlphaMask (int conversion_flags=0) const
void clearCache (void)
QString uniquePictureId () const
void assignPictureId (uint _id)

Protected Member Functions

bool loadWmf (QIODevice *io)
bool loadTmp (QIODevice *io)
bool identifyAndLoad (QByteArray data)
bool loadCompressed (QIODevice *io, const QString &mimeType, const QString &extension)

Protected Attributes

KoPictureBasem_base
QString m_extension
uint m_pictureId

Constructor & Destructor Documentation

KoPictureShared::KoPictureShared ( void   ) 

Default constructor.

Definition at line 39 of file KoPictureShared.cpp.

KoPictureShared::~KoPictureShared ( void   ) 

Destructor.

Definition at line 53 of file KoPictureShared.cpp.

KoPictureShared::KoPictureShared ( const KoPictureShared other  ) 

Copy constructor.

This makes a deep copy. Do not use if you want to share!

Definition at line 58 of file KoPictureShared.cpp.


Member Function Documentation

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

Assignment operator.

This makes a deep copy. Do not use if you want to share!

Definition at line 68 of file KoPictureShared.cpp.

bool KoPictureShared::isNull ( void   )  const

Returns true if the picture is null.

Definition at line 85 of file KoPictureShared.cpp.

void KoPictureShared::draw ( QPainter &  painter,
int  x,
int  y,
int  width,
int  height,
int  sx = 0,
int  sy = 0,
int  sw = -1,
int  sh = -1,
bool  fastMode = false 
)

Draw the image in a painter.

The parameter fastMode allows the picture to be re-sized and drawn quicker if possible

The parameters width, height define the desired size for the picture

The other parameters are very similar to QPainter::drawPixmap : (x, y) define the position in the painter, (sx, sy) specify the top-left point in pixmap that is to be drawn. The default is (0, 0). (sw, sh) specify the size of the pixmap that is to be drawn. The default, (-1, -1), means all the way to the bottom right of the pixmap.

Definition at line 92 of file KoPictureShared.cpp.

QDragObject * KoPictureShared::dragObject ( QWidget *  dragSource = 0L,
const char *  name = 0L 
)

Create a dragobject containing this picture.

Parameters:
dragSource must be 0 when copying to the clipboard
Returns:
0L if the picture is null!

Definition at line 470 of file KoPictureShared.cpp.

bool KoPictureShared::save ( QIODevice *  io  )  const

Save picture into a QIODevice.

Parameters:
io QIODevice used for saving

Definition at line 317 of file KoPictureShared.cpp.

bool KoPictureShared::saveAsBase64 ( KoXmlWriter writer  )  const

OASIS FlatXML support: Save picture as base64-encoded data into an XML writer.

Definition at line 326 of file KoPictureShared.cpp.

void KoPictureShared::clearAndSetMode ( const QString &  newMode  ) 

Clear and set the mode of this KoPictureShared.

Parameters:
newMode file extension (like "png") giving the wanted mode

Definition at line 340 of file KoPictureShared.cpp.

void KoPictureShared::clear ( void   ) 

Reset the KoPictureShared (but not the key!).

Definition at line 333 of file KoPictureShared.cpp.

bool KoPictureShared::loadFromFile ( const QString &  fileName  ) 

Load a file.

Parameters:
fileName the name of the file to load

Definition at line 426 of file KoPictureShared.cpp.

bool KoPictureShared::loadXpm ( QIODevice *  io  ) 

Load a potentially broken XPM file (for KPresenter).

Definition at line 282 of file KoPictureShared.cpp.

QPixmap KoPictureShared::generatePixmap ( const QSize &  size,
bool  smoothScale = false 
)

Deprecated:
Returns a QPixmap from an image
Parameters:
size the wanted size for the QPixmap

Definition at line 463 of file KoPictureShared.cpp.

QImage KoPictureShared::generateImage ( const QSize &  size  ) 

Generate a QImage.

(always in slow mode)

Parameters:
size the wanted size for the QImage

Definition at line 477 of file KoPictureShared.cpp.

void KoPictureShared::clearCache ( void   ) 

Clear any cache.

It is used to avoid using too much memory especially if the application somehow caches the KoPicture too.

Definition at line 504 of file KoPictureShared.cpp.

bool KoPictureShared::identifyAndLoad ( QByteArray  data  )  [protected]

Find type of image, create base accordingly, and load data.

Definition at line 154 of file KoPictureShared.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys