Coverage Report

Created: 2025-12-14 06:12

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wt/src/Wt/WShadow.h
Line
Count
Source
1
// This may look like C code, but it's really -*- C++ -*-
2
/*
3
 * Copyright (C) 2008 Emweb bv, Herent, Belgium.
4
 *
5
 * See the LICENSE file for terms of use.
6
 */
7
#ifndef WSHADOW_H_
8
#define WSHADOW_H_
9
10
#include <Wt/WColor.h>
11
12
namespace Wt {
13
14
/*! \class WShadow Wt/WShadow.h Wt/WShadow.h
15
 *  \brief A value class that defines a shadow style
16
 *
17
 * \sa WPainter::setShadow()
18
 *
19
 * \ingroup painting
20
 */
21
class WT_API WShadow
22
{
23
public:
24
  /*! \brief Default constructor.
25
   *
26
   * Constructs a disabled shadow effect (offsetX = offsetY = blur = 0)
27
   */
28
  WShadow();
29
30
  /*! \brief Constructs a shadow with given offset and color.
31
   */
32
  WShadow(double dx, double dy, const WColor& color, double blur);
33
34
#ifdef WT_TARGET_JAVA
35
    /*! \brief Clone method.
36
   *
37
   * Clones this shadow.
38
   */
39
  WShadow clone() const;
40
#endif
41
42
  /*! \brief Comparison operator.
43
   *
44
   * Returns \c true if the shadows are exactly the same.
45
   */
46
  bool operator==(const WShadow& other) const;
47
48
  /*! \brief Comparison operator.
49
   *
50
   * Returns \c true if the shadows are different.
51
   */
52
  bool operator!=(const WShadow& other) const;
53
54
  /*! \brief Returns whether the shadow effect is nihil.
55
   */
56
  bool none() const;
57
58
  /*! \brief Sets the shadow offset.
59
   */
60
  void setOffsets(double dx, double dy);
61
62
  /*! \brief Returns the shadow X offset.
63
   *
64
   * \sa setOffsets()
65
   */
66
0
  double offsetX() const { return offsetX_; }
67
68
  /*! \brief Returns the shadow Y offset.
69
   *
70
   * \sa setOffsets()
71
   */
72
0
  double offsetY() const { return offsetY_; }
73
74
  /*! \brief Changes the shadow color.
75
   *
76
   * \sa color()
77
   */
78
  void setColor(const WColor& color);
79
80
  /*! \brief Returns the shadow color.
81
   *
82
   * \sa setColor()
83
   */
84
0
  const WColor& color() const { return color_; }
85
86
  /*! \brief Sets the blur.
87
   *
88
   * \sa blur()
89
   */
90
  void setBlur(double blur);
91
92
  /*! \brief Returns the blur.
93
   *
94
   * \sa setBlur()
95
   */
96
0
  double blur() const { return blur_; }
97
98
private:
99
  WColor color_;
100
  double offsetX_, offsetY_, blur_;
101
};
102
103
}
104
105
#endif // WSHADOW_H_