xtd 0.2.0
Loading...
Searching...
No Matches
length.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../../forms_export.hpp"
6#include "length_unit.hpp"
7#include <xtd/drawing/rectangle>
8#include <xtd/iequatable>
9#include <xtd/string>
10
12namespace xtd {
14 namespace forms {
16 namespace style_sheets {
77 class forms_export_ length : public xtd::iequatable<length>, public xtd::object {
78 public:
80
83 static const length empty;
85
87
90 length() = default;
91
94 explicit length(double value);
95
99 length(double value, length_unit unit);
101
103 length(const length&) = default;
104 length& operator =(const length&) = default;
106
108
112 double value() const noexcept;
115 void value(double value) noexcept;
116
119 length_unit unit() const noexcept;
122 void unit(length_unit value) noexcept;
124
126
128 using object::equals;
129 bool equals(const length& other) const noexcept override;
130
134 int32 get_pixels(const xtd::drawing::rectangle& rect) const noexcept;
135
136 xtd::string to_string() const noexcept override;
138
139 private:
140 double value_ = -1;
141 length_unit unit_ = length_unit::pixels;
142 };
143 }
144 }
145}
The xtd::forms::style_sheets::length specifies the legth and unit of many properties of the xtd::form...
Definition length.hpp:77
double value() const noexcept
Gets the xtd::forms::style_sheets::length value.
static const length empty
Provides a xtd::forms::style_sheets::length object with 0 pixels.
Definition length.hpp:83
length(double value)
Initializes a new instance of the xtd::forms::style_sheets::length class with specifed value in pixel...
length(double value, length_unit unit)
Initializes a new instance of the xtd::forms::style_sheets::length class with specifed value and unit...
length()=default
Initializes a new instance of the xtd::forms::style_sheets::length class.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:42
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
length_unit
The length_unit enum class specifies the units for xtd::forms::style_sheets::length.
Definition length_unit.hpp:66
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
Contains xtd::forms::style_sheets::length_unit enum class.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10