2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
11 #ifndef PREF_HIGHLIGHT_H
12 #define PREF_HIGHLIGHT_H
14 #include "ui_pref_highlight.h"
15 #include "highlighter.h"
16 #include <boost/shared_ptr.hpp>
21 class ItemMapBackInserter
: public PatternListAdaptorOutputIterator
{
23 typedef std::map
<QListWidgetItem
*, Highlighter::Pattern
> ItemMap
;
28 ItemMapBackInserter(ItemMap
& map
, QListWidget
* list
);
29 virtual void add(const Highlighter::Pattern
& p
);
30 QListWidgetItem
* addItem(const Highlighter::Pattern
& p
);
33 class PrefHighlight
: public QDialog
34 , private Ui::PrefHighlight
{
37 typedef ItemMapBackInserter::ItemMap ItemMap
;
40 boost::shared_ptr
<Highlighter
> m_highlighter
;
41 ItemMapBackInserter
* m_inserter
;
45 Highlighter::Pattern
& currentPattern();
46 void updateHighlighting();
51 void updateColor(const QColor
&);
52 void changePattern(QListWidgetItem
*);
53 void editPatternName(QListWidgetItem
* index
);
62 #endif // PREF_HIGHLIGHT_H