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 <qobject.h> 00024 #include <qptrlist.h> 00025 00026 class KateView; 00027 00028 namespace KTextEditor { class Mark; } 00029 00030 namespace Kate { class View; } 00031 00032 class KAction; 00033 class KToggleAction; 00034 class KActionCollection; 00035 class QPopupMenu; 00036 class QMenuData; 00037 00038 class KateBookmarks : public QObject 00039 { 00040 Q_OBJECT 00041 00042 public: 00043 enum Sorting { Position, Creation }; 00044 KateBookmarks( KateView* parent, Sorting sort=Position ); 00045 virtual ~KateBookmarks(); 00046 00047 void createActions( KActionCollection* ); 00048 00049 KateBookmarks::Sorting sorting() { return m_sorting; }; 00050 void setSorting( Sorting s ) { m_sorting = s; }; 00051 00052 protected: 00053 void insertBookmarks( QPopupMenu& menu); 00054 00055 private slots: 00056 void toggleBookmark(); 00057 void clearBookmarks(); 00058 00059 void slotViewGotFocus( Kate::View * ); 00060 void slotViewLostFocus( Kate::View * ); 00061 00062 void bookmarkMenuAboutToShow(); 00063 void bookmarkMenuAboutToHide(); 00064 00065 void goNext(); 00066 void goPrevious(); 00067 00068 void marksChanged (); 00069 00070 private: 00071 KateView* m_view; 00072 KToggleAction* m_bookmarkToggle; 00073 KAction* m_bookmarkClear; 00074 KAction* m_goNext; 00075 KAction* m_goPrevious; 00076 00077 Sorting m_sorting; 00078 QPopupMenu* m_bookmarksMenu; 00079 00080 uint _tries; 00081 }; 00082 00083 #endif 00084 00085 // kate: space-indent on; indent-width 2; replace-tabs on; 00086 // vim: noet ts=2