kjots
bookshelf.h
Go to the documentation of this file.00001 // 00002 // kjots 00003 // 00004 // Copyright (C) 1997 Christoph Neerfeld <Christoph.Neerfeld@home.ivm.de> 00005 // Copyright (C) 2002, 2003 Aaron J. Seigo <aseigo@kde.org> 00006 // Copyright (C) 2003 Stanislav Kljuhhin <crz@hot.ee> 00007 // Copyright (C) 2005-2006 Jaison Lee <lee.jaison@gmail.com> 00008 // 00009 // This program is free software; you can redistribute it and/or modify 00010 // it under the terms of the GNU General Public License as published by 00011 // the Free Software Foundation; either version 2 of the License, or 00012 // (at your option) any later version. 00013 // 00014 // This program is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU General Public License 00020 // along with this program; if not, write to the Free Software 00021 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00022 // 00023 00024 #ifndef bookshelf_included 00025 #define bookshelf_included 00026 00027 #include <QTreeWidget> 00028 #include <QTreeWidgetItem> 00029 00030 class QMimeData; 00031 00032 class KActionCollection; 00033 00034 class KJotsPage; 00035 class KJotsBook; 00036 class KJotsEntry; 00037 00038 class Bookshelf : public QTreeWidget 00039 { 00040 Q_OBJECT 00041 00042 public: 00043 explicit Bookshelf ( QWidget* ); 00044 00045 void DelayedInitialization ( KActionCollection* ); 00046 void prepareForExit ( void ); 00047 00048 void jumpToId(quint64); 00049 void jumpToEntry(QTreeWidgetItem*); 00050 00051 KJotsEntry* entryFromId(quint64); 00052 KJotsEntry* currentEntry ( void ); 00053 KJotsPage* currentPage ( void ); 00054 KJotsBook* currentBook ( void ); 00055 KJotsBook* currentTopLevelBook ( void ); 00056 00057 QList<KJotsEntry*> selected ( void ); 00058 void remove(QTreeWidgetItem*); 00059 QString currentCaption(const QString &); 00060 00061 Qt::DropActions supportedDropActions() const; 00062 QStringList mimeTypes() const; 00063 QMimeData *mimeData(const QList<QTreeWidgetItem*>) const; 00064 bool dropMimeData ( QTreeWidgetItem *, int, const QMimeData*, Qt::DropAction ); 00065 00066 public slots: 00067 void onHeaderClick(int); 00068 void nextBook(); 00069 void prevBook(); 00070 void nextPage(); 00071 void prevPage(); 00072 00073 protected: 00074 void loadBooks ( void ); 00075 void sortBook(QTreeWidgetItem * ); 00076 00077 virtual void dragEnterEvent ( QDragEnterEvent * ); 00078 virtual void dragMoveEvent ( QDragMoveEvent * ); 00079 00080 KActionCollection *pageActionCollection; 00081 KActionCollection *bookActionCollection; 00082 KActionCollection *multiActionCollection; 00083 Qt::SortOrder sortOrder; 00084 00085 protected slots: 00086 void entryRenamed(QTreeWidgetItem*, int); 00087 void setContextMenuOptions(); 00088 void itemWasExpanded(QTreeWidgetItem*); 00089 void itemWasCollapsed(QTreeWidgetItem*); 00090 void copyLinkAddress(); 00091 void changeColor(); 00092 }; 00093 00094 #endif //bookshelf_included 00095 /* ex: set tabstop=4 softtabstop=4 shiftwidth=4 expandtab: */ 00096 /* kate: tab-indents off; replace-tabs on; tab-width 4; remove-trailing-space on; encoding utf-8;*/
KDE 4.0 API Reference