xtd 0.2.0
Loading...
Searching...
No Matches
length.h
Go to the documentation of this file.
1
4#pragma once
5#include "../../forms_export.h"
6#include "length_unit.h"
7#include <xtd/drawing/rectangle>
8#include <xtd/iequatable>
9#include <xtd/ustring>
10
12namespace xtd {
14 namespace forms {
16 namespace style_sheets {
75 class forms_export_ length : public xtd::iequatable<length>, public xtd::object {
76 public:
78
81 static const length empty;
83
85
88 length() = default;
89
92 explicit length(double value);
93
97 length(double value, length_unit unit);
99
101 length(const length&) = default;
102 length& operator =(const length&) = default;
104
106
110 double value() const noexcept;
113 void value(double value) noexcept;
114
117 length_unit unit() const noexcept;
120 void unit(length_unit value) noexcept;
122
124
126 bool equals(const length& other) const noexcept override;
127
131 int32 get_pixels(const xtd::drawing::rectangle& rect) const noexcept;
132
133 xtd::ustring to_string() const noexcept override;
135
136 private:
137 double value_ = -1;
138 length_unit unit_ = length_unit::pixels;
139 };
140 }
141 }
142}
The xtd::forms::style_sheets::length specifies the legth and unit of many properties of the xtd::form...
Definition length.h:75
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.h:81
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.h:18
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
#define forms_export_
Define shared library export.
Definition forms_export.h:13
length_unit
The length_unit enum class specifies the units for xtd::forms::style_sheets::length.
Definition length_unit.h:64
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
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.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10