Blokkal
an Extendable KDE Blogging Client
SourceForge.net Logo

blokkalblogmodel.h

00001 /***************************************************************************
00002  *   Copyright (C) 2007 by Martin Mueller                                  *
00003  *   orvio@orvio.de                                                        *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef BLOKKALBLOGMODEL_H
00021 #define BLOKKALBLOGMODEL_H
00022 
00023 #include "blokkaltreemodel.h"
00024 
00025 #include "blokkal_export.h"
00026 
00027 namespace Blokkal {
00028 class Blog;
00029 class Account;
00030 
00038 class BLOKKAL_EXPORT BlogModel : public Blokkal::TreeModel
00039 {
00040 Q_OBJECT
00041 public:
00046         BlogModel( QObject * parent = 0 );
00047         ~BlogModel( void );
00048 
00049 protected:
00050         TreeItemNode * findAccountNode( Blokkal::Account * account );
00051         TreeItemNode * findBlogNode( Blokkal::Blog * blog );
00052         
00053 protected Q_SLOTS:
00058         virtual void addAccount( Blokkal::Account * account );
00059 
00064         virtual void addBlog( Blokkal::Blog * blog );
00065 
00070         virtual void removeAccount( Blokkal::Account * account );
00071 
00076         virtual void removeBlog( Blokkal::Blog * blog );
00077 
00082         void emitDataChanged( Blokkal::Account * account );
00083 
00084 private:
00085         class Private;
00086         Private * const d;
00087 };
00088 
00089 namespace Io {
00090 class CategoryManager;
00091 class Category;
00092 }
00093 
00102 class BLOKKAL_EXPORT BlogCategoryModel : public Blokkal::BlogModel
00103 {
00104 Q_OBJECT
00105 public:
00110         BlogCategoryModel( QObject * parent = 0 );
00111         ~BlogCategoryModel( void );
00112 
00113 protected:
00114         Blokkal::Blog * findBlog( const QString & blogId, const Blokkal::Account * account );
00115         void addCategories( Blokkal::Blog * blog );
00116         void removeCategories( Blokkal::Blog * blog );
00117         
00118 protected Q_SLOTS:
00123         virtual void addBlog( Blokkal::Blog * blog );
00124 
00129         virtual void removeBlog( Blokkal::Blog * blog );
00130 
00131         virtual void addCategory( const QString & blogId,
00132                                   Blokkal::Io::Category * category,
00133                                   Blokkal::Io::CategoryManager * manager );
00134         virtual void removeCategory( const QString & blogId,
00135                                      Blokkal::Io::Category * category,
00136                                      Blokkal::Io::CategoryManager * manager );
00137 
00138 };
00139 
00140 }
00141 
00142 #endif