KBlog::BlogMedia Class Reference

A class that represents a media object on the server. More...

#include <blogmedia.h>

List of all members.

Public Types

enum  Status { New, Created, Error }

Public Member Functions

 BlogMedia (const BlogMedia &media)
 BlogMedia ()
virtual ~BlogMedia ()
QByteArray data () const
QString error () const
QString mimetype () const
QString name () const
BlogMediaoperator= (const BlogMedia &media)
void setData (const QByteArray &data)
void setError (const QString &error)
void setMimetype (const QString &mimetype)
void setName (const QString &name)
void setStatus (Status status)
void setUrl (const KUrl &url)
Status status () const
void swap (BlogMedia &other)
KUrl url () const

Detailed Description

A class that represents a media object on the server.

  KBlog::BlogMedia *media = new BlogMedia();
  post->setMimetype( "some_mimetype" );
  post->setData( some_qbytestream );
Author:
Christian Weilbach <christian_weilbach@web.de>

Definition at line 48 of file blogmedia.h.


Member Enumeration Documentation

The different possible status.

At the moment you cannot do much with media objects.

Enumerator:
New 

Status of freshly constructed media object on the client side.

Created 

Status of a media object successfully created on the server.

Error 

Status when an error on uploading has occurred.

Definition at line 138 of file blogmedia.h.


Constructor & Destructor Documentation

KBlog::BlogMedia::BlogMedia (  )  [explicit]

Default constructor.

Creates an empty BlogMedia object.

Definition at line 43 of file blogmedia.cpp.

KBlog::BlogMedia::BlogMedia ( const BlogMedia media  ) 

Copy Constructor needed for list handling.

Definition at line 48 of file blogmedia.cpp.

KBlog::BlogMedia::~BlogMedia (  )  [virtual]

Virtual default destructor.

Definition at line 60 of file blogmedia.cpp.


Member Function Documentation

QByteArray KBlog::BlogMedia::data (  )  const

Returns the data of the file.

Returns:
The data.
See also:
setData( const QByteArray& )

Definition at line 95 of file blogmedia.cpp.

QString KBlog::BlogMedia::error (  )  const

Returns the error string.

Returns:
The error string.
See also:
setError( const QString& )

Definition at line 115 of file blogmedia.cpp.

QString KBlog::BlogMedia::mimetype (  )  const

Returns the mimetype.

Returns:
The mimetype of the object
See also:
setMimetype( const QString& )

Definition at line 85 of file blogmedia.cpp.

QString KBlog::BlogMedia::name (  )  const

Returns the wished name.

This is most likely the filename on the server side (at least with wordpress).

Returns:
The wished name on the server.
See also:
setName( const QString& )

Definition at line 65 of file blogmedia.cpp.

BlogMedia & KBlog::BlogMedia::operator= ( const BlogMedia media  ) 

Overloaded for QList handling.

Parameters:
media The media file to copy.

Definition at line 125 of file blogmedia.cpp.

void KBlog::BlogMedia::setData ( const QByteArray &  data  ) 

Set the data of the file.

Parameters:
data This is the data stream.
See also:
data()

Definition at line 100 of file blogmedia.cpp.

void KBlog::BlogMedia::setError ( const QString &  error  ) 

Set the error of the object.

Parameters:
error This is the error string.
See also:
error()

Definition at line 120 of file blogmedia.cpp.

void KBlog::BlogMedia::setMimetype ( const QString &  mimetype  ) 

Set the mimtype.

Parameters:
mimetype This is the mimetype.
See also:
mimetype()

Definition at line 90 of file blogmedia.cpp.

void KBlog::BlogMedia::setName ( const QString &  name  ) 

Sets the name.

This will most likely be the filename on the server side (at least with wordpress).

Parameters:
name The whished name for the object.
See also:
name()

Definition at line 70 of file blogmedia.cpp.

void KBlog::BlogMedia::setStatus ( BlogMedia::Status  status  ) 

Set the status.

Note: You should *not* set this on your own it is used mostly internally.

Parameters:
status This is the status.
See also:
status()

Definition at line 110 of file blogmedia.cpp.

void KBlog::BlogMedia::setUrl ( const KUrl &  url  ) 

Sets the url of the server side object.

Note: You should *not* set this on your own normally. It is used internally in MetaWeblog.

Parameters:
url The whished name for the object.
See also:
url()

Definition at line 80 of file blogmedia.cpp.

BlogMedia::Status KBlog::BlogMedia::status (  )  const

Returns the status.

Returns:
This is the status.
See also:
setStatus( Status )

Definition at line 105 of file blogmedia.cpp.

void KBlog::BlogMedia::swap ( BlogMedia other  )  [inline]

The swap operator.

Definition at line 188 of file blogmedia.h.

KUrl KBlog::BlogMedia::url (  )  const

Returns the server side url.

Returns:
The url on the server.
See also:
setUrl( const KUrl& )

Definition at line 75 of file blogmedia.cpp.


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