xtd 0.2.0
padding.h
Go to the documentation of this file.
1 #pragma once
5 #include "../forms_export.h"
6 #include <xtd/iequatable>
7 #include <xtd/object>
8 #include <xtd/ustring>
9 #include <cstdint>
10 
12 namespace 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 
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 
121  static padding add(const padding& p1, const padding& p2);
122 
123  bool equals(const padding& value) const noexcept override;
124 
129  static padding subtract(const padding& p1, const padding& p2);
130 
134  xtd::ustring to_string() const noexcept override;
136 
137  private:
138  bool all_ = true;
139  int32 left_ = 0;
140  int32 top_ = 0;
141  int32 right_ = 0;
142  int32 bottom_ = 0;
143  };
144  }
145 }
Represents a display device or multiple display devices on a single system.
Definition: padding.h:23
The control or element is oriented horizontally.
Bind control edges to the top of its container.
xtd::forms::style_sheets::lengths padding
Padding is used to create space around an element&#39;s content, inside of any defined borders...
Definition: padding.h:24
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1063
Bind control edges to the bottom of its container.
Bind control edges to the right of its container.
static const padding empty
Provides a Padding object with no padding.
Definition: padding.h:29
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
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
All flags except none.
Bind control edges to the left of its container.
The subtract key.
The control or element is oriented vertically.