GrantleeTheme

color.h
1 /*
2  * SPDX-FileCopyrightText: 2019 Volker Krause <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  */
6 
7 #ifndef GRANTLEETHEME_COLOR_H
8 #define GRANTLEETHEME_COLOR_H
9 
10 #include <grantlee/filter.h>
11 #include <grantlee/node.h>
12 
22 class ColorHexRgbFilter : public Grantlee::Filter
23 {
24 public:
25  QVariant doFilter(const QVariant &input, const QVariant &arg, bool autoescape) const override;
26 };
27 
37 class ColorCssRgbaFilter : public Grantlee::Filter
38 {
39 public:
40  QVariant doFilter(const QVariant &input, const QVariant &arg, bool autoescape) const override;
41 };
42 
52 class ColorLighterFilter : public Grantlee::Filter
53 {
54 public:
55  QVariant doFilter(const QVariant &input, const QVariant &arg, bool autoescape) const override;
56 };
57 
67 class ColorDarkerFilter : public Grantlee::Filter
68 {
69 public:
70  QVariant doFilter(const QVariant &input, const QVariant &arg, bool autoescape) const override;
71 };
72 
82 class ColorSetAlphaFilter : public Grantlee::Filter
83 {
84 public:
85  QVariant doFilter(const QVariant &input, const QVariant &arg, bool autoescape) const override;
86 };
87 
99 class ColorMixTag : public Grantlee::AbstractNodeFactory
100 {
101  Q_OBJECT
102 public:
103  explicit ColorMixTag(QObject *parent = nullptr);
104  ~ColorMixTag();
105  Grantlee::Node *getNode(const QString &tagContent, Grantlee::Parser *p) const override;
106 };
107 
108 class ColorMixNode : public Grantlee::Node
109 {
110  Q_OBJECT
111 public:
112  explicit ColorMixNode(const QString &color1Name, const QString &color2Name, double ratio, const QString &varName, QObject *parent = nullptr);
113  ~ColorMixNode();
114  void render(Grantlee::OutputStream *stream, Grantlee::Context *c) const override;
115 
116 private:
117  QString m_color1Name;
118  QString m_color2Name;
119  QString m_varName;
120  double m_ratio;
121 };
122 
123 namespace Color {
124 void registerMetaType();
125 }
126 
127 #endif // GRANTLEETHEME_COLOR_H
Definition: color.h:123
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 12 2020 23:16:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.