xtd 0.2.0
Loading...
Searching...
No Matches
padding.h
Go to the documentation of this file.
1
4#pragma once
5#include "../forms_export.h"
6#include <xtd/iequatable>
7#include <xtd/object>
8#include <xtd/ustring>
9#include <cstdint>
10
12namespace xtd {
14 namespace forms {
23 class forms_export_ padding : public object, public xtd::iequatable<padding> {
24 public:
26
29 static const padding empty;
31
33
36 padding() = default;
37
41 padding(int32 all); // Can't be explicit by design.
42
49 padding(int32 left, int32 top, int32 right, int32 bottom);
51
53 padding(const padding&) = default;
54 padding& operator =(const padding&) = default;
56
58
63 int32 all() const noexcept;
67 void all(int32 all);
68
72 int32 bottom() const noexcept;
76 void bottom(int32 bottom);
77
80 int32 horizontal() const noexcept;
81
85 int32 left() const noexcept;
89 void left(int32 left);
90
94 int32 right() const noexcept;
98 void right(int32 right);
99
103 int32 top() const noexcept;
107 void top(int32 top);
108
113 int32 vertical() const noexcept;
115
117
119 bool equals(const padding& value) const noexcept override;
120
124 xtd::ustring to_string() const noexcept override;
126
128
132 static padding add(const padding& p1, const padding& p2);
133
138 static padding subtract(const padding& p1, const padding& p2);
140
141 private:
142 bool all_ = true;
143 int32 left_ = 0;
144 int32 top_ = 0;
145 int32 right_ = 0;
146 int32 bottom_ = 0;
147 };
148 }
149}
Represents a display device or multiple display devices on a single system.
Definition padding.h:23
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.
padding(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.h:29
padding()=default
Initializes a new instance of the padding 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
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
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