Blokkal
an Extendable KDE Blogging Client
SourceForge.net Logo

blogbrowsingdriver.h

00001 /***************************************************************************
00002  *   Copyright (C) 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 BLOKKALL_IOBLOGBROWSINGDRIVER_H
00021 #define BLOKKALL_IOBLOGBROWSINGDRIVER_H
00022 
00023 #include "../blokkal_export.h"
00024 
00025 #include <QtCore/QObject>
00026 #include <QtCore/QDate>
00027 
00028 namespace Blokkal {
00029 class Blog;
00030 class Account;
00031 namespace Ui {
00032 class BrowseEntryDialog;
00033 class BrowseOptionWidget;
00034 }
00035 namespace Io {
00036 class LoadEntryJob;
00037 class LoadIndexJob;
00038 
00048 class BLOKKAL_EXPORT BlogBrowsingDriver : public QObject {
00049 Q_OBJECT
00050 public:
00054         enum BrowseMode {
00055                 BrowseEdit = 1, 
00056                 BrowseLink = 2, 
00057         };
00058         
00063         BlogBrowsingDriver( Blokkal::Blog * parent );
00064         virtual ~BlogBrowsingDriver( void );
00065 
00069         Blokkal::Blog * blog( void ) const;
00070 
00074         enum BlogOperations {
00075                 LoadIndex = 0x0001, 
00076                 LoadEntryById = 0x0002, 
00077                 LoadEntriesByDate = 0x0004, 
00078                 LoadRecentEntries = 0x0008, 
00079         };
00080 
00089         virtual unsigned int recentLimit( void ) const;
00090 
00096         virtual unsigned int supportedOperations( void ) const;
00097 
00103         virtual unsigned int supportedBrowseModes( void ) const;
00104 
00109         Blokkal::Ui::BrowseEntryDialog * browseBlogDialog( BrowseMode mode );
00110 
00116         virtual Blokkal::Io::LoadEntryJob * createLoadEntryJob( const QStringList & idList );
00117 
00123         virtual Blokkal::Io::LoadEntryJob * createLoadEntryJob( const QDate & date );
00124 
00131         virtual Blokkal::Io::LoadEntryJob * createLoadEntryJob( unsigned int n );
00132 
00141         virtual Blokkal::Io::LoadIndexJob * createLoadIndexJob( const QDate & from = QDate(), const QDate & to = QDate() );
00142 
00150         virtual QList<Blokkal::Ui::BrowseOptionWidget*> customBrowseOptionWidgets( QWidget * parent );
00151         
00152 private Q_SLOTS:
00153         void slotBrowseViewDestroyed( QObject * object );
00154         void slotBrowseViewFinished( void );
00155         void slotAccountStatusChanged( Blokkal::Account * account );
00156         
00157 private:
00158         class Private;
00159         Private * const d;
00160 };
00161 
00162 }
00163 
00164 }
00165 
00166 #endif