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

KBlog Client Library

  • kblog
movabletype.cpp
1 /*
2  This file is part of the kblog library.
3 
4  Copyright (c) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
5  Copyright (c) 2006-2009 Christian Weilbach <christian_weilbach@web.de>
6  Copyright (c) 2007-2008 Mike McQuaid <mike@mikemcquaid.com>
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License as published by the Free Software Foundation; either
11  version 2 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public License
19  along with this library; see the file COPYING.LIB. If not, write to
20  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  Boston, MA 02110-1301, USA.
22 */
23 
24 #include "movabletype.h"
25 #include "movabletype_p.h"
26 #include "blogpost.h"
27 
28 #include <kxmlrpcclient/client.h>
29 #include <kio/job.h>
30 
31 #include <KDebug>
32 #include <KLocalizedString>
33 #include <KDateTime>
34 
35 #include <QtCore/QStringList>
36 
37 using namespace KBlog;
38 
39 MovableType::MovableType( const KUrl &server, QObject *parent )
40  : MetaWeblog( server, *new MovableTypePrivate, parent )
41 {
42  kDebug();
43 }
44 
45 MovableType::MovableType( const KUrl &server, MovableTypePrivate &dd,
46  QObject *parent )
47  : MetaWeblog( server, dd, parent )
48 {
49  kDebug();
50 }
51 
52 MovableType::~MovableType()
53 {
54  kDebug();
55 }
56 
57 QString MovableType::interfaceName() const
58 {
59  return QLatin1String( "Movable Type" );
60 }
61 
62 void MovableType::listRecentPosts( int number )
63 {
64  Q_D( MovableType );
65  kDebug();
66  QList<QVariant> args( d->defaultArgs( blogId() ) );
67  args << QVariant( number );
68  d->mXmlRpcClient->call(
69  "metaWeblog.getRecentPosts", args,
70  this, SLOT(slotListRecentPosts(QList<QVariant>,QVariant)),
71  this, SLOT(slotError(int,QString,QVariant)),
72  QVariant( number ) );
73 }
74 
75 void MovableType::listTrackBackPings( KBlog::BlogPost *post )
76 {
77  Q_D( MovableType );
78  kDebug();
79  QList<QVariant> args;
80  args << QVariant( post->postId() );
81  unsigned int i = d->mCallCounter++;
82  d->mCallMap[ i ] = post;
83  d->mXmlRpcClient->call(
84  "mt.getTrackbackPings", args,
85  this, SLOT(slotListTrackbackPings(QList<QVariant>,QVariant)),
86  this, SLOT(slotError(int,QString,QVariant)),
87  QVariant( i ) );
88 }
89 
90 void MovableType::fetchPost( BlogPost *post )
91 {
92  Q_D( MovableType );
93  kDebug();
94  d->loadCategories();
95  if ( d->mCategoriesList.isEmpty() &&
96  post->categories( ).count() ) {
97  d->mFetchPostCache << post;
98  if ( d->mFetchPostCache.count() ) {
99  // we are already trying to fetch another post, so we don't need to start
100  // another listCategories() job
101  return;
102  }
103 
104  connect( this, SIGNAL(listedCategories(QList<QMap<QString,QString> >)),
105  this, SLOT(slotTriggerFetchPost()) );
106  listCategories();
107  } else {
108  MetaWeblog::fetchPost( post );
109  }
110 }
111 
112 void MovableType::createPost( BlogPost *post )
113 {
114  // reimplemented because we do this:
115  // http://comox.textdrive.com/pipermail/wp-testers/2005-July/000284.html
116  kDebug();
117  Q_D( MovableType );
118 
119  // we need mCategoriesList to be loaded first, since we cannot use the post->categories()
120  // names later, but we need to map them to categoryId of the blog
121  d->loadCategories();
122  if ( d->mCategoriesList.isEmpty() &&
123  !post->categories().isEmpty() ) {
124  kDebug() << "No categories in the cache yet. Have to fetch them first.";
125  d->mCreatePostCache << post;
126  connect( this, SIGNAL(listedCategories(QList<QMap<QString,QString> >)),
127  this, SLOT(slotTriggerCreatePost()) );
128  listCategories();
129  }
130  else {
131  bool publish = post->isPrivate();
132  // If we do setPostCategories() later than we disable publishing first.
133  if ( !post->categories().isEmpty() ) {
134  post->setPrivate( true );
135  if ( d->mSilentCreationList.contains( post ) ) {
136  kDebug() << "Post already in mSilentCreationList, this *should* never happen!";
137  } else {
138  d->mSilentCreationList << post;
139  }
140  }
141  MetaWeblog::createPost( post );
142  // HACK: uuh this a bit ugly now... reenable the original publish argument,
143  // since createPost should have parsed now
144  post->setPrivate( publish );
145  }
146 }
147 
148 void MovableType::modifyPost( BlogPost *post )
149 {
150  // reimplemented because we do this:
151  // http://comox.textdrive.com/pipermail/wp-testers/2005-July/000284.html
152  kDebug();
153  Q_D( MovableType );
154 
155  // we need mCategoriesList to be loaded first, since we cannot use the post->categories()
156  // names later, but we need to map them to categoryId of the blog
157  d->loadCategories();
158  if ( d->mCategoriesList.isEmpty() &&
159  !post->categories().isEmpty() ) {
160  kDebug() << "No categories in the cache yet. Have to fetch them first.";
161  d->mModifyPostCache << post;
162  connect( this, SIGNAL(listedCategories(QList<QMap<QString,QString> >)),
163  this, SLOT(slotTriggerModifyPost()) );
164  listCategories();
165  }
166  else {
167  MetaWeblog::modifyPost( post );
168  }
169 }
170 
171 void MovableTypePrivate::slotTriggerCreatePost()
172 {
173  kDebug();
174  Q_Q( MovableType );
175 
176  q->disconnect( q, SIGNAL(listedCategories(QList<QMap<QString,QString> >)),
177  q, SLOT(slotTriggerCreatePost()) );
178  // now we can recall createPost with the posts from the cache
179  QList<BlogPost*>::Iterator it = mCreatePostCache.begin();
180  QList<BlogPost*>::Iterator end = mCreatePostCache.end();
181  for ( ; it != end; it++ ) {
182  q->createPost( *it );
183  }
184  mCreatePostCache.clear();
185 }
186 
187 void MovableTypePrivate::slotTriggerModifyPost()
188 {
189  kDebug();
190  Q_Q( MovableType );
191 
192  q->disconnect( q, SIGNAL(listedCategories(QList<QMap<QString,QString> >)),
193  q, SLOT(slotTriggerModifyPost()) );
194  // now we can recall createPost with the posts from the cache
195  QList<BlogPost*>::Iterator it = mModifyPostCache.begin();
196  QList<BlogPost*>::Iterator end = mModifyPostCache.end();
197  for ( ; it != end; it++ ) {
198  q->modifyPost( *it );
199  }
200  mModifyPostCache.clear();
201 }
202 
203 void MovableTypePrivate::slotTriggerFetchPost()
204 {
205  kDebug();
206  Q_Q( MovableType );
207 
208  q->disconnect( q, SIGNAL(listedCategories(QList<QMap<QString,QString> >)),
209  q, SLOT(slotTriggerFetchPost()) );
210  QList<BlogPost*>::Iterator it = mFetchPostCache.begin();
211  QList<BlogPost*>::Iterator end = mFetchPostCache.end();
212  for ( ; it != end; it++ ) {
213  q->fetchPost( *it );
214  }
215  mFetchPostCache.clear();
216 }
217 
218 
219 MovableTypePrivate::MovableTypePrivate()
220 {
221  kDebug();
222 }
223 
224 MovableTypePrivate::~MovableTypePrivate()
225 {
226  kDebug();
227 }
228 
229 void MovableTypePrivate::slotCreatePost( const QList<QVariant> &result, const QVariant &id )
230 {
231  Q_Q( MovableType );
232  // reimplement from Blogger1 to chainload the categories stuff before emit()
233  kDebug();
234  KBlog::BlogPost *post = mCallMap[ id.toInt() ];
235  mCallMap.remove( id.toInt() );
236 
237  kDebug();
238  //array of structs containing ISO.8601
239  // dateCreated, String userid, String postid, String content;
240  kDebug () << "TOP:" << result[0].typeName();
241  if ( result[0].type() != QVariant::String &&
242  result[0].type() != QVariant::Int ) {
243  kError() << "Could not read the postId, not a string or an integer.";
244  emit q->errorPost( Blogger1::ParsingError,
245  i18n( "Could not read the postId, not a string or an integer." ),
246  post );
247  return;
248  }
249  QString serverID;
250  if ( result[0].type() == QVariant::String ) {
251  serverID = result[0].toString();
252  }
253  if ( result[0].type() == QVariant::Int ) {
254  serverID = QString( "%1" ).arg( result[0].toInt() );
255  }
256  post->setPostId( serverID );
257  if ( mSilentCreationList.contains( post ) )
258  {
259  // set the categories and publish afterwards
260  setPostCategories( post, !post->isPrivate() );
261  } else {
262  kDebug() << "emitting createdPost()"
263  << "for title: \"" << post->title()
264  << "\" server id: " << serverID;
265  post->setStatus( KBlog::BlogPost::Created );
266  emit q->createdPost( post );
267  }
268 }
269 
270 void MovableTypePrivate::slotFetchPost( const QList<QVariant> &result, const QVariant &id )
271 {
272  Q_Q( MovableType );
273  kDebug();
274 
275  KBlog::BlogPost *post = mCallMap[ id.toInt() ];
276  mCallMap.remove( id.toInt() );
277 
278  //array of structs containing ISO.8601
279  // dateCreated, String userid, String postid, String content;
280  kDebug () << "TOP:" << result[0].typeName();
281  if ( result[0].type() == QVariant::Map &&
282  readPostFromMap( post, result[0].toMap() ) ) {
283  } else {
284  kError() << "Could not fetch post out of the result from the server.";
285  post->setError( i18n( "Could not fetch post out of the result from the server." ) );
286  post->setStatus( BlogPost::Error );
287  emit q->errorPost( Blogger1::ParsingError,
288  i18n( "Could not fetch post out of the result from the server." ), post );
289  }
290  if ( post->categories().isEmpty() ) {
291  QList<QVariant> args( defaultArgs( post->postId() ) );
292  unsigned int i= mCallCounter++;
293  mCallMap[ i ] = post;
294  mXmlRpcClient->call(
295  "mt.getPostCategories", args,
296  q, SLOT(slotGetPostCategories(QList<QVariant>,QVariant)),
297  q, SLOT(slotError(int,QString,QVariant)),
298  QVariant( i ) );
299  } else {
300  kDebug() << "Emitting fetchedPost()";
301  post->setStatus( KBlog::BlogPost::Fetched );
302  emit q->fetchedPost( post );
303  }
304 }
305 
306 void MovableTypePrivate::slotModifyPost( const QList<QVariant> &result, const QVariant &id )
307 {
308  Q_Q( MovableType );
309  // reimplement from Blogger1
310  kDebug();
311  KBlog::BlogPost *post = mCallMap[ id.toInt() ];
312  mCallMap.remove( id.toInt() );
313 
314  //array of structs containing ISO.8601
315  // dateCreated, String userid, String postid, String content;
316  kDebug() << "TOP:" << result[0].typeName();
317  if ( result[0].type() != QVariant::Bool &&
318  result[0].type() != QVariant::Int ) {
319  kError() << "Could not read the result, not a boolean.";
320  emit q->errorPost( Blogger1::ParsingError,
321  i18n( "Could not read the result, not a boolean." ),
322  post );
323  return;
324  }
325  if ( mSilentCreationList.contains( post ) ) {
326  post->setStatus( KBlog::BlogPost::Created );
327  mSilentCreationList.removeOne( post );
328  emit q->createdPost( post );
329  } else {
330  if ( !post->categories().isEmpty() ) {
331  setPostCategories( post, false );
332  }
333  }
334 }
335 
336 void MovableTypePrivate::setPostCategories( BlogPost *post, bool publishAfterCategories )
337 {
338  kDebug();
339  Q_Q( MovableType );
340 
341  unsigned int i = mCallCounter++;
342  mCallMap[ i ] = post;
343  mPublishAfterCategories[ i ] = publishAfterCategories;
344  QList<QVariant> catList;
345  QList<QVariant> args( defaultArgs( post->postId() ) );
346 
347  // map the categoryId of the server to the name
348  QStringList categories = post->categories();
349  for ( int j = 0; j < categories.count(); j++ ) {
350  for ( int k = 0; k < mCategoriesList.count(); k++ ) {
351  if ( mCategoriesList[k]["name"] == categories[j] ) {
352  kDebug() << "Matched category with name: " << categories[ j ] << " and id: " << mCategoriesList[ k ][ "categoryId" ];
353  QMap<QString,QVariant> category;
354  //the first in the QStringList of post->categories()
355  // is the primary category
356  category["categoryId"] = mCategoriesList[k]["categoryId"].toInt();
357  catList << QVariant( category );
358  break;
359  }
360  if ( k == mCategoriesList.count() ) {
361  kDebug() << "Couldn't find categoryId for: " << categories[j];
362  }
363  }
364  }
365  args << QVariant( catList );
366 
367  mXmlRpcClient->call(
368  "mt.setPostCategories", args,
369  q, SLOT(slotSetPostCategories(QList<QVariant>,QVariant)),
370  q, SLOT(slotError(int,QString,QVariant)),
371  QVariant( i ) );
372 }
373 
374 void MovableTypePrivate::slotGetPostCategories(const QList<QVariant>& result,const QVariant& id)
375 {
376  kDebug();
377  Q_Q( MovableType );
378 
379  int i = id.toInt();
380  BlogPost* post = mCallMap[ i ];
381  mCallMap.remove( i );
382 
383  if ( result[ 0 ].type() != QVariant::List ) {
384  kError() << "Could not read the result, not a list. Category fetching failed! We will still emit fetched post now.";
385  emit q->errorPost( Blogger1::ParsingError,
386  i18n( "Could not read the result - is not a list. Category fetching failed." ), post );
387 
388  post->setStatus( KBlog::BlogPost::Fetched );
389  emit q->fetchedPost( post );
390  } else {
391  QList<QVariant> categoryList = result[ 0 ].toList();
392  QList<QString> newCatList;
393  QList<QVariant>::ConstIterator it = categoryList.constBegin();
394  QList<QVariant>::ConstIterator end = categoryList.constEnd();
395  for ( ; it != end; it++ ) {
396  newCatList << ( *it ).toMap()[ "categoryName" ].toString();
397  }
398  kDebug() << "categories list: " << newCatList;
399  post->setCategories( newCatList );
400  post->setStatus( KBlog::BlogPost::Fetched );
401  emit q->fetchedPost( post );
402  }
403 }
404 
405 void MovableTypePrivate::slotSetPostCategories(const QList<QVariant>& result,const QVariant& id)
406 {
407  kDebug();
408  Q_Q( MovableType );
409 
410  int i = id.toInt();
411  BlogPost* post = mCallMap[ i ];
412  bool publish = mPublishAfterCategories[ i ];
413  mCallMap.remove( i );
414  mPublishAfterCategories.remove( i );
415 
416  if ( result[0].type() != QVariant::Bool ) {
417  kError() << "Could not read the result, not a boolean. Category setting failed! We will still publish if now if necessary. ";
418  emit q->errorPost( Blogger1::ParsingError,
419  i18n( "Could not read the result - is not a boolean value. Category setting failed. Will still publish now if necessary." ),
420  post );
421  }
422  // Finally publish now, if the post was meant to be published in the beginning.
423  // The first boolean is necessary to only publish if the post is created, not
424  // modified.
425  if ( publish && !post->isPrivate() ) {
426  q->modifyPost( post );
427  }
428 
429  // this is the end of the chain then
430  if ( !publish ) {
431  if ( mSilentCreationList.contains( post ) ) {
432  kDebug() << "emitting createdPost() for title: \""
433  << post->title() << "\"";
434  post->setStatus( KBlog::BlogPost::Created );
435  mSilentCreationList.removeOne( post );
436  emit q->createdPost( post );
437  } else {
438  kDebug() << "emitting modifiedPost() for title: \""
439  << post->title() << "\"";
440  post->setStatus( KBlog::BlogPost::Modified );
441  emit q->modifiedPost( post );
442  }
443  }
444 }
445 
446 QList<QVariant> MovableTypePrivate::defaultArgs( const QString &id )
447 {
448  Q_Q( MovableType );
449  QList<QVariant> args;
450  if ( !id.isEmpty() ) {
451  args << QVariant( id );
452  }
453  args << QVariant( q->username() )
454  << QVariant( q->password() );
455  return args;
456 }
457 
458 bool MovableTypePrivate::readPostFromMap( BlogPost *post, const QMap<QString, QVariant> &postInfo )
459 {
460 
461  // FIXME: integrate error handling
462  kDebug() << "readPostFromMap()";
463  if ( !post ) {
464  return false;
465  }
466  QStringList mapkeys = postInfo.keys();
467  kDebug() << endl << "Keys:" << mapkeys.join( ", " );
468  kDebug() << endl;
469 
470  KDateTime dt =
471  KDateTime( postInfo["dateCreated"].toDateTime(), KDateTime::UTC );
472  if ( dt.isValid() && !dt.isNull() ) {
473  post->setCreationDateTime( dt.toLocalZone() );
474  }
475 
476  dt =
477  KDateTime( postInfo["lastModified"].toDateTime(), KDateTime::UTC );
478  if ( dt.isValid() && !dt.isNull() ) {
479  post->setModificationDateTime( dt.toLocalZone() );
480  }
481 
482  post->setPostId( postInfo["postid"].toString().isEmpty() ? postInfo["postId"].toString() :
483  postInfo["postid"].toString() );
484 
485  QString title( postInfo["title"].toString() );
486  QString description( postInfo["description"].toString() );
487  QStringList categoryIdList = postInfo["categories"].toStringList();
488  QStringList categories;
489  // since the metaweblog definition is ambigious, we try different
490  // category mappings
491  for ( int i = 0; i < categoryIdList.count(); i++ ) {
492  for ( int k = 0; k < mCategoriesList.count(); k++ ) {
493  if ( mCategoriesList[ k ][ "name" ] == categoryIdList[ i ] ) {
494  categories << mCategoriesList[ k ][ "name" ];
495  } else if ( mCategoriesList[ k ][ "categoryId" ] == categoryIdList[ i ]) {
496  categories << mCategoriesList[ k ][ "name" ];
497  }
498  }
499  }
500 
501  //TODO 2 new keys are:
502  // String mt_convert_breaks, the value for the convert_breaks field
503  post->setSlug( postInfo["wp_slug"].toString() );
504  post->setAdditionalContent( postInfo["mt_text_more"].toString() );
505  post->setTitle( title );
506  post->setContent( description );
507  post->setCommentAllowed( (bool)postInfo["mt_allow_comments"].toInt() );
508  post->setTrackBackAllowed( (bool)postInfo["mt_allow_pings"].toInt() );
509  post->setSummary( postInfo["mt_excerpt"].toString() );
510  post->setTags( postInfo["mt_keywords"].toStringList() );
511  post->setLink( postInfo["link"].toString() );
512  post->setPermaLink( postInfo["permaLink"].toString() );
513  QString postStatus = postInfo["post_status"].toString();
514  if ( postStatus != "publish" &&
515  !postStatus.isEmpty() ) {
521  post->setPrivate( true );
522  }
523  if ( !categories.isEmpty() ) {
524  kDebug() << "Categories:" << categories;
525  post->setCategories( categories );
526  }
527  return true;
528 }
529 
530 void MovableTypePrivate::slotListTrackBackPings(
531  const QList<QVariant> &result, const QVariant &id )
532 {
533  Q_Q( MovableType );
534  kDebug() << "slotTrackbackPings()";
535  BlogPost *post = mCallMap[ id.toInt() ];
536  mCallMap.remove( id.toInt() );
537  QList<QMap<QString,QString> > trackBackList;
538  if ( result[0].type() != QVariant::List ) {
539  kError() << "Could not fetch list of trackback pings out of the"
540  << "result from the server.";
541  emit q->error( MovableType::ParsingError,
542  i18n( "Could not fetch list of trackback pings out of the "
543  "result from the server." ) );
544  return;
545  }
546  const QList<QVariant> trackBackReceived = result[0].toList();
547  QList<QVariant>::ConstIterator it = trackBackReceived.begin();
548  QList<QVariant>::ConstIterator end = trackBackReceived.end();
549  for ( ; it != end; ++it ) {
550  QMap<QString,QString> tping;
551  kDebug() << "MIDDLE:" << ( *it ).typeName();
552  const QMap<QString, QVariant> trackBackInfo = ( *it ).toMap();
553  tping[ "title" ] = trackBackInfo[ "pingTitle"].toString();
554  tping[ "url" ] = trackBackInfo[ "pingURL"].toString();
555  tping[ "ip" ] = trackBackInfo[ "pingIP"].toString();
556  trackBackList << tping;
557  }
558  kDebug() << "Emitting listedTrackBackPings()";
559  emit q->listedTrackBackPings( post, trackBackList );
560 }
561 
562 bool MovableTypePrivate::readArgsFromPost( QList<QVariant> *args, const BlogPost &post )
563 {
564  //TODO 2 new keys are:
565  // String mt_convert_breaks, the value for the convert_breaks field
566  // array mt_tb_ping_urls, the list of TrackBack ping URLs for this entry
567  if ( !args ) {
568  return false;
569  }
570  QMap<QString, QVariant> map;
571  map["categories"] = post.categories();
572  map["description"] = post.content();
573  if ( !post.additionalContent().isEmpty() ) {
574  map["mt_text_more"] = post.additionalContent();
575  }
576  map["title"] = post.title();
577  map["dateCreated"] = post.creationDateTime().dateTime().toUTC();
578  map["mt_allow_comments"] = (int)post.isCommentAllowed();
579  map["mt_allow_pings"] = (int)post.isTrackBackAllowed();
580  map["mt_excerpt"] = post.summary();
581  map["mt_keywords"] = post.tags().join( "," );
582  //map["mt_tb_ping_urls"] check for that, i think this should only be done on the server.
583  *args << map;
584  *args << QVariant( !post.isPrivate() );
585  return true;
586 }
587 
588 #include "moc_movabletype.cpp"
KBlog::BlogPost::title
QString title() const
Returns the title.
Definition: blogpost.cpp:154
KBlog::BlogPost::creationDateTime
KDateTime creationDateTime() const
Returns the creation date time.
Definition: blogpost.cpp:308
KBlog::MetaWeblog::listCategories
virtual void listCategories()
List the categories of the blog.
Definition: metaweblog.cpp:62
KBlog::Blogger1::modifyPost
void modifyPost(KBlog::BlogPost *post)
Modify a post on server.
Definition: blogger1.cpp:127
KBlog::BlogPost::Fetched
Status of a successfully fetched post.
Definition: blogpost.h:398
KBlog::BlogPost::setLink
void setLink(const KUrl &link) const
Set the link path.
Definition: blogpost.cpp:211
KBlog::BlogPost::tags
QStringList tags() const
Returns the tags list as a QStringList.
Definition: blogpost.cpp:256
KBlog::MovableType::listTrackBackPings
virtual void listTrackBackPings(KBlog::BlogPost *post)
Get the list of trackback pings from the server.
Definition: movabletype.cpp:75
KBlog::BlogPost::Created
Status of a successfully created post.
Definition: blogpost.h:401
KBlog::MovableType::~MovableType
virtual ~MovableType()
Destroy the object.
Definition: movabletype.cpp:52
KBlog::BlogPost::isCommentAllowed
bool isCommentAllowed() const
Returns whether comments should be allowed.
Definition: blogpost.cpp:226
KBlog::BlogPost::isTrackBackAllowed
bool isTrackBackAllowed() const
Returns whether track back should be allowed.
Definition: blogpost.cpp:236
KBlog::MetaWeblog
A class that can be used for access to MetaWeblog blogs.
Definition: metaweblog.h:65
KBlog::BlogPost::summary
QString summary() const
Returns the summary.
Definition: blogpost.cpp:246
KBlog::MovableType::createPost
void createPost(KBlog::BlogPost *post)
Create a new post on server.
Definition: movabletype.cpp:112
KBlog::BlogPost::setTitle
void setTitle(const QString &title)
Sets the title.
Definition: blogpost.cpp:159
KBlog::Blog::ParsingError
A parsing error.
Definition: blog.h:103
KBlog::BlogPost::setPostId
void setPostId(const QString &postId)
Sets the post id value.
Definition: blogpost.cpp:149
KBlog::BlogPost::setCreationDateTime
void setCreationDateTime(const KDateTime &datetime)
Sets the creation time.
Definition: blogpost.cpp:313
KBlog::BlogPost::additionalContent
QString additionalContent() const
Returns the additional content, (mt_text_more of MovableType API)
Definition: blogpost.cpp:186
KBlog::BlogPost::setAdditionalContent
void setAdditionalContent(const QString &additionalContent)
Sets the additional content, (mt_text_more of MovableType API)
Definition: blogpost.cpp:191
movabletype.h
This file is part of the for accessing Blog Servers and defines the MovableType class.
KBlog::BlogPost::setContent
void setContent(const QString &content)
Sets the content.
Definition: blogpost.cpp:169
KBlog::BlogPost::error
QString error() const
Returns the last error.
Definition: blogpost.cpp:338
KBlog::BlogPost::Error
Status when an error on the server side occurred.
Definition: blogpost.h:410
KBlog::BlogPost::setModificationDateTime
void setModificationDateTime(const KDateTime &datetime)
Sets the modification time.
Definition: blogpost.cpp:323
KBlog::Blog::blogId
QString blogId() const
Returns the unique ID for the specific blog on the server.
Definition: blog.cpp:109
KBlog::BlogPost::setStatus
void setStatus(Status status)
Sets the status.
Definition: blogpost.cpp:333
KBlog::BlogPost::Modified
Status of a successfully modified post.
Definition: blogpost.h:404
KBlog::BlogPost::setTrackBackAllowed
void setTrackBackAllowed(bool allowTrackBacks)
Set whether track back should be allowed.
Definition: blogpost.cpp:241
KBlog::BlogPost::setSlug
void setSlug(const QString &slug)
Sets the Wordpress slug property! (will use to set post&#39;s permalink) Currently just wordpress support...
Definition: blogpost.cpp:201
KBlog::MovableType::interfaceName
QString interfaceName() const
Returns the of the inherited object.
Definition: movabletype.cpp:57
KBlog::MovableType
A class that can be used for access to Movable Type blogs.
Definition: movabletype.h:60
KBlog::BlogPost::setCommentAllowed
void setCommentAllowed(bool commentAllowed)
Set whether comments should be allowed.
Definition: blogpost.cpp:231
KBlog::BlogPost::setPrivate
void setPrivate(bool privatePost)
Sets the post to private viewings only.
Definition: blogpost.cpp:139
KBlog::BlogPost::content
QString content() const
Returns the content.
Definition: blogpost.cpp:164
KBlog::Blogger1::fetchPost
void fetchPost(KBlog::BlogPost *post)
Fetch a post from the server.
Definition: blogger1.cpp:108
KBlog::BlogPost::setPermaLink
void setPermaLink(const KUrl &permalink) const
Set the perma link path.
Definition: blogpost.cpp:221
KBlog::BlogPost
A class that represents a blog post on the server.
Definition: blogpost.h:68
KBlog::BlogPost::setCategories
void setCategories(const QStringList &categories)
Sets the categories.
Definition: blogpost.cpp:303
KBlog::Blogger1::createPost
void createPost(KBlog::BlogPost *post)
Create a new post on server.
Definition: blogger1.cpp:148
KBlog::BlogPost::setSummary
void setSummary(const QString &summary)
Set the summary.
Definition: blogpost.cpp:251
KBlog::BlogPost::categories
QStringList categories() const
Returns the categories.
Definition: blogpost.cpp:298
KBlog::BlogPost::setTags
void setTags(const QStringList &tags)
Set the tags list.
Definition: blogpost.cpp:261
KBlog::MovableType::listRecentPosts
void listRecentPosts(int number)
List recent posts on the server.
Definition: movabletype.cpp:62
KBlog::MovableType::fetchPost
void fetchPost(KBlog::BlogPost *post)
Fetch a post from the server.
Definition: movabletype.cpp:90
KBlog::MovableType::modifyPost
void modifyPost(KBlog::BlogPost *post)
Modify a post on server.
Definition: movabletype.cpp:148
KBlog::BlogPost::isPrivate
bool isPrivate() const
Returns if the post is published or not.
Definition: blogpost.cpp:134
KBlog::MetaWeblog::listedCategories
void listedCategories(const QList< QMap< QString, QString > > &categories)
This signal is emitted when the last category of the listCategories() job has been fetched...
KBlog::MovableType::MovableType
MovableType(const KUrl &server, QObject *parent=0)
Create an object for Movable Type.
Definition: movabletype.cpp:39
KBlog::BlogPost::postId
QString postId() const
Returns the postId.
Definition: blogpost.cpp:144
KBlog::BlogPost::setError
void setError(const QString &error)
Sets the error.
Definition: blogpost.cpp:343
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:02:01 by doxygen 1.8.5 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-4.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
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