remove no use code
This commit is contained in:
parent
c4a41403bc
commit
d07e9aeda0
|
@ -1,99 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2020-2022 Roy Qu (royqh1979@gmail.com)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "composition.h"
|
||||
#include "../Constants.h"
|
||||
|
||||
namespace QSynedit {
|
||||
|
||||
HighlighterSchema::HighlighterSchema(QObject *parent):
|
||||
QObject(parent),
|
||||
mCaseSensitive(true)
|
||||
{
|
||||
mMarkerAttribute = std::make_shared<TokenAttribute>(SYNS_AttrMarker,
|
||||
QSynedit::TokenType::Default);
|
||||
mMarkerAttribute->setForeground(Qt::yellow);
|
||||
mMarkerAttribute->setStyles(FontStyle::fsBold);
|
||||
}
|
||||
|
||||
QString HighlighterSchema::endExpr() const
|
||||
{
|
||||
return mEndExpr;
|
||||
}
|
||||
|
||||
void HighlighterSchema::setEndExpr(const QString &endExpr)
|
||||
{
|
||||
mEndExpr = endExpr;
|
||||
}
|
||||
|
||||
QString HighlighterSchema::getStartExpr() const
|
||||
{
|
||||
return StartExpr;
|
||||
}
|
||||
|
||||
void HighlighterSchema::setStartExpr(const QString &value)
|
||||
{
|
||||
StartExpr = value;
|
||||
}
|
||||
|
||||
PSyntaxer HighlighterSchema::getHighlighter() const
|
||||
{
|
||||
return mHighlighter;
|
||||
}
|
||||
|
||||
void HighlighterSchema::setHighlighter(const PSyntaxer &highlighter)
|
||||
{
|
||||
mHighlighter = highlighter;
|
||||
}
|
||||
|
||||
PTokenAttribute HighlighterSchema::getMarkerAttribute() const
|
||||
{
|
||||
return mMarkerAttribute;
|
||||
}
|
||||
|
||||
QString HighlighterSchema::getSchemeName() const
|
||||
{
|
||||
return mSchemeName;
|
||||
}
|
||||
|
||||
void HighlighterSchema::setSchemeName(const QString &schemeName)
|
||||
{
|
||||
mSchemeName = schemeName;
|
||||
}
|
||||
|
||||
int HighlighterSchema::getCaseSensitive() const
|
||||
{
|
||||
return mCaseSensitive;
|
||||
}
|
||||
|
||||
void HighlighterSchema::setCaseSensitive(int caseSensitive)
|
||||
{
|
||||
mCaseSensitive = caseSensitive;
|
||||
}
|
||||
|
||||
QString HighlighterSchema::ConvertExpression(const QString &Value)
|
||||
{
|
||||
if (!mCaseSensitive) {
|
||||
return Value.toUpper();
|
||||
} else {
|
||||
return Value;
|
||||
}
|
||||
}
|
||||
|
||||
void HighlighterSchema::MarkerAttriChanged() {
|
||||
}
|
||||
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2020-2022 Roy Qu (royqh1979@gmail.com)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef SYNHIGHLIGHTCOMPOSITION_H
|
||||
#define SYNHIGHLIGHTCOMPOSITION_H
|
||||
#include "syntaxer.h"
|
||||
#include <memory>
|
||||
#include <QObject>
|
||||
|
||||
namespace QSynedit {
|
||||
class HighlighterSchema;
|
||||
using PHighlighterSchema = std::shared_ptr<HighlighterSchema>;
|
||||
|
||||
//using OnCheckMarker = std::function<void(PHighlighterSchema Sender,int &StartPos, int &MarkerLen,
|
||||
// std::shared_ptr<QString>& MarkerText , int Line)>;
|
||||
|
||||
class HighlighterSchema : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit HighlighterSchema(QObject* parent=nullptr);
|
||||
QString endExpr() const;
|
||||
void setEndExpr(const QString &endExpr);
|
||||
|
||||
QString getStartExpr() const;
|
||||
void setStartExpr(const QString &value);
|
||||
|
||||
PSyntaxer getHighlighter() const;
|
||||
void setHighlighter(const PSyntaxer &highlighter);
|
||||
|
||||
PTokenAttribute getMarkerAttribute() const;
|
||||
|
||||
QString getSchemeName() const;
|
||||
void setSchemeName(const QString &schemeName);
|
||||
|
||||
int getCaseSensitive() const;
|
||||
void setCaseSensitive(int caseSensitive);
|
||||
|
||||
private:
|
||||
QString mEndExpr;
|
||||
QString StartExpr;
|
||||
PSyntaxer mHighlighter;
|
||||
PTokenAttribute mMarkerAttribute;
|
||||
QString mSchemeName;
|
||||
int mCaseSensitive;
|
||||
// OnCheckMarker mOnCheckStartMarker;
|
||||
// OnCheckMarker mOnCheckEndMarker;
|
||||
QString ConvertExpression(const QString& Value);
|
||||
private slots:
|
||||
void MarkerAttriChanged();
|
||||
};
|
||||
|
||||
}
|
||||
#endif // SYNHIGHLIGHTCOMPOSITION_H
|
Loading…
Reference in New Issue