akregator/src

feedlistview.h

00001 /*
00002     This file is part of Akregator.
00003 
00004     Copyright (C) 2004 Stanislav Karchebny <Stanislav.Karchebny@kdemail.net>
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 AKREGATORFEEDLISTVIEW_H
00025 #define AKREGATORFEEDLISTVIEW_H
00026 
00027 #include <klistview.h>
00028 #include <kurl.h>
00029 
00030 namespace Akregator
00031 {
00032 class Feed;
00033 class Folder;
00034 class NodeList;
00035 class TreeNode;
00036 class TreeNodeItem;
00037 class TagNodeList;
00038 
00039 class NodeListView : public KListView
00040 {
00041 Q_OBJECT
00042 public:
00043     NodeListView( QWidget *parent = 0, const char *name = 0 );
00044     virtual ~NodeListView();
00045     
00047     void setNodeList(NodeList* nodeList);
00048 
00052     Folder* rootNode();
00053     
00057     TreeNode* selectedNode();
00058 
00062     void setSelectedNode(TreeNode* node);
00063 
00069     TreeNode* findNodeByTitle(const QString& title);
00070 
00072     void ensureNodeVisible(TreeNode* node);
00073 
00075     void startNodeRenaming(TreeNode* node);
00076     
00077     
00079     virtual void clear();
00080 
00082     void setShowTagFolders(bool enabled);
00083 
00084 public slots:
00085     
00087     void slotItemUp();
00089     void slotItemDown();
00091     void slotItemBegin();
00093     void slotItemEnd();
00095     void slotItemLeft();
00097     void slotItemRight();
00098 
00099     void slotPrevFeed();
00100     void slotNextFeed();
00101     void slotPrevUnreadFeed();
00102     void slotNextUnreadFeed();
00103     
00104 signals:
00105     void signalDropped (KURL::List &, TreeNode*, Folder*);
00106     void signalNodeSelected(TreeNode*);
00107     void signalRootNodeChanged(NodeListView*, TreeNode*);
00108     void signalContextMenu(KListView*, TreeNode*, const QPoint&);
00109 
00110 public:         // compat with KDE-3.x assertions, remove for KDE 4
00111 // protected:
00112 
00117     TreeNodeItem* findNodeItem(TreeNode* node);
00118 
00120     virtual TreeNodeItem* findItemByTitle(const QString& text, int column, ComparisonFlags compare = ExactMatch | CaseSensitive ) const;
00121 
00123     virtual void connectToNode(TreeNode* node);
00124 
00126     virtual void disconnectFromNode(TreeNode* node);
00127 
00128     virtual void connectToNodeList(NodeList* list);
00129     virtual void disconnectFromNodeList(NodeList* list);
00130     
00131     virtual void drawContentsOffset( QPainter * p, int ox, int oy,
00132                                         int cx, int cy, int cw, int ch );
00133     virtual void contentsDragMoveEvent(QDragMoveEvent* event);
00134     virtual bool acceptDrag(QDropEvent *event) const;
00135     virtual void movableDropEvent(QListViewItem* parent, QListViewItem* afterme);
00136 
00137     virtual QDragObject *dragObject();
00138             
00139 
00140 protected slots:
00141     
00142 
00143     void slotDropped(QDropEvent *e, QListViewItem* after);
00144     void slotRootNodeChanged(TreeNode*);
00145     virtual void slotSelectionChanged(QListViewItem* item);
00146     virtual void slotContextMenu(KListView* list, QListViewItem* item, const QPoint& p);
00147     virtual void slotItemRenamed(QListViewItem* item, int col, const QString& text);
00148     virtual void slotFeedFetchStarted(Feed* feed);
00149     virtual void slotFeedFetchAborted(Feed* feed);
00150     virtual void slotFeedFetchError(Feed* feed);
00151     virtual void slotFeedFetchCompleted(Feed* feed);
00152     void openFolder();
00153 
00155     virtual void slotNodeAdded(TreeNode* node);
00156     
00160     virtual void slotNodeRemoved(Folder* parent, TreeNode* node);
00161     
00163     virtual void slotNodeDestroyed(TreeNode* node);
00164     
00166     virtual void slotNodeChanged(TreeNode* node);
00167 
00168     virtual void slotNodeListDestroyed(NodeList*);
00169 
00170 public:         // compat with KDE-3.x assertions, remove for KDE 4
00171 // private:
00172     friend class ConnectNodeVisitor;
00173     class ConnectNodeVisitor;
00174     
00175     friend class DisconnectNodeVisitor;
00176     class DisconnectNodeVisitor;
00177 
00178     friend class CreateItemVisitor;
00179     class CreateItemVisitor;
00180 
00181     friend class DeleteItemVisitor;
00182     class DeleteItemVisitor;
00183     
00184     friend class DragAndDropVisitor;
00185     class DragAndDropVisitor;
00186 
00187     class NodeListViewPrivate;
00188     NodeListViewPrivate* d;
00189 };
00190 
00191 
00192 class TagNodeListView : public NodeListView
00193 {
00194     Q_OBJECT
00195     public:
00196         TagNodeListView(QWidget *parent = 0, const char *name = 0) {} 
00197         virtual ~TagNodeListView() {}
00198 
00199     private:
00200         class TagNodeListViewPrivate;
00201         TagNodeListViewPrivate* d;
00202 };
00203 
00204 } // namespace Akregator
00205 
00206 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys