component_options.hpp
chrono
ftxui/component/animation.hpp
ftxui/dom/direction.hpp
ftxui/dom/elements.hpp
ftxui/util/ref.hpp
functional
string
ftxui/component/component_base.hpp
ftxui/screen/color.hpp
include/ftxui/component/component.hpp
src/ftxui/component/button.cpp
src/ftxui/component/checkbox.cpp
src/ftxui/component/collapsible.cpp
src/ftxui/component/component_options.cpp
src/ftxui/component/dropdown.cpp
src/ftxui/component/input.cpp
src/ftxui/component/menu.cpp
src/ftxui/component/radiobox.cpp
src/ftxui/component/resizable_split.cpp
src/ftxui/component/slider.cpp
src/ftxui/component/window.cpp
ftxui/component/animation.hpp
ftxui/component/captured_mouse.hpp
ftxui/component/component_base.hpp
include/ftxui/component/component_options.hpp
ftxui/dom/canvas.hpp
ftxui/dom/deprecated.hpp
ftxui/dom/direction.hpp
ftxui/dom/elements.hpp
ftxui/dom/flexbox_config.hpp
ftxui/dom/linear_gradient.hpp
ftxui/dom/node.hpp
ftxui/dom/requirement.hpp
ftxui/dom/selection.hpp
ftxui/screen/box.hpp
ftxui/screen/color.hpp
ftxui/screen/image.hpp
ftxui/screen/pixel.hpp
ftxui/screen/screen.hpp
ftxui/screen/string.hpp
ftxui/screen/terminal.hpp
ftxui/util/autoreset.hpp
ftxui/util/ref.hpp
chrono
cstddef
cstdint
ftxui/dom/take_any_args.hpp
functional
memory
optional
sstream
string
unordered_map
utility
variant
vector
include/ftxui/component/component.hpp
include/ftxui/component/component_options.hpp
src/ftxui/component/button.cpp
src/ftxui/component/catch_event.cpp
src/ftxui/component/checkbox.cpp
src/ftxui/component/collapsible.cpp
src/ftxui/component/component.cpp
src/ftxui/component/component_fuzzer.cpp
src/ftxui/component/component_options.cpp
src/ftxui/component/container.cpp
src/ftxui/component/dropdown.cpp
src/ftxui/component/hoverable.cpp
src/ftxui/component/input.cpp
src/ftxui/component/maybe.cpp
src/ftxui/component/menu.cpp
src/ftxui/component/modal.cpp
src/ftxui/component/radiobox.cpp
src/ftxui/component/renderer.cpp
src/ftxui/component/resizable_split.cpp
src/ftxui/component/slider.cpp
src/ftxui/component/util.cpp
src/ftxui/component/window.cpp
ftxui::EntryState
ftxui::UnderlineOption
ftxui::AnimatedColorOption
ftxui::AnimatedColorsOption
ftxui::MenuEntryOption
ftxui::MenuOption
ftxui::ButtonOption
ftxui::CheckboxOption
ftxui::InputState
ftxui::InputOption
ftxui::RadioboxOption
ftxui::ResizableSplitOption
ftxui::SliderOption
ftxui::WindowRenderState
ftxui::WindowOptions
ftxui::DropdownOption
ftxui

    //Copyright2021ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #ifndefFTXUI_COMPONENT_COMPONENT_OPTIONS_HPP
    #defineFTXUI_COMPONENT_COMPONENT_OPTIONS_HPP

    #include<chrono>//formilliseconds
    #include<ftxui/component/animation.hpp>//forDuration,QuadraticInOut,Function
    #include<ftxui/dom/direction.hpp>//forDirection,Direction::Left,Direction::Right,Direction::Down
    #include<ftxui/dom/elements.hpp>//forElement,separator
    #include<ftxui/util/ref.hpp>//forRef,ConstRef,StringRef
    #include<functional>//forfunction
    #include<string>//forstring

    #include"ftxui/component/component_base.hpp"//forComponent
    #include"ftxui/screen/color.hpp"//forColor,Color::GrayDark,Color::White

    namespaceftxui{

    ///@briefargumentsfor|ButtonOption::transform|,|CheckboxOption::transform|,
    ///|Radiobox::transform|,|MenuEntryOption::transform|,
    ///|MenuOption::transform|.
    structEntryState{
    std::stringlabel;///<Thelabeltodisplay.
    boolstate;///<Thestateofthebutton/checkbox/radiobox
    boolactive;///<Whethertheentryistheactiveone.
    boolfocused;///<Whethertheentryisonefocusedbytheuser.
    intindex;///<Indexoftheentrywhenapplicableor-1.
    };

    structUnderlineOption{
    boolenabled=false;

    Colorcolor_active=Color::White;
    Colorcolor_inactive=Color::GrayDark;

    animation::easing::Functionleader_function=
    animation::easing::QuadraticInOut;
    animation::easing::Functionfollower_function=
    animation::easing::QuadraticInOut;

    animation::Durationleader_duration=std::chrono::milliseconds(250);
    animation::Durationleader_delay=std::chrono::milliseconds(0);
    animation::Durationfollower_duration=std::chrono::milliseconds(250);
    animation::Durationfollower_delay=std::chrono::milliseconds(0);

    voidSetAnimation(animation::Durationd,animation::easing::Functionf);
    voidSetAnimationDuration(animation::Durationd);
    voidSetAnimationFunction(animation::easing::Functionf);
    voidSetAnimationFunction(animation::easing::Functionf_leader,
    animation::easing::Functionf_follower);
    };

    ///@briefOptionaboutapotentiallyanimatedcolor.
    ///@ingroupcomponent
    structAnimatedColorOption{
    voidSet(
    Colorinactive,
    Coloractive,
    animation::Durationduration=std::chrono::milliseconds(250),
    animation::easing::Functionfunction=animation::easing::QuadraticInOut);

    boolenabled=false;
    Colorinactive;
    Coloractive;
    animation::Durationduration=std::chrono::milliseconds(250);
    animation::easing::Functionfunction=animation::easing::QuadraticInOut;
    };

    structAnimatedColorsOption{
    AnimatedColorOptionbackground;
    AnimatedColorOptionforeground;
    };

    ///@briefOptionfortheMenuEntrycomponent.
    ///@ingroupcomponent
    structMenuEntryOption{
    ConstStringReflabel="MenuEntry";
    std::function<Element(constEntryState&state)>transform;
    AnimatedColorsOptionanimated_colors;
    };

    ///@briefOptionfortheMenucomponent.
    ///@ingroupcomponent
    structMenuOption{
    //Standardconstructors:
    staticMenuOptionHorizontal();
    staticMenuOptionHorizontalAnimated();
    staticMenuOptionVertical();
    staticMenuOptionVerticalAnimated();
    staticMenuOptionToggle();

    ConstStringListRefentries;///>Thelistofentries.
    Ref<int>selected=0;///>Theindexoftheselectedentry.

    //Style:
    UnderlineOptionunderline;
    MenuEntryOptionentries_option;
    Directiondirection=Direction::Down;
    std::function<Element()>elements_prefix;
    std::function<Element()>elements_infix;
    std::function<Element()>elements_postfix;

    //Observers:
    std::function<void()>on_change;///>Calledwhentheselectedentrychanges.
    std::function<void()>on_enter;///>Calledwhentheuserpressesenter.
    Ref<int>focused_entry=0;
    };

    ///@briefOptionfortheAnimatedButtoncomponent.
    ///@ingroupcomponent
    structButtonOption{
    //Standardconstructors:
    staticButtonOptionAscii();
    staticButtonOptionSimple();
    staticButtonOptionBorder();
    staticButtonOptionAnimated();
    staticButtonOptionAnimated(Colorcolor);
    staticButtonOptionAnimated(Colorbackground,Colorforeground);
    staticButtonOptionAnimated(Colorbackground,
    Colorforeground,
    Colorbackground_active,
    Colorforeground_active);

    ConstStringReflabel="Button";
    std::function<void()>on_click=[]{};

    //Style:
    std::function<Element(constEntryState&)>transform;
    AnimatedColorsOptionanimated_colors;
    };

    ///@briefOptionfortheCheckboxcomponent.
    ///@ingroupcomponent
    structCheckboxOption{
    //Standardconstructors:
    staticCheckboxOptionSimple();

    ConstStringReflabel="Checkbox";

    Ref<bool>checked=false;

    //Style:
    std::function<Element(constEntryState&)>transform;

    //Observer:
    ///Calledwhentheuserchangethestate.
    std::function<void()>on_change=[]{};
    };

    ///@briefUsedtodefinestylefortheInputcomponent.
    structInputState{
    Elementelement;
    boolhovered;///<Whethertheinputishoveredbythemouse.
    boolfocused;///<Whethertheinputisfocusedbytheuser.
    boolis_placeholder;///<Whethertheinputisemptyanddisplayingthe
    ///<placeholder.
    };

    ///@briefOptionfortheInputcomponent.
    ///@ingroupcomponent
    structInputOption{
    //Asetofpredefinedstyles:

    ///@briefCreatethedefaultinputstyle:
    staticInputOptionDefault();
    ///@briefAwhiteonblackstylewithhighmargins:
    staticInputOptionSpacious();

    ///Thecontentoftheinput.
    StringRefcontent="";

    ///Thecontentoftheinputwhenit'sempty.
    StringRefplaceholder="";

    //Style:
    std::function<Element(InputState)>transform;
    Ref<bool>password=false;///<Obscuretheinputcontentusing'*'.
    Ref<bool>multiline=true;///<Whethertheinputcanbemultiline.
    Ref<bool>insert=true;///<Insertorovertypecharactermode.

    ///Calledwhenthecontentchanges.
    std::function<void()>on_change=[]{};
    ///Calledwhentheuserpressesenter.
    std::function<void()>on_enter=[]{};

    //Thecharpositionofthecursor:
    Ref<int>cursor_position=0;
    };

    ///@briefOptionfortheRadioboxcomponent.
    ///@ingroupcomponent
    structRadioboxOption{
    //Standardconstructors:
    staticRadioboxOptionSimple();

    //Content:
    ConstStringListRefentries;
    Ref<int>selected=0;

    //Style:
    std::function<Element(constEntryState&)>transform;

    //Observers:
    ///Calledwhentheselectedentrychanges.
    std::function<void()>on_change=[]{};
    Ref<int>focused_entry=0;
    };

    structResizableSplitOption{
    Componentmain;
    Componentback;
    Ref<Direction>direction=Direction::Left;
    Ref<int>main_size=
    (direction()==Direction::Left||direction()==Direction::Right)?20
    :10;
    std::function<Element()>separator_func=[]{return::ftxui::separator();};
    };

    //@briefOptionforthe`Slider`component.
    //@ingroupcomponent
    template<typenameT>
    structSliderOption{
    Ref<T>value;
    ConstRef<T>min=T(0);
    ConstRef<T>max=T(100);
    ConstRef<T>increment=(max()-min())/20;
    Directiondirection=Direction::Right;
    Colorcolor_active=Color::White;
    Colorcolor_inactive=Color::GrayDark;
    std::function<void()>on_change;///>Calledwhen`value`isupdated.
    };

    //Parameterpackusedby`WindowOptions::render`.
    structWindowRenderState{
    Elementinner;///<Theelementwrappedinsidethiswindow.
    conststd::string&title;///<Thetitleofthewindow.
    boolactive=false;///<Whetherthewindowistheactiveone.
    booldrag=false;///<Whetherthewindowisbeingdragged.
    boolresize=false;///<Whetherthewindowisbeingresized.
    boolhover_left=false;///<Whethertheresizeableleftsideishovered.
    boolhover_right=false;///<Whethertheresizeablerightsideishovered.
    boolhover_top=false;///<Whethertheresizeabletopsideishovered.
    boolhover_down=false;///<Whethertheresizeabledownsideishovered.
    };

    //@briefOptionforthe`Window`component.
    //@ingroupcomponent
    structWindowOptions{
    Componentinner;///<Thecomponentwrappedbythiswindow.
    ConstStringReftitle="";///<Thetitledisplayedbythiswindow.

    Ref<int>left=0;///<Theleftsidepositionofthewindow.
    Ref<int>top=0;///<Thetopsidepositionofthewindow.
    Ref<int>width=20;///<Thewidthofthewindow.
    Ref<int>height=10;///<Theheightofthewindow.

    Ref<bool>resize_left=true;///<Cantheleftsideberesized?
    Ref<bool>resize_right=true;///<Cantherightsideberesized?
    Ref<bool>resize_top=true;///<Canthetopsideberesized?
    Ref<bool>resize_down=true;///<Canthedownsideberesized?

    ///Anoptionalfunctiontocustomizehowthewindowlookslike:
    std::function<Element(constWindowRenderState&)>render;
    };

    ///@briefOptionfortheDropdowncomponent.
    ///@ingroupcomponent
    ///Adropdownmenuisacheckboxopening/closingaradiobox.
    structDropdownOption{
    ///Whetherthedropdownisopenorclosed:
    Ref<bool>open=false;
    //Theoptionsforthecheckbox:
    CheckboxOptioncheckbox;
    //Theoptionsfortheradiobox:
    RadioboxOptionradiobox;
    //Thetransformationfunction:
    std::function<Element(boolopen,Elementcheckbox,Elementradiobox)>
    transform;
    };

    }//namespaceftxui

    #endif/*endofincludeguard:FTXUI_COMPONENT_COMPONENT_OPTIONS_HPP*/