kgpg
keytreeview.h
Go to the documentation of this file.00001 /* Copyright 2008 Rolf Eike Beer <kde@opensource.sf-tec.de> 00002 * 00003 * This program is free software; you can redistribute it and/or 00004 * modify it under the terms of the GNU General Public License as 00005 * published by the Free Software Foundation; either version 2 of 00006 * the License or (at your option) version 3 or any later version 00007 * accepted by the membership of KDE e.V. (or its successor approved 00008 * by the membership of KDE e.V.), which shall act as a proxy 00009 * defined in Section 14 of version 3 of the license. 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, see <http://www.gnu.org/licenses/>. 00018 */ 00019 #ifndef KEYTREEVIEW_H 00020 #define KEYTREEVIEW_H 00021 00022 #include <QTreeView> 00023 00024 #include "core/kgpgkey.h" 00025 00026 class QDragMoveEvent; 00027 class QDropEvent; 00028 00029 class KGpgNode; 00030 class KeyListProxyModel; 00031 class KConfigGroup; 00032 class KgpgInterface; 00033 00034 class KeyTreeView: public QTreeView 00035 { 00036 private: 00037 KeyListProxyModel *m_proxy; 00038 00039 public: 00040 explicit KeyTreeView(QWidget *parent = 0, KeyListProxyModel *model = 0); 00041 00042 QList<KGpgNode *> selectedNodes(bool *psame = NULL, KgpgCore::KgpgItemType *pt = NULL) const; 00043 KGpgNode *selectedNode() const; 00044 00045 void restoreLayout(KConfigGroup &cg); 00046 void saveLayout(KConfigGroup &cg) const; 00047 00048 public Q_SLOTS: 00049 void selectNode(KGpgNode *nd); 00050 void resizeColumnsToContents(); 00051 00052 private Q_SLOTS: 00053 void slotRefreshKeys(KgpgInterface *iface, const QStringList &keys); 00054 00055 protected: 00056 virtual void contentsDragMoveEvent(QDragMoveEvent *e); 00057 virtual void contentsDropEvent(QDropEvent *e); 00058 virtual void startDrag(Qt::DropActions); 00059 }; 00060 00061 #endif
KDE 4.2 API Reference