Kate
katecompletiontree.h
Go to the documentation of this file.00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2006 Hamish Rodda <rodda@kde.org> 00003 Copyright (C) 2007-2008 David Nolden <david.nolden.kdevelop@art-master.de> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef KATECOMPLETIONTREE_H 00021 #define KATECOMPLETIONTREE_H 00022 00023 #include "expandingtree/expandingtree.h" 00024 00025 class KateCompletionWidget; 00026 class KateCompletionModel; 00027 00028 class QTimer; 00029 00030 class KateCompletionTree : public ExpandingTree 00031 { 00032 Q_OBJECT 00033 00034 public: 00035 explicit KateCompletionTree(KateCompletionWidget* parent); 00036 00037 KateCompletionWidget* widget() const; 00038 KateCompletionModel* kateModel() const; 00039 00040 void resizeColumns(bool fromResizeEvent = false, bool firstShow = false, bool forceResize = false); 00041 00042 // Navigation 00043 bool nextCompletion(); 00044 bool previousCompletion(); 00045 bool pageDown(); 00046 bool pageUp(); 00047 void top(); 00048 void bottom(); 00049 00050 void scheduleUpdate(); 00051 00052 void setScrollingEnabled(bool); 00053 00055 int columnTextViewportPosition ( int column ) const; 00056 00057 private slots: 00058 void resizeColumnsSlot(); 00059 00060 protected: 00061 virtual void currentChanged ( const QModelIndex & current, const QModelIndex & previous ); 00062 virtual void scrollContentsBy(int dx, int dy); 00063 virtual QStyleOptionViewItem viewOptions() const; 00064 private: 00065 bool m_scrollingEnabled; 00066 QTimer* m_resizeTimer; 00067 }; 00068 00069 #endif