itom
Loading...
Searching...
No Matches
caretLineHighlight.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2020, Institut für Technische Optik (ITO),
5 Universität Stuttgart, Germany
6
7 This file is part of itom.
8
9 itom is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Library General Public Licence as published by
11 the Free Software Foundation; either version 2 of the Licence, or (at
12 your option) any later version.
13
14 itom is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17 General Public Licence for more details.
18
19 You should have received a copy of the GNU Library General Public License
20 along with itom. If not, see <http://www.gnu.org/licenses/>.
21
22 Further hints:
23 ------------------------
24
25 This file belongs to the code editor of itom. The code editor is
26 in major parts a fork / rewritten version of the python-based source
27 code editor PyQode from Colin Duquesnoy and others
28 (see https://github.com/pyQode). PyQode itself is licensed under
29 the MIT License (MIT).
30
31 Some parts of the code editor of itom are also inspired by the
32 source code editor of the Spyder IDE (https://github.com/spyder-ide),
33 also licensed under the MIT License and developed by the Spyder Project
34 Contributors.
35
36*********************************************************************** */
37
38#ifndef CARETLINHIGHLIGHT_H
39#define CARETLINHIGHLIGHT_H
40
41/*
42This module contains the care line highlighter mode
43*/
44
45#include "../textDecoration.h"
46#include "../mode.h"
47
48#include <qcolor.h>
49
50namespace ito {
51
52/*
53Highlights the caret line
54*/
55class CaretLineHighlighterMode : public QObject, public Mode
56{
57 Q_OBJECT
58public:
59 CaretLineHighlighterMode(const QString &description = "", QObject *parent = NULL);
61
62 QColor background() const;
63 void setBackground(const QColor &color);
64
65 bool blocked() const;
66 void setBlocked(bool blocked);
67
68 virtual void onInstall(CodeEditor *editor);
69 virtual void onStateChanged(bool state);
70
71public slots:
72 void refresh();
73
74protected:
75 void clearDeco();
76
77 QColor m_color;
78 TextDecoration::Ptr m_decoration;
79 bool m_blocked;
80};
81
82} //end namespace ito
83
84#endif
Definition caretLineHighlight.h:56
bool m_blocked
if true, the highlighter is temporarily disabled, even if it is enabled.
Definition caretLineHighlight.h:79
Definition codeEditor.h:110
Definition mode.h:70
Definition apiFunctionsGraph.cpp:40