Blokkal
an Extendable KDE Blogging Client
SourceForge.net Logo

blokkalblog.h

00001 /***************************************************************************
00002  *   Copyright (C) 2006 - 2008 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 BLOKKALBLOKKALBLOG_H
00021 #define BLOKKALBLOKKALBLOG_H
00022 
00023 #include "blokkal_export.h"
00024 
00025 #include <QtCore/QObject>
00026 
00027 class QAction;
00028 
00029 class KIcon;
00030 class KUrl;
00031 
00032 namespace Blokkal {
00033 class Account;
00034 class Entry;
00035 class BlogConfig;
00036 
00037 namespace Ui {
00038 class EditEntryWidget;
00039 }
00040 
00041 namespace Io {
00042 class BlogBrowsingDriver;
00043 }
00044 
00055 class BLOKKAL_EXPORT Blog : public QObject
00056 {
00057 Q_OBJECT
00058 public:
00064         Blog( Blokkal::Account * parentAccount, const QString & id );
00065         
00071         virtual ~Blog( void );
00072 
00079         enum EntryFeatures {
00080                 FeatureDate = 0x01, 
00081                 FeatureSubject = 0x02, 
00082                 FeatureText = 0x04, 
00083                 FeatureCategory = 0x08, 
00084                 FeatureAddCategories = 0x10 | FeatureCategory, 
00085                 FeatureRemoveCategories = 0x20 | FeatureCategory, 
00086                 FeatureMultipleCategories = 0x40 | FeatureCategory, 
00087         };
00088 
00095         virtual unsigned int supportedFeatures( void ) const;   
00096         
00103         virtual QString type( void ) const;
00104 
00110         virtual KIcon icon( void ) const;
00111 
00117         QString title( void ) const;
00118 
00123         void setTitle( const QString & title );
00124 
00129         QString id( void ) const;
00130 
00135         virtual KUrl url( void ) const = 0;
00136 
00141         Blokkal::Account * account( void ) const;
00142 
00148         Blokkal::Ui::EditEntryWidget * createEditEntryWidget( Blokkal::Entry * entry, QWidget * parent );
00149 
00154         virtual Blokkal::Entry * createEntry( void ) = 0;
00155 
00159         virtual Blokkal::Io::BlogBrowsingDriver * blogBrowsingDriver( void ) const = 0;
00160 
00164         void removeBlog( void );
00165 
00173         virtual void saveProperties( void );
00174         
00180         virtual QList<QAction*> actionList( void );
00181 
00182 public Q_SLOTS:
00186         void startNewEntry( void );
00187 
00191         void browseEntries( void );
00192 
00193 Q_SIGNALS:
00198         void propertiesChanged( Blokkal::Blog * blog );
00199 
00203         void blogDestroyed( Blokkal::Blog * blog );
00204 
00205 protected:
00210         Blokkal::BlogConfig * config( void ) const;
00211 
00212 private:
00213         class Private;
00214         Private * const d;
00215 };
00216 
00217 }
00218 
00219 #endif