xtd 0.2.0
theme.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/uri>
9 #include <xtd/ustring>
10 
12 namespace xtd {
14  namespace forms {
16  namespace style_sheets {
30  class forms_export_ theme : public xtd::iequatable<theme>, public xtd::object {
31  public:
33 
36  theme() = default;
41  explicit theme(const xtd::ustring& name);
46  theme(const xtd::ustring& name, const xtd::ustring& description);
51  theme(const xtd::ustring& name, const xtd::ustring& description, const xtd::ustring& authors);
57  theme(const xtd::ustring& name, const xtd::ustring& description, const xtd::ustring& authors, const xtd::uri& website);
59 
61  theme(const theme&) = default;
62  theme(theme&&) = default;
63  theme& operator =(const theme&) = default;
65 
67 
71  const xtd::ustring& authors() const noexcept;
74  void authors(const xtd::ustring& value) noexcept;
75 
78  const xtd::ustring& description() const noexcept;
81  void description(const xtd::ustring& value) noexcept;
82 
85  const xtd::ustring& name() const noexcept;
88  void name(const xtd::ustring& value) noexcept;
89 
92  const xtd::uri& website() const noexcept;
95  void website(const xtd::uri& value) noexcept;
97 
99 
101  bool equals(const theme& other) const noexcept override {return name_ == other.name_ && description_ == other.description_ && authors_ == other.authors_ && website_ == other.website_;}
102 
107  static bool from_css(const xtd::ustring& css_text, theme& result);
108 
113  static theme parse(const xtd::ustring& text);
114 
115  xtd::ustring to_string() const noexcept override;
116 
119  xtd::ustring to_css() const noexcept;
120 
125  static bool try_parse(const xtd::ustring& text, theme& result) noexcept;
127 
128  private:
129  xtd::ustring name_;
130  xtd::ustring description_;
131  xtd::ustring authors_;
132  xtd::uri website_;
133  };
134  }
135  }
136 }
value_t parse(const std::string &str)
Convert a string into a type.
Definition: parse.h:23
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
The theme data allows you to specify the theme informations.
Definition: theme.h:30
Defines a 3D themed border. The effect depends on the border color value.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition: iequatable.h:18
The operating system is other.
Provides an object representation of a uniform resource identifier (URI) and easy access to the parts...
Definition: uri.h:103
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:32
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
bool try_parse(const std::basic_string< char_t > &str, value_t &value) noexcept
Convert a string into a type.
Definition: parse.h:406
The xtd::forms::status_bar_panel displays text in the standard font.