/usr/include/srchiliteqt/Qt3TextFormatter.h is in libsource-highlight-qt4-dev 0.2.2-0ubuntu7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | /*
* Copyright (C) 2008-2010 Lorenzo Bettini, http://www.lorenzobettini.it
* License: See COPYING file that comes with this distribution
*/
#ifndef QT3TEXTFORMATTER_H_
#define QT3TEXTFORMATTER_H_
#include <qfont.h>
#include <qcolor.h>
#include <qsyntaxhighlighter.h>
#include <boost/shared_ptr.hpp>
#include "TextFormatter.h"
#include "Qt3SyntaxHighlighter.h"
namespace srchiliteqt {
typedef boost::shared_ptr<QFont> QFontPtr;
typedef boost::shared_ptr<QColor> QColorPtr;
/**
* The implementation of TextFormatter for Qt3, relying on QTextCharFormat
*/
class Qt3TextFormatter: public TextFormatter {
protected:
/**
* The QFont for the formatter. We use a shared pointer
* so that on copy we still refer to the original object
*/
QFontPtr font;
/**
* The QColor for the formatter. We use a shared pointer
* so that on copy we still refer to the original object
*/
QColorPtr color;
/**
* The reference to QSyntaxHighlighter object.
*
* Since this header file does not include the header file for QSyntaxHighlighter,
* then this same class can be re-used both for Qt3 and for Qt4 (the subclasses
* of this class will include the correct header file for QSyntaxHighlighter).
*/
Qt3SyntaxHighlighter *qSyntaxHighlighter;
public:
Qt3TextFormatter(const std::string &elem_ = "normal");
virtual ~Qt3TextFormatter();
QFont &getQFont() const {
return *font;
}
QColor &getQColor() const {
return *color;
}
virtual void setQSyntaxHighlighter(QSyntaxHighlighter *qSyntaxHighlighter_) {
qSyntaxHighlighter = dynamic_cast<Qt3SyntaxHighlighter *>(qSyntaxHighlighter_);
}
/**
* Formats the passed string.
*
* @param the string to format
* @param params possible additional parameters for the formatter (NOT USED)
*/
void format(const std::string &s, const srchilite::FormatterParams *params);
};
}
#endif /* QT3TEXTFORMATTER_H_ */
|