Kate
hlselectionplugin.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2010 Dominik Haumann <dhaumann kde org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #ifndef _HIGHLIGHT_SELECTION_PLUGIN_H_ 00020 #define _HIGHLIGHT_SELECTION_PLUGIN_H_ 00021 00022 #include <ktexteditor/plugin.h> 00023 #include <ktexteditor/view.h> 00024 00025 // #include <kxmlguiclient.h> 00026 #include <QtCore/QObject> 00027 #include <kjob.h> 00028 #include <kurl.h> 00029 #include <kio/job.h> 00030 00031 namespace KTextEditor { 00032 class MovingRange; 00033 } 00034 00035 class HighlightSelectionPlugin : public KTextEditor::Plugin 00036 { 00037 Q_OBJECT 00038 00039 public: 00040 explicit HighlightSelectionPlugin( QObject *parent = 0, 00041 const QVariantList &args = QVariantList() ); 00042 virtual ~HighlightSelectionPlugin(); 00043 00044 void addView (KTextEditor::View *view); 00045 void removeView (KTextEditor::View *view); 00046 00047 00048 private: 00049 QList<class HighlightSelectionPluginView*> m_views; 00050 }; 00051 00052 class HighlightSelectionPluginView 00053 : public QObject 00054 // , public KXMLGUIClient 00055 { 00056 Q_OBJECT 00057 public: 00058 explicit HighlightSelectionPluginView(KTextEditor::View *view); 00059 ~HighlightSelectionPluginView(); 00060 00061 void createHighlights(); 00062 KTextEditor::View* view() const; 00063 00064 public Q_SLOTS: 00065 void selectionChanged(); 00066 void clearHighlights(); 00067 00068 private: 00069 KTextEditor::View* m_view; 00070 QString m_currentText; 00071 00072 QList<KTextEditor::MovingRange*> m_ranges; 00073 }; 00074 00075 #endif // _HIGHLIGHT_SELECTION_PLUGIN_H_ 00076 00077 // kate: space-indent on; indent-width 2; replace-tabs on;
KDE 4.6 API Reference