akregator
abstractselectioncontroller.h
Go to the documentation of this file.00001 /* 00002 This file is part of Akregator. 00003 00004 Copyright (C) 2007 Frank Osterfeld <osterfeld@kde.org> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 00020 As a special exception, permission is given to link this program 00021 with any edition of Qt, and distribute the resulting executable, 00022 without including the source code for Qt in the source distribution. 00023 */ 00024 #ifndef AKREGATOR_ABSTRACTSELECTIONCONTROLLER_H 00025 #define AKREGATOR_ABSTRACTSELECTIONCONTROLLER_H 00026 00027 #include <QObject> 00028 00029 #include <boost/shared_ptr.hpp> 00030 #include <vector> 00031 00032 class QAbstractItemView; 00033 class QItemSelectionModel; 00034 00035 namespace Akregator { 00036 00037 class Article; 00038 class ArticleModel; 00039 class FeedList; 00040 class FolderExpansionHandler; 00041 class SubscriptionListModel; 00042 class TreeNode; 00043 00044 namespace Filters { 00045 class AbstractMatcher; 00046 } 00047 00048 class ArticleLister 00049 { 00050 public: 00051 00052 virtual ~ArticleLister() {} 00053 00054 virtual void setArticleModel( Akregator::ArticleModel* model ) = 0; 00055 00056 virtual QItemSelectionModel* articleSelectionModel() const = 0; 00057 00058 virtual void setIsAggregation( bool isAggregation ) = 0; 00059 00060 virtual void setFilters( const std::vector<boost::shared_ptr<const Filters::AbstractMatcher> >& ) = 0; 00061 00062 virtual const QAbstractItemView* itemView() const = 0; 00063 00064 virtual QAbstractItemView* itemView() = 0; 00065 }; 00066 00067 class SingleArticleDisplay 00068 { 00069 public: 00070 virtual ~SingleArticleDisplay() {} 00071 00072 virtual void showArticle( const Akregator::Article & article ) = 0; 00073 }; 00074 00075 class SubscriptionLister 00076 { 00077 public: 00078 virtual ~SubscriptionLister() {} 00079 00080 virtual void setSubscriptionListModel( Akregator::SubscriptionListModel* model ) = 0; 00081 virtual QItemSelectionModel* subscriptionSelectionModel() const = 0; 00082 }; 00083 00084 class AbstractSelectionController : public QObject 00085 { 00086 Q_OBJECT 00087 00088 public: 00089 explicit AbstractSelectionController( QObject* parent = 0 ); 00090 virtual ~AbstractSelectionController(); 00091 00092 virtual void setFeedList( Akregator::FeedList* list ) = 0; 00093 00094 virtual void setFeedSelector( QAbstractItemView* feedSelector ) = 0; 00095 00096 virtual void setArticleLister( Akregator::ArticleLister* lister ) = 0; 00097 00098 virtual void setFolderExpansionHandler( Akregator::FolderExpansionHandler* handler ) = 0; 00099 00100 virtual void setSingleArticleDisplay( Akregator::SingleArticleDisplay* display ) = 0; 00101 00102 virtual Akregator::Article currentArticle() const = 0; 00103 00104 virtual QList<Akregator::Article> selectedArticles() const = 0; 00105 00106 virtual Akregator::TreeNode* selectedSubscription() const = 0; 00107 00108 public Q_SLOTS: 00109 00110 virtual void setFilters( const std::vector<boost::shared_ptr<const Akregator::Filters::AbstractMatcher> >& ) = 0; 00111 00112 Q_SIGNALS: 00113 void currentSubscriptionChanged( Akregator::TreeNode* node ); 00114 00115 void currentArticleChanged( const Akregator::Article& ); 00116 00117 void articleDoubleClicked( const Akregator::Article& ); 00118 }; 00119 00120 } // namespace Akregator 00121 00122 #endif // AKREGATOR_ABSTRACTSELECTIONCONTROLLER_H
KDE 4.2 API Reference