xtd 0.2.0
Loading...
Searching...
No Matches
xtd::forms::emoticon Class Reference
Inheritance diagram for xtd::forms::emoticon:
xtd::object xtd::iequatable< emoticon > xtd::interface

Definition

Represent a emoticon with name and codepoints.

Header
#include <xtd/forms/emoticon>
Namespace
xtd::forms
Library
xtd.forms
Examples
The following code example demonstrates the use of emoticon class.
#include <xtd/forms/application>
#include <xtd/forms/emoticons>
#include <xtd/forms/form>
#include <xtd/forms/label>
#include <xtd/forms/list_box>
using namespace std;
using namespace xtd;
using namespace xtd::forms;
auto main()->int {
auto main_form = form::create("Emoticons example");
main_form.client_size({500, 400}).padding(10);
auto emoticon_label = label::create(main_form, "");
emoticon_label.text_align(xtd::forms::content_alignment::middle_center).dock(dock_style::fill).font({main_form.font(), 192});
auto emoticons_list_box = list_box::create(main_form, list_box::object_collection {});
emoticons_list_box.dock(dock_style::left).width(200);
for (const auto& emoticon : emoticons::get_emoticons())
emoticons_list_box.items().push_back({ustring::format("{} {}", emoticon, emoticon.name()), emoticon});
emoticons_list_box.selected_value_changed += [&] {
emoticon_label.text(as<emoticon>(emoticons_list_box.selected_item().tag()).to_string());
};
emoticons_list_box.selected_index(0);
application::run(main_form);
}
static void run()
Begins running a standard application message loop on the current thread, without a form.
virtual dock_style dock() const noexcept
Gets which control borders are docked to its parent control and determines how a control is resized w...
Represent a emoticon with name and codepoints.
Definition emoticon.h:28
const xtd::ustring & name() const noexcept
Gets name of emoticon.
Provides a collection of xtd::forms:emoticon for all known emoticons. This class cannot be inherited.
Definition emoticons.h:22
static form create()
A factory to create an xtd::forms::form.
static label create()
A factory to create an xtd::forms::label.
Represents a collection of objects.
Definition arranged_element_collection.h:32
static list_box create()
A factory to create an xtd::forms::list_box.
Represents a display device or multiple display devices on a single system.
Definition padding.h:23
static ustring format(const ustring &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
Definition ustring.h:1131
@ left
The control's left edge is docked to the left edge of its containing control.
@ fill
All the control's edges are docked to the all edges of its containing control and sized appropriately...
@ middle_center
Content is vertically aligned at the middle, and horizontally aligned at the center.
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
Examples
emoticons.cpp.

Public Fields

static const emoticon empty ()
 Represents an empty emoticon.
 

Public Constructors

 emoticon (const xtd::ustring &name, std::initializer_list< char32 > codepoints)
 Initialize a new instance of emoticon class with specified name and codepoints.
 
 emoticon (const xtd::ustring &name, const std::vector< char32 > &codepoints)
 Initialize a new instance of emoticon class with specified name and codepoints.
 
 emoticon (const xtd::ustring &name, char32 codepoint)
 Initialize a new instance of emoticon class with specified name and codepoint.
 
 emoticon (std::initializer_list< char32 > codepoints)
 Initialize a new instance of emoticon class with specified codepoints.
 
 emoticon (const std::vector< char32 > &codepoints)
 Initialize a new instance of emoticon class with specified codepoints.
 
 emoticon (char32 codepoint)
 Initialize a new instance of emoticon class with specified codepoint.
 

Public Properties

const xtd::ustringname () const noexcept
 Gets name of emoticon.
 
const std::vector< char32 > & codepoints () const noexcept
 Gets codepoints of emoticon.
 

Public Methods

bool equals (const emoticon &value) const noexcept override
 
xtd::ustring to_string () const noexcept override
 Returns a string containing the codepoints of the emoticons.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const noexcept
 Creates a shallow copy of the current object.
 
- Public Member Functions inherited from xtd::iequatable< emoticon >
virtual bool equals (const emoticon &) const noexcept=0
 Indicates whether the current object is equal to another object of the same type.
 
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

Constructor & Destructor Documentation

◆ emoticon() [1/6]

xtd::forms::emoticon::emoticon ( const xtd::ustring name,
std::initializer_list< char32 codepoints 
)

Initialize a new instance of emoticon class with specified name and codepoints.

Parameters
nameA string that represent the name of emoticon
codepointsAn initializer list of char32 that represent the emoticon.

◆ emoticon() [2/6]

xtd::forms::emoticon::emoticon ( const xtd::ustring name,
const std::vector< char32 > &  codepoints 
)

Initialize a new instance of emoticon class with specified name and codepoints.

Parameters
nameA string that represent the name of emoticon
codepointsAn array of char32 that represent the emoticon.

◆ emoticon() [3/6]

xtd::forms::emoticon::emoticon ( const xtd::ustring name,
char32  codepoint 
)

Initialize a new instance of emoticon class with specified name and codepoint.

Parameters
nameA string that represent the name of emoticon
codepointA char32 that represent the emoticon.

◆ emoticon() [4/6]

xtd::forms::emoticon::emoticon ( std::initializer_list< char32 codepoints)
explicit

Initialize a new instance of emoticon class with specified codepoints.

Parameters
codepointsAn initializer list of char32 that represent the emoticon.

◆ emoticon() [5/6]

xtd::forms::emoticon::emoticon ( const std::vector< char32 > &  codepoints)
explicit

Initialize a new instance of emoticon class with specified codepoints.

Parameters
codepointsAn array of char32 that represent the emoticon.

◆ emoticon() [6/6]

xtd::forms::emoticon::emoticon ( char32  codepoint)
explicit

Initialize a new instance of emoticon class with specified codepoint.

Parameters
codepointsA char32 that represent the emoticon.

Member Function Documentation

◆ codepoints()

const std::vector< char32 > & xtd::forms::emoticon::codepoints ( ) const
noexcept

Gets codepoints of emoticon.

Returns
An array of char32 that represent the emoticon.

◆ empty()

static const emoticon xtd::forms::emoticon::empty ( )
static

Represents an empty emoticon.

◆ name()

const xtd::ustring & xtd::forms::emoticon::name ( ) const
noexcept

Gets name of emoticon.

Returns
A string that represent the name of emoticon.
Examples
emoticons.cpp.

◆ to_string()

xtd::ustring xtd::forms::emoticon::to_string ( ) const
overridevirtualnoexcept

Returns a string containing the codepoints of the emoticons.

Returns
A string containing the codepoints of the emoticon. Empty string ("") for none codepoints.

Reimplemented from xtd::object.


The documentation for this class was generated from the following file: