Kate
katebookmarks.h
Go to the documentation of this file.00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2002, 2003 Anders Lund <anders.lund@lund.tdcadsl.dk> 00003 Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org> 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 __KATE_BOOKMARKS_H__ 00021 #define __KATE_BOOKMARKS_H__ 00022 00023 #include <QtCore/QObject> 00024 00025 class KateView; 00026 00027 namespace KTextEditor { class Mark; class View; } 00028 00029 class KAction; 00030 class KToggleAction; 00031 class KActionCollection; 00032 class QMenu; 00033 00034 class KateBookmarks : public QObject 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 enum Sorting { Position, Creation }; 00040 explicit KateBookmarks( KateView* parent, Sorting sort=Position ); 00041 virtual ~KateBookmarks(); 00042 00043 void createActions( KActionCollection* ); 00044 00045 KateBookmarks::Sorting sorting() { return m_sorting; } 00046 void setSorting( Sorting s ) { m_sorting = s; } 00047 00048 protected: 00049 void insertBookmarks( QMenu& menu); 00050 00051 private Q_SLOTS: 00052 void toggleBookmark(); 00053 void clearBookmarks(); 00054 00055 void gotoLine(); 00056 void gotoLine (int line); 00057 00058 void bookmarkMenuAboutToShow(); 00059 00060 void goNext(); 00061 void goPrevious(); 00062 00063 void marksChanged (); 00064 00065 private: 00066 KateView* m_view; 00067 KToggleAction* m_bookmarkToggle; 00068 KAction* m_bookmarkClear; 00069 KAction* m_goNext; 00070 KAction* m_goPrevious; 00071 00072 Sorting m_sorting; 00073 QMenu* m_bookmarksMenu; 00074 00075 uint _tries; 00076 }; 00077 00078 #endif 00079 00080 // kate: space-indent on; indent-width 2; replace-tabs on; 00081 // vim: noet ts=2