xtd 0.2.0
padding.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../forms_export.hpp"
6#include <xtd/iequatable>
7#include <xtd/object>
8#include <xtd/string>
9#include <cstdint>
10
12namespace xtd {
14 namespace forms {
25 class forms_export_ padding : public object, public xtd::iequatable<padding> {
26 public:
28
31 static const padding empty;
33
35
38 padding() = default;
39
43 padding(int32 all); // Can't be explicit by design.
44
53
55 padding(const padding&) = default;
56 padding& operator =(const padding&) = default;
58
60
65 int32 all() const noexcept;
69 void all(int32 all);
70
74 int32 bottom() const noexcept;
79
82 int32 horizontal() const noexcept;
83
87 int32 left() const noexcept;
92
96 int32 right() const noexcept;
101
105 int32 top() const noexcept;
109 void top(int32 top);
110
115 int32 vertical() const noexcept;
117
119
124 bool equals(const xtd::object& obj) const noexcept override;
128 bool equals(const padding& other) const noexcept override;
129
132 xtd::size get_hash_code() const noexcept override;
133
137 xtd::string to_string() const noexcept override;
139
141
145 static padding add(const padding& p1, const padding& p2);
146
151 static padding subtract(const padding& p1, const padding& p2);
153
154 private:
155 bool all_ = true;
156 int32 left_ = 0;
157 int32 top_ = 0;
158 int32 right_ = 0;
159 int32 bottom_ = 0;
160 };
161 }
162}
padding(int32 left, int32 top, int32 right, int32 bottom)
Initializes a new instance of the padding class using a separate padding size for each edge.
int32 all() const noexcept
Gets the padding value for all the edges.
static padding subtract(const padding &p1, const padding &p2)
Subtracts one specified Padding value from another.
int32 top() const noexcept
Gets the padding value for the top edge.
int32 left() const noexcept
Gets the padding value for the left edge.
int32 bottom() const noexcept
Gets the padding value for the bottom edge.
int32 vertical() const noexcept
Gets the combined padding for the bottom and top edges.
padding(int32 all)
Initializes a new instance of the padding class using the supplied padding size for all edges.
int32 horizontal() const noexcept
Gets the combined padding for the right and left edges.
static const padding empty
Provides a Padding object with no padding.
Definition padding.hpp:31
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
int32 right() const noexcept
Gets the padding value for the right edge.
bool equals(const xtd::object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
padding()=default
Initializes a new instance of the padding class.
static padding add(const padding &p1, const padding &p2)
Computes the sum of the two specified padding values.
xtd::string to_string() const noexcept override
Returns a string that represents the current padding.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
object()=default
Create a new instance of the ultimate base class object.
Contains forms_export_ keyword.
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
@ other
The operating system is other.
Definition platform_id.hpp:58
@ size
Specifies that both the width and height property values of the control are defined.
Definition bounds_specified.hpp:36
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8