xtd 1.0.0
Loading...
Searching...
No Matches
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 xtd::object, public xtd::iequatable<padding> {
26 public:
28
31 static const padding empty;
33
35
38 padding() = default;
39
43 padding(xtd::int32 all); // Can't be explicit by design.
44
53
55
60 xtd::int32 all() const noexcept;
65
69 xtd::int32 bottom() const noexcept;
74
77 xtd::int32 horizontal() const noexcept;
78
82 xtd::int32 left() const noexcept;
87
91 xtd::int32 right() const noexcept;
96
100 xtd::int32 top() const noexcept;
105
110 xtd::int32 vertical() const noexcept;
112
114
119 bool equals(const xtd::object& obj) const noexcept override;
123 bool equals(const padding& other) const noexcept override;
124
127 xtd::usize get_hash_code() const noexcept override;
128
132 xtd::string to_string() const noexcept override;
134
136
140 static padding add(const padding& p1, const padding& p2);
141
146 static padding subtract(const padding& p1, const padding& p2);
148
149 private:
150 bool all_ = true;
151 xtd::int32 left_ = 0;
152 xtd::int32 top_ = 0;
153 xtd::int32 right_ = 0;
154 xtd::int32 bottom_ = 0;
155 };
156 }
157}
static padding subtract(const padding &p1, const padding &p2)
Subtracts one specified Padding value from another.
xtd::int32 bottom() const noexcept
Gets the padding value for the bottom edge.
xtd::int32 vertical() const noexcept
Gets the combined padding for the bottom and top edges.
padding(xtd::int32 all)
Initializes a new instance of the padding class using the supplied padding size for all edges.
static const padding empty
Provides a Padding object with no padding.
Definition padding.hpp:31
xtd::int32 right() const noexcept
Gets the padding value for the right edge.
padding(xtd::int32 left, xtd::int32 top, xtd::int32 right, xtd::int32 bottom)
Initializes a new instance of the padding class using a separate padding size for each edge.
bool equals(const xtd::object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
xtd::int32 all() const noexcept
Gets the padding value for all the edges.
xtd::int32 left() const noexcept
Gets the padding value for the left edge.
padding()=default
Initializes a new instance of the padding class.
xtd::int32 horizontal() const noexcept
Gets the combined padding for the right and left edges.
xtd::usize get_hash_code() const noexcept override
Serves as a hash function for a particular type.
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.
xtd::int32 top() const noexcept
Gets the padding value for the top edge.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
Contains forms_export_ keyword.
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:25
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
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