00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef QT3TEXTFORMATTER_H_
00010 #define QT3TEXTFORMATTER_H_
00011
00012 #include <qfont.h>
00013 #include <qcolor.h>
00014 #include <qsyntaxhighlighter.h>
00015
00016 #include <boost/shared_ptr.hpp>
00017
00018 #include "TextFormatter.h"
00019 #include "Qt3SyntaxHighlighter.h"
00020
00021 namespace srchiliteqt {
00022
00023 typedef boost::shared_ptr<QFont> QFontPtr;
00024 typedef boost::shared_ptr<QColor> QColorPtr;
00025
00029 class Qt3TextFormatter: public TextFormatter {
00030 protected:
00035 QFontPtr font;
00036
00041 QColorPtr color;
00042
00050 Qt3SyntaxHighlighter *qSyntaxHighlighter;
00051
00052 public:
00053 Qt3TextFormatter(const std::string &elem_ = "normal");
00054 virtual ~Qt3TextFormatter();
00055
00056 QFont &getQFont() const {
00057 return *font;
00058 }
00059
00060 QColor &getQColor() const {
00061 return *color;
00062 }
00063
00064 virtual void setQSyntaxHighlighter(QSyntaxHighlighter *qSyntaxHighlighter_) {
00065 qSyntaxHighlighter = dynamic_cast<Qt3SyntaxHighlighter *>(qSyntaxHighlighter_);
00066 }
00067
00074 void format(const std::string &s, const srchilite::FormatterParams *params);
00075
00076 };
00077
00078 }
00079
00080 #endif