Allow building as monolithic app (no plugins) for easier developement.
[tagua/yd.git] / src / pref_highlight.h
blob30308c5ec59da1cdbc7d01dffb54e86160c685d8
1 /*
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.
9 */
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>
17 #include <QDialog>
18 #include <QColor>
19 #include <vector>
21 class ItemMapBackInserter : public PatternListAdaptorOutputIterator {
22 public:
23 typedef std::map<QListWidgetItem*, Highlighter::Pattern> ItemMap;
24 private:
25 ItemMap& m_map;
26 QListWidget* m_list;
27 public:
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 {
35 Q_OBJECT
36 public:
37 typedef ItemMapBackInserter::ItemMap ItemMap;
38 private:
39 ItemMap m_patterns;
40 boost::shared_ptr<Highlighter> m_highlighter;
41 ItemMapBackInserter* m_inserter;
42 public:
43 PrefHighlight();
44 void apply();
45 Highlighter::Pattern& currentPattern();
46 void updateHighlighting();
47 public Q_SLOTS:
48 void updateRegExp();
49 void updateBold();
50 void updateItalic();
51 void updateColor(const QColor&);
52 void changePattern(QListWidgetItem*);
53 void editPatternName(QListWidgetItem* index);
54 void addEntry();
55 void removeEntry();
56 void moveEntryUp();
57 void moveEntryDown();
58 void moveEntry(int);
62 #endif // PREF_HIGHLIGHT_H