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/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
51 padding(int32 left, int32 top, int32 right, int32 bottom);
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;
78 void bottom(int32 bottom);
79
82 int32 horizontal() const noexcept;
83
87 int32 left() const noexcept;
91 void left(int32 left);
92
96 int32 right() const noexcept;
100 void right(int32 right);
101
105 int32 top() const noexcept;
109 void top(int32 top);
110
115 int32 vertical() const noexcept;
117
119
121 using object::equals;
122 bool equals(const padding& value) const noexcept override;
123
127 xtd::string to_string() const noexcept override;
129
131
135 static padding add(const padding& p1, const padding& p2);
136
141 static padding subtract(const padding& p1, const padding& p2);
143
144 private:
145 bool all_ = true;
146 int32 left_ = 0;
147 int32 top_ = 0;
148 int32 right_ = 0;
149 int32 bottom_ = 0;
150 };
151 }
152}
Represents a display device or multiple display devices on a single system.
Definition padding.h:25
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:31
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:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
#define forms_export_
Define shared library export.
Definition forms_export.h:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
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