5#include <unordered_map>
10#include "webcface/common/webcface-config.h"
17#pragma message("warning: Disabling macro definition of 'min' and 'max', since they conflicts in webcface/component_view.h.")
31struct ViewComponentData;
34struct TemporalViewComponentData;
76WEBCFACE_DLL ViewColor colorFromRGB(
double r,
double g,
double b);
112 std::shared_ptr<message::ViewComponentData> msg_data;
113 std::weak_ptr<internal::ClientData> data_w;
117 mutable std::unique_ptr<wcfMultiVal[]> options_s;
118 mutable std::unique_ptr<wcfMultiValW[]> options_sw;
120 void checkData()
const;
122 template <
typename CComponent,
typename CVal, std::
size_t v_index>
123 CComponent cDataT()
const;
132 ViewComponent(
const std::shared_ptr<message::ViewComponentData> &msg_data,
133 const std::weak_ptr<internal::ClientData> &data_w,
183 return !(*
this == other);
210 template <WEBCFACE_COMPLETE(Func)>
222 template <WEBCFACE_COMPLETE(Func)>
233 template <WEBCFACE_COMPLETE(Variant)>
234 std::optional<Variant_>
bind()
const;
251 std::optional<double> min()
const;
258 std::optional<double> max()
const;
264 std::optional<double> step()
const;
270 std::vector<ValAdaptor> option()
const;
282extern template std::optional<Func> ViewComponent::onClick<Func, true>()
const;
283extern template std::optional<Func> ViewComponent::onChange<Func, true>()
const;
284extern template std::optional<Variant>
285ViewComponent::bind<Variant, true>()
const;
293 std::unique_ptr<internal::TemporalViewComponentData> msg_data;
319 friend class internal::ViewBuf;
329 std::unique_ptr<internal::TemporalViewComponentData>
330 lockTmp(const std::shared_ptr<internal::ClientData> &data,
357 this->text(std::move(text));
358 return std::move(*
this);
372 return std::move(*
this);
386 return std::move(*
this);
397 template <typename T, decltype(std::declval<T>()(),
nullptr) =
nullptr>
406 template <typename T, decltype(std::declval<T>()(),
nullptr) =
nullptr>
408 this->onClick(std::move(func));
409 return std::move(*
this);
431 return std::move(*
this);
442 template <
typename T>
450 [ref, func = std::move(func)](
const ValAdaptor &val) {
451 ref.lockedField().set(val);
452 return func(val.
as<FirstArgType>());
460 template <
typename T>
462 this->onChange(std::move(func));
463 return std::move(*
this);
483 return std::move(*
this);
495 return std::move(*
this);
506 template <
typename T>
513 template <std::
size_t N>
520 template <std::
size_t N>
528 template <
typename T>
531 return std::move(*
this);
536 template <std::
size_t N>
539 return std::move(*
this);
544 template <std::
size_t N>
547 return std::move(*
this);
570 return std::move(*
this);
588 return std::move(*
this);
604 return std::move(*
this);
614 template <
typename T>
616 std::vector<ValAdaptor> option_v;
617 for (
const auto &v : option) {
620 return this->option(std::move(option_v));
626 template <
typename T>
628 this->option(option);
629 return std::move(*
this);
637 this->option(std::move(option));
638 return std::move(*
this);
654 return std::move(*
this);
668 this->height(height);
669 return std::move(*
this);
関数1つを表すクラス
Definition func.h:106
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:159
SharedString のpublicなコンストラクタインタフェース (入力専用)
Definition encoding.h:215
webcfaceで管理されている文字列を参照するstring_view
Definition encoding.h:60
Viewを構築するときに使う一時的なViewComponent.
Definition component_view.h:292
TemporalViewComponent && onChange(T func) &&
値が変化した時に実行される関数を設定
Definition component_view.h:461
TemporalViewComponent && textColor(ViewColor c) &&
Definition component_view.h:481
TemporalViewComponent && init(const T &init) &&
デフォルト値を設定する。
Definition component_view.h:529
TemporalViewComponent && step(double step) &&
数値の刻み幅を設定する。
Definition component_view.h:602
TemporalViewComponent & init(const T &init) &
デフォルト値を設定する。
Definition component_view.h:507
TemporalViewComponent && onClick(T func) &&
クリック時に実行される関数を設定
Definition component_view.h:407
TemporalViewComponent & onChange(T func) &
値が変化した時に実行される関数を設定
Definition component_view.h:443
TemporalViewComponent & init(const char(&init)[N]) &
Definition component_view.h:514
TemporalViewComponent && onClick(const Func &func) &&
クリック時に実行される関数を設定 (登録済みFunc)
Definition component_view.h:370
TemporalViewComponent & option(std::initializer_list< T > option) &
引数の選択肢を設定する。
Definition component_view.h:615
TemporalViewComponent & onClick(T func) &
クリック時に実行される関数を設定
Definition component_view.h:398
TemporalViewComponent && init(const char(&init)[N]) &&
Definition component_view.h:537
TemporalViewComponent && width(int width) &&
要素の幅を設定する。
Definition component_view.h:652
TemporalViewComponent && bind(const InputRef &ref) &&
変更した値を格納するInputRefを設定
Definition component_view.h:429
TemporalViewComponent & operator=(TemporalViewComponent &&other) noexcept
TemporalViewComponent && option(std::vector< ValAdaptor > option) &&
Definition component_view.h:636
TemporalViewComponent && max(double max) &&
最大値を設定する。
Definition component_view.h:586
TemporalViewComponent && min(double min) &&
最小値を設定する。
Definition component_view.h:568
TemporalViewComponent && option(std::initializer_list< T > option) &&
引数の選択肢を設定する。
Definition component_view.h:627
TemporalViewComponent(TemporalViewComponent &&other) noexcept
TemporalViewComponent && onClick(const FuncListener &func) &&
クリック時に実行される関数を設定 (FuncListener)
Definition component_view.h:384
~TemporalViewComponent() noexcept
TemporalViewComponent & init(const wchar_t(&init)[N]) &
Definition component_view.h:521
TemporalViewComponent && height(int height) &&
要素の高さを設定する。
Definition component_view.h:667
TemporalViewComponent && bgColor(ViewColor c) &&
Definition component_view.h:493
TemporalViewComponent && init(const wchar_t(&init)[N]) &&
Definition component_view.h:545
数値、文字列などの値を相互変換するクラス
Definition val_adaptor.h:87
T as() const
数値として返す 明示的なキャストをする
Definition val_adaptor.h:335
Viewに表示する要素です
Definition component_view.h:111
std::optional< Func_ > onClick() const
クリック時に実行される関数を取得
std::optional< Variant_ > bind() const
inputの現在の値を取得
std::optional< Func_ > onChange() const
inputの値の変化時に実行される関数を取得
ViewComponent(ViewComponent &&) noexcept
Viewの送受信データを表すクラス
Definition view.h:36
TemporalViewComponent button(const StringInitializer &text, T &&func)
buttonコンポーネント
Definition components.h:627
ViewComponentType
Definition component_view.h:78
ViewColor
Definition component_view.h:41
数値と文字列をまとめて扱うためのstruct (wstring)
Definition def_types.h:84
数値と文字列をまとめて扱うためのstruct
Definition def_types.h:50
Viewの要素を表すstruct (wstring)
Definition def_types.h:289
Viewの要素を表すstruct.
Definition def_types.h:218
Definition func_trait.h:21
#define WEBCFACE_DLL
Definition webcface-config.h:69
#define WEBCFACE_NS_END
Definition webcface-config.h:118
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:117
#define WEBCFACE_CALL_FP
Definition webcface-config.h:107