• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

akregator

articlelistview.h

Go to the documentation of this file.
00001 /*
00002     This file is part of Akregator.
00003 
00004     Copyright (C) 2004 Stanislav Karchebny <Stanislav.Karchebny@kdemail.net>
00005                   2005-2007 Frank Osterfeld <osterfeld@kde.org>
00006 
00007     This program is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020 
00021     As a special exception, permission is given to link this program
00022     with any edition of Qt, and distribute the resulting executable,
00023     without including the source code for Qt in the source distribution.
00024 */
00025 #ifndef AKREGATOR_ARTICLELISTVIEW_H
00026 #define AKREGATOR_ARTICLELISTVIEW_H
00027 
00028 #include "akregator_export.h"
00029 #include "abstractselectioncontroller.h"
00030 
00031 #include <QPointer>
00032 #include <QSortFilterProxyModel>
00033 #include <QTreeView>
00034 
00035 #include <boost/shared_ptr.hpp>
00036 
00037 class KUrl;
00038 class KMenu;
00039 
00040 class QContextMenuEvent;
00041 class QPaintEvent;
00042 class QKeyEvent;
00043 template <class T> class QList;
00044 
00045 namespace Akregator {
00046 
00047 class Article;
00048 class FilterColumnsProxyModel;
00049 
00050 namespace Filters
00051 {
00052     class ArticleMatcher;
00053 }
00054 
00055 class AKREGATORPART_EXPORT FilterDeletedProxyModel : public QSortFilterProxyModel {
00056     Q_OBJECT
00057 public:
00058 
00059     explicit FilterDeletedProxyModel( QObject* parent = 0 );
00060 
00061 private:
00062     //reimpl
00063     bool filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const;
00064 };
00065 
00066 class AKREGATORPART_EXPORT SortColorizeProxyModel : public QSortFilterProxyModel {
00067     Q_OBJECT
00068 public:
00069 
00070     explicit SortColorizeProxyModel( QObject* parent = 0 );
00071 
00072     //reimpl
00073     QVariant data( const QModelIndex& index, int role=Qt::DisplayRole ) const;
00074 
00075     void setFilters( const std::vector<boost::shared_ptr<const Akregator::Filters::AbstractMatcher> >& );
00076 
00077 private:
00078 
00079     //reimpl
00080     bool filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const;
00081 
00082     QIcon m_keepFlagIcon;
00083     std::vector<boost::shared_ptr<const Akregator::Filters::AbstractMatcher> > m_matchers;
00084 };
00085 
00086 
00087 class AKREGATORPART_EXPORT ArticleListView : public QTreeView, public ArticleLister
00088 {
00089     Q_OBJECT
00090 
00091 public:
00092 
00093     explicit ArticleListView( QWidget* parent = 0 );
00094     ~ArticleListView();
00095 
00096     //impl ArticleLister
00097     void setArticleModel( Akregator::ArticleModel* model );
00098 
00099     //impl ArticleLister
00100     QItemSelectionModel* articleSelectionModel() const;
00101 
00102     //impl ArticleLister
00103     const QAbstractItemView* itemView() const;
00104 
00105     //impl ArticleLister
00106     QAbstractItemView* itemView();
00107 
00108 
00109     //impl ArticleLister
00110     void setFilters( const std::vector<boost::shared_ptr<const Akregator::Filters::AbstractMatcher> >& );
00111 
00112     void setIsAggregation( bool isAggregation );
00113 
00114 protected:
00115     void mousePressEvent( QMouseEvent *ev );
00116 
00117 signals:
00118     void signalMouseButtonPressed( int, const KUrl );
00119 
00120 public Q_SLOTS:
00121 
00122     void slotClear();
00123 
00124     void slotPreviousArticle();
00125 
00126     void slotNextArticle();
00127 
00128     void slotPreviousUnreadArticle();
00129 
00130     void slotNextUnreadArticle();
00131 
00132 private:
00133     void saveHeaderSettings();
00134     void loadHeaderSettings();
00135 
00136     //reimpl
00137     void paintEvent( QPaintEvent* e );
00138 
00139     //reimpl
00140     void contextMenuEvent( QContextMenuEvent* event );
00141 
00142     void selectIndex( const QModelIndex& index );
00143 
00144     void setFeedMode();
00145     void setGroupMode();
00146 
00147 private Q_SLOTS:
00148     void showHeaderMenu( const QPoint& pos );
00149     void headerMenuItemTriggered( QAction* action );
00150 
00151 private:
00152 
00153     enum Column { ItemTitleColumn=0, FeedTitleColumn, DateColumn, ColumnCount };
00154     enum ColumnMode { Unspecified, GroupMode, FeedMode };
00155     ColumnMode m_columnMode;
00156     bool m_isAggregation;
00157     QPointer<SortColorizeProxyModel> m_proxy;
00158     bool m_headerSetUp;
00159 };
00160 
00161 } // namespace Akregator
00162 
00163 
00164 #endif // AKREGATOR_ARTICLELISTVIEW_H

akregator

Skip menu "akregator"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal