File indexing completed on 2024-05-05 05:13:11

0001 /*
0002     This file is part of Akregator.
0003 
0004     SPDX-FileCopyrightText: 2007 Frank Osterfeld <osterfeld@kde.org>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
0007 */
0008 
0009 #pragma once
0010 
0011 #include <QAction>
0012 #include <QByteArray>
0013 #include <QTreeView>
0014 
0015 namespace Akregator
0016 {
0017 class TreeNode;
0018 
0019 class SubscriptionListView : public QTreeView
0020 {
0021     Q_OBJECT
0022 public:
0023     explicit SubscriptionListView(QWidget *parent = nullptr);
0024     ~SubscriptionListView() override;
0025     // the following is all transitional, for easier porting from the item-based views
0026 
0027     void startNodeRenaming(TreeNode *node);
0028 
0029     void ensureNodeVisible(TreeNode *node);
0030 
0031     // override
0032     void setModel(QAbstractItemModel *model) override;
0033 
0034     void triggerUpdate()
0035     {
0036     }
0037 
0038     enum Column {
0039         TitleColumn = 0,
0040         UnreadColumn = 1,
0041         TotalColumn = 2,
0042     };
0043 
0044 public Q_SLOTS:
0045 
0046     void slotPrevFeed();
0047     void slotNextFeed();
0048 
0049     void slotPrevUnreadFeed();
0050     void slotNextUnreadFeed();
0051 
0052     void slotItemBegin();
0053     void slotItemEnd();
0054     void slotItemLeft();
0055     void slotItemRight();
0056     void slotItemUp();
0057     void slotItemDown();
0058 
0059     void slotSetHideReadFeeds(bool setting);
0060     void slotSetLockFeedsInPlace(bool setting);
0061     void slotSetAutoExpandFolders(bool setting);
0062 
0063 Q_SIGNALS:
0064     void userActionTakingPlace();
0065 
0066 private:
0067     void saveHeaderSettings();
0068     void loadHeaderSettings();
0069     void restoreHeaderState();
0070 
0071 private:
0072     void showHeaderMenu(const QPoint &pos);
0073     void headerMenuItemTriggered(QAction *action);
0074 
0075     QByteArray m_headerState;
0076 };
0077 }