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

KBlog Client Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kblog
blogmedia.cpp
1 /*
2  This file is part of the kblog library.
3 
4  Copyright (c) 2006-2007 Christian Weilbach <christian_weilbach@web.de>
5  Copyright (c) 2007 Mike McQuaid <mike@mikemcquaid.com>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #include "blogmedia.h"
24 
25 #include <QByteArray>
26 #include <QString>
27 #include <kurl.h>
28 
29 namespace KBlog {
30 
31 class BlogMediaPrivate
32 {
33  public:
34  BlogMedia *q_ptr;
35  QString mName;
36  KUrl mUrl;
37  QString mMimetype;
38  QString mError;
39  QByteArray mData;
40  BlogMedia::Status mStatus;
41 };
42 
43 BlogMedia::BlogMedia(): d_ptr( new BlogMediaPrivate )
44 {
45  d_ptr->q_ptr=this;
46 }
47 
48 BlogMedia::BlogMedia( const BlogMedia &m )
49  : d_ptr( new BlogMediaPrivate )
50 {
51  d_ptr->q_ptr = this;
52  d_ptr->mName = m.name();
53  d_ptr->mUrl = m.url();
54  d_ptr->mMimetype = m.mimetype();
55  d_ptr->mData = m.data();
56  d_ptr->mStatus = m.status();
57  d_ptr->mError = m.error();
58 }
59 
60 BlogMedia::~BlogMedia()
61 {
62  delete d_ptr;
63 }
64 
65 QString BlogMedia::name() const
66 {
67  return d_ptr->mName;
68 }
69 
70 void BlogMedia::setName( const QString &name )
71 {
72  d_ptr->mName = name;
73 }
74 
75 KUrl BlogMedia::url() const
76 {
77  return d_ptr->mUrl;
78 }
79 
80 void BlogMedia::setUrl( const KUrl &url )
81 {
82  d_ptr->mUrl = url;
83 }
84 
85 QString BlogMedia::mimetype() const
86 {
87  return d_ptr->mMimetype;
88 }
89 
90 void BlogMedia::setMimetype( const QString &mimetype )
91 {
92  d_ptr->mMimetype = mimetype;
93 }
94 
95 QByteArray BlogMedia::data() const
96 {
97  return d_ptr->mData;
98 }
99 
100 void BlogMedia::setData( const QByteArray &data )
101 {
102  d_ptr->mData = data;
103 }
104 
105 BlogMedia::Status BlogMedia::status() const
106 {
107  return d_ptr->mStatus;
108 }
109 
110 void BlogMedia::setStatus( BlogMedia::Status status )
111 {
112  d_ptr->mStatus = status;
113 }
114 
115 QString BlogMedia::error() const
116 {
117  return d_ptr->mError;
118 }
119 
120 void BlogMedia::setError( const QString &error )
121 {
122  d_ptr->mError = error;
123 }
124 
125 BlogMedia &BlogMedia::operator=( const BlogMedia &m )
126 {
127  BlogMedia copy( m );
128  swap( copy );
129  return *this;
130 }
131 
132 } //namespace KBlog
KBlog::BlogMedia
A class that represents a media object on the server.
Definition: blogmedia.h:48
KBlog::BlogMedia::setStatus
void setStatus(Status status)
Set the status.
Definition: blogmedia.cpp:110
KBlog::BlogMedia::error
QString error() const
Returns the error string.
Definition: blogmedia.cpp:115
KBlog::BlogMedia::Status
Status
The different possible status.
Definition: blogmedia.h:138
KBlog::BlogMedia::mimetype
QString mimetype() const
Returns the mimetype.
Definition: blogmedia.cpp:85
KBlog::BlogMedia::setError
void setError(const QString &error)
Set the error of the object.
Definition: blogmedia.cpp:120
KBlog::BlogMedia::setUrl
void setUrl(const KUrl &url)
Sets the url of the server side object.
Definition: blogmedia.cpp:80
KBlog::BlogMedia::setData
void setData(const QByteArray &data)
Set the data of the file.
Definition: blogmedia.cpp:100
KBlog::BlogMedia::url
KUrl url() const
Returns the server side url.
Definition: blogmedia.cpp:75
KBlog::BlogMedia::setName
void setName(const QString &name)
Sets the name.
Definition: blogmedia.cpp:70
KBlog::BlogMedia::BlogMedia
BlogMedia()
Default constructor.
Definition: blogmedia.cpp:43
KBlog::BlogMedia::name
QString name() const
Returns the wished name.
Definition: blogmedia.cpp:65
KBlog::BlogMedia::~BlogMedia
virtual ~BlogMedia()
Virtual default destructor.
Definition: blogmedia.cpp:60
KBlog::BlogMedia::operator=
BlogMedia & operator=(const BlogMedia &media)
Overloaded for QList handling.
Definition: blogmedia.cpp:125
KBlog::BlogMedia::status
Status status() const
Returns the status.
Definition: blogmedia.cpp:105
KBlog::BlogMedia::setMimetype
void setMimetype(const QString &mimetype)
Set the mimtype.
Definition: blogmedia.cpp:90
KBlog::BlogMedia::data
QByteArray data() const
Returns the data of the file.
Definition: blogmedia.cpp:95
KBlog::BlogMedia::swap
void swap(BlogMedia &other)
The swap operator.
Definition: blogmedia.h:188
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:55 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KBlog Client Library

Skip menu "KBlog Client Library"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

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