14 #ifndef ZYPP_TUI_OUTPUT_PROMPTOPTIONS_H_INCLUDED 15 #define ZYPP_TUI_OUTPUT_PROMPTOPTIONS_H_INCLUDED 59 PromptOptions(
const std::string & optionstr_r,
unsigned defaultOpt_r );
66 void setOptions(
const std::string & optionstr_r,
unsigned defaultOpt_r );
77 void setOptionHelp(
unsigned opt,
const std::string & help_str);
99 std::string
replyMatchesStr(
const std::vector<int> & matches_r )
const;
121 #endif // ZYPP_TUI_OUTPUT_PROMPTOPTIONS_H_INCLUDED int _shown_count
Number of options to show (the rest will still be available and visible through '?' help).
std::vector< int > getReplyMatches(const std::string &reply_r) const
Return the indices of option string matches (lowercase/prefix or #NUM).
void enable(unsigned opt)
Colored string if do_colors.
void setShownCount(unsigned count)
bool isYesNoPrompt() const
unsigned defaultOpt() const
void disable(unsigned opt)
Example: PromptOptions popts; popts.setOptions(_("y/n/p"), 0 / * default reply * /); popts...
PromptOptions()
Default c-tor.
unsigned shownCount() const
bool isEnabled(unsigned opt) const
std::set< unsigned > _disabled
set of options to ignore
const StrVector & options() const
unsigned _default
index of the default option
bool isDisabled(unsigned opt) const
void setOptionHelp(unsigned opt, const std::string &help_str)
std::string replyMatchesStr(const std::vector< int > &matches_r) const
The returned reply matches as '(,)' list.
ColorString optionString() const
Option string (may have embedded color codes)
const std::string & optionHelp(unsigned opt) const
StrVector _opt_help
help strings corresponding to options
void setOptions(StrVector options_r, unsigned defaultOpt_r)
std::vector< std::string > StrVector
StrVector _options
option strings