| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2017 The Qt Company Ltd. |
| 4 | ** Contact: http://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the Qt Quick Templates 2 module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL3$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see http://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at http://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 3 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPLv3 included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl.html. |
| 24 | ** |
| 25 | ** GNU General Public License Usage |
| 26 | ** Alternatively, this file may be used under the terms of the GNU |
| 27 | ** General Public License version 2.0 or later as published by the Free |
| 28 | ** Software Foundation and appearing in the file LICENSE.GPL included in |
| 29 | ** the packaging of this file. Please review the following information to |
| 30 | ** ensure the GNU General Public License version 2.0 requirements will be |
| 31 | ** met: http://www.gnu.org/licenses/gpl-2.0.html. |
| 32 | ** |
| 33 | ** $QT_END_LICENSE$ |
| 34 | ** |
| 35 | ****************************************************************************/ |
| 36 | |
| 37 | #include "qquickpalette_p.h" |
| 38 | |
| 39 | QT_BEGIN_NAMESPACE |
| 40 | |
| 41 | QColor QQuickPalette::alternateBase() const |
| 42 | { |
| 43 | return v.color(cr: QPalette::AlternateBase); |
| 44 | } |
| 45 | |
| 46 | void QQuickPalette::setAlternateBase(const QColor &color) |
| 47 | { |
| 48 | v.setColor(acg: QPalette::All, acr: QPalette::AlternateBase, acolor: color); |
| 49 | } |
| 50 | |
| 51 | void QQuickPalette::resetAlternateBase() |
| 52 | { |
| 53 | v.resolve(mask: v.resolve() & ~(1 << QPalette::AlternateBase)); |
| 54 | } |
| 55 | |
| 56 | QColor QQuickPalette::base() const |
| 57 | { |
| 58 | return v.color(cr: QPalette::Base); |
| 59 | } |
| 60 | |
| 61 | void QQuickPalette::setBase(const QColor &color) |
| 62 | { |
| 63 | v.setColor(acg: QPalette::All, acr: QPalette::Base, acolor: color); |
| 64 | } |
| 65 | |
| 66 | void QQuickPalette::resetBase() |
| 67 | { |
| 68 | v.resolve(mask: v.resolve() & ~(1 << QPalette::Base)); |
| 69 | } |
| 70 | |
| 71 | QColor QQuickPalette::brightText() const |
| 72 | { |
| 73 | return v.color(cr: QPalette::BrightText); |
| 74 | } |
| 75 | |
| 76 | void QQuickPalette::setBrightText(const QColor &color) |
| 77 | { |
| 78 | v.setColor(acg: QPalette::All, acr: QPalette::BrightText, acolor: color); |
| 79 | } |
| 80 | |
| 81 | void QQuickPalette::resetBrightText() |
| 82 | { |
| 83 | v.resolve(mask: v.resolve() & ~(1 << QPalette::BrightText)); |
| 84 | } |
| 85 | |
| 86 | QColor QQuickPalette::button() const |
| 87 | { |
| 88 | return v.color(cr: QPalette::Button); |
| 89 | } |
| 90 | |
| 91 | void QQuickPalette::setButton(const QColor &color) |
| 92 | { |
| 93 | v.setColor(acg: QPalette::All, acr: QPalette::Button, acolor: color); |
| 94 | } |
| 95 | |
| 96 | void QQuickPalette::resetButton() |
| 97 | { |
| 98 | v.resolve(mask: v.resolve() & ~(1 << QPalette::Button)); |
| 99 | } |
| 100 | |
| 101 | QColor QQuickPalette::buttonText() const |
| 102 | { |
| 103 | return v.color(cr: QPalette::ButtonText); |
| 104 | } |
| 105 | |
| 106 | void QQuickPalette::setButtonText(const QColor &color) |
| 107 | { |
| 108 | v.setColor(acg: QPalette::All, acr: QPalette::ButtonText, acolor: color); |
| 109 | } |
| 110 | |
| 111 | void QQuickPalette::resetButtonText() |
| 112 | { |
| 113 | v.resolve(mask: v.resolve() & ~(1 << QPalette::ButtonText)); |
| 114 | } |
| 115 | |
| 116 | QColor QQuickPalette::dark() const |
| 117 | { |
| 118 | return v.color(cr: QPalette::Dark); |
| 119 | } |
| 120 | |
| 121 | void QQuickPalette::setDark(const QColor &color) |
| 122 | { |
| 123 | v.setColor(acg: QPalette::All, acr: QPalette::Dark, acolor: color); |
| 124 | } |
| 125 | |
| 126 | void QQuickPalette::resetDark() |
| 127 | { |
| 128 | v.resolve(mask: v.resolve() & ~(1 << QPalette::Dark)); |
| 129 | } |
| 130 | |
| 131 | QColor QQuickPalette::highlight() const |
| 132 | { |
| 133 | return v.color(cr: QPalette::Highlight); |
| 134 | } |
| 135 | |
| 136 | void QQuickPalette::setHighlight(const QColor &color) |
| 137 | { |
| 138 | v.setColor(acg: QPalette::All, acr: QPalette::Highlight, acolor: color); |
| 139 | } |
| 140 | |
| 141 | void QQuickPalette::resetHighlight() |
| 142 | { |
| 143 | v.resolve(mask: v.resolve() & ~(1 << QPalette::Highlight)); |
| 144 | } |
| 145 | |
| 146 | QColor QQuickPalette::highlightedText() const |
| 147 | { |
| 148 | return v.color(cr: QPalette::HighlightedText); |
| 149 | } |
| 150 | |
| 151 | void QQuickPalette::setHighlightedText(const QColor &color) |
| 152 | { |
| 153 | v.setColor(acg: QPalette::All, acr: QPalette::HighlightedText, acolor: color); |
| 154 | } |
| 155 | |
| 156 | void QQuickPalette::resetHighlightedText() |
| 157 | { |
| 158 | v.resolve(mask: v.resolve() & ~(1 << QPalette::HighlightedText)); |
| 159 | } |
| 160 | |
| 161 | QColor QQuickPalette::light() const |
| 162 | { |
| 163 | return v.color(cr: QPalette::Light); |
| 164 | } |
| 165 | |
| 166 | void QQuickPalette::setLight(const QColor &color) |
| 167 | { |
| 168 | v.setColor(acg: QPalette::All, acr: QPalette::Light, acolor: color); |
| 169 | } |
| 170 | |
| 171 | void QQuickPalette::resetLight() |
| 172 | { |
| 173 | v.resolve(mask: v.resolve() & ~(1 << QPalette::Light)); |
| 174 | } |
| 175 | |
| 176 | QColor QQuickPalette::link() const |
| 177 | { |
| 178 | return v.color(cr: QPalette::Link); |
| 179 | } |
| 180 | |
| 181 | void QQuickPalette::setLink(const QColor &color) |
| 182 | { |
| 183 | v.setColor(acg: QPalette::All, acr: QPalette::Link, acolor: color); |
| 184 | } |
| 185 | |
| 186 | void QQuickPalette::resetLink() |
| 187 | { |
| 188 | v.resolve(mask: v.resolve() & ~(1 << QPalette::Link)); |
| 189 | } |
| 190 | |
| 191 | QColor QQuickPalette::linkVisited() const |
| 192 | { |
| 193 | return v.color(cr: QPalette::LinkVisited); |
| 194 | } |
| 195 | |
| 196 | void QQuickPalette::setLinkVisited(const QColor &color) |
| 197 | { |
| 198 | v.setColor(acg: QPalette::All, acr: QPalette::LinkVisited, acolor: color); |
| 199 | } |
| 200 | |
| 201 | void QQuickPalette::resetLinkVisited() |
| 202 | { |
| 203 | v.resolve(mask: v.resolve() & ~(1 << QPalette::LinkVisited)); |
| 204 | } |
| 205 | |
| 206 | QColor QQuickPalette::mid() const |
| 207 | { |
| 208 | return v.color(cr: QPalette::Mid); |
| 209 | } |
| 210 | |
| 211 | void QQuickPalette::setMid(const QColor &color) |
| 212 | { |
| 213 | v.setColor(acg: QPalette::All, acr: QPalette::Mid, acolor: color); |
| 214 | } |
| 215 | |
| 216 | void QQuickPalette::resetMid() |
| 217 | { |
| 218 | v.resolve(mask: v.resolve() & ~(1 << QPalette::Mid)); |
| 219 | } |
| 220 | |
| 221 | QColor QQuickPalette::midlight() const |
| 222 | { |
| 223 | return v.color(cr: QPalette::Midlight); |
| 224 | } |
| 225 | |
| 226 | void QQuickPalette::setMidlight(const QColor &color) |
| 227 | { |
| 228 | v.setColor(acg: QPalette::All, acr: QPalette::Midlight, acolor: color); |
| 229 | } |
| 230 | |
| 231 | void QQuickPalette::resetMidlight() |
| 232 | { |
| 233 | v.resolve(mask: v.resolve() & ~(1 << QPalette::Midlight)); |
| 234 | } |
| 235 | |
| 236 | QColor QQuickPalette::shadow() const |
| 237 | { |
| 238 | return v.color(cr: QPalette::Shadow); |
| 239 | } |
| 240 | |
| 241 | void QQuickPalette::setShadow(const QColor &color) |
| 242 | { |
| 243 | v.setColor(acg: QPalette::All, acr: QPalette::Shadow, acolor: color); |
| 244 | } |
| 245 | |
| 246 | void QQuickPalette::resetShadow() |
| 247 | { |
| 248 | v.resolve(mask: v.resolve() & ~(1 << QPalette::Shadow)); |
| 249 | } |
| 250 | |
| 251 | QColor QQuickPalette::text() const |
| 252 | { |
| 253 | return v.color(cr: QPalette::Text); |
| 254 | } |
| 255 | |
| 256 | void QQuickPalette::setText(const QColor &color) |
| 257 | { |
| 258 | v.setColor(acg: QPalette::All, acr: QPalette::Text, acolor: color); |
| 259 | } |
| 260 | |
| 261 | void QQuickPalette::resetText() |
| 262 | { |
| 263 | v.resolve(mask: v.resolve() & ~(1 << QPalette::Text)); |
| 264 | } |
| 265 | |
| 266 | QColor QQuickPalette::toolTipBase() const |
| 267 | { |
| 268 | return v.color(cr: QPalette::ToolTipBase); |
| 269 | } |
| 270 | |
| 271 | void QQuickPalette::setToolTipBase(const QColor &color) |
| 272 | { |
| 273 | v.setColor(acg: QPalette::All, acr: QPalette::ToolTipBase, acolor: color); |
| 274 | } |
| 275 | |
| 276 | void QQuickPalette::resetToolTipBase() |
| 277 | { |
| 278 | v.resolve(mask: v.resolve() & ~(1 << QPalette::ToolTipBase)); |
| 279 | } |
| 280 | |
| 281 | QColor QQuickPalette::toolTipText() const |
| 282 | { |
| 283 | return v.color(cr: QPalette::ToolTipText); |
| 284 | } |
| 285 | |
| 286 | void QQuickPalette::setToolTipText(const QColor &color) |
| 287 | { |
| 288 | v.setColor(acg: QPalette::All, acr: QPalette::ToolTipText, acolor: color); |
| 289 | } |
| 290 | |
| 291 | void QQuickPalette::resetToolTipText() |
| 292 | { |
| 293 | v.resolve(mask: v.resolve() & ~(1 << QPalette::ToolTipText)); |
| 294 | } |
| 295 | |
| 296 | QColor QQuickPalette::window() const |
| 297 | { |
| 298 | return v.color(cr: QPalette::Window); |
| 299 | } |
| 300 | |
| 301 | void QQuickPalette::setWindow(const QColor &color) |
| 302 | { |
| 303 | v.setColor(acg: QPalette::All, acr: QPalette::Window, acolor: color); |
| 304 | } |
| 305 | |
| 306 | void QQuickPalette::resetWindow() |
| 307 | { |
| 308 | v.resolve(mask: v.resolve() & ~(1 << QPalette::Window)); |
| 309 | } |
| 310 | |
| 311 | QColor QQuickPalette::windowText() const |
| 312 | { |
| 313 | return v.color(cr: QPalette::WindowText); |
| 314 | } |
| 315 | |
| 316 | void QQuickPalette::setWindowText(const QColor &color) |
| 317 | { |
| 318 | v.setColor(acg: QPalette::All, acr: QPalette::WindowText, acolor: color); |
| 319 | } |
| 320 | |
| 321 | void QQuickPalette::resetWindowText() |
| 322 | { |
| 323 | v.resolve(mask: v.resolve() & ~(1 << QPalette::WindowText)); |
| 324 | } |
| 325 | |
| 326 | QT_END_NAMESPACE |
| 327 | |