#include <choices_widget.hpp>
Public Member Functions |
int | countChoices () const |
| Counts the number of choices/options to set for this widget.
|
int | getChoice () const |
| Gets the currently set choice at the specified index.
|
void | setChoice (int index) |
| Sets the choice at the specified index.
|
std::vector< std::string > | getChoices () const |
| Gets all the possible choices.
|
std::string | choiceToString (int index) const |
| Gets the string representation of the choice at the specified index.
|
std::string | choicesToString (std::string &&separator=" ") const |
| Formats the choices into a string with optional separator.
|
std::string | getValue () const override |
| Gets the widget's value in terms of std::string.
|
void | setValue (std::string const &value) override |
| Sets the widget's value in terms of std::string.
|
Protected Member Functions |
| ChoicesWidget (gphoto2::_CameraWidget *cameraWidget) |
| StringWidget (gphoto2::_CameraWidget *cameraWidget) |
| ValueWidgetBase (gphoto2::_CameraWidget *cameraWidget) |
| CameraWidgetWrapper (gphoto2::_CameraWidget *cameraWidget) |
void | ref () |
| Adds a reference count to the internal gphoto2::CameraWidget struct.
|
void | unref () |
| Subtracts a reference count to the internal gphoto2::CameraWidget struct.
|
gphoto2::_CameraWidget * | getRootDefault () const |
| Gets the unwrapped CameraWidget struct pointer of the root.
|
gphoto2::_CameraWidget * | getParentDefault () const |
| Gets the unwrapped CameraWidget struct pointer of the parent.
|
Additional Inherited Members |
gphoto2::_CameraWidget * | m_cameraWidget = nullptr |
Detailed Description
A class representing gphoto2 widgets which are of the widget type GPhoto2pp::CameraWidgetTypeWrapper::Menu or GPhoto2pp::CameraWidgetTypeWrapper::Radio
Constructor & Destructor Documentation
gphoto2pp::ChoicesWidget::ChoicesWidget |
( |
gphoto2::_CameraWidget * |
cameraWidget | ) |
|
|
protected |
Member Function Documentation
std::string gphoto2pp::ChoicesWidget::choicesToString |
( |
std::string && |
separator = " " | ) |
const |
Formats the choices into a string with optional separator.
- Parameters
-
[in] | separator | used to insert inbetween all the choices for concatenation |
- Returns
- the string of choices
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
std::string gphoto2pp::ChoicesWidget::choiceToString |
( |
int |
index | ) |
const |
Gets the string representation of the choice at the specified index.
- Parameters
-
[in] | index | of the choice to get |
- Returns
- the choices value
- Note
- Direct wrapper for
gp_widget_get_choice(...)
- Exceptions
-
GPhoto2pp::exceptions::IndexOutOfRange | if the index is greater than countChoices of choices |
GPhoto2pp::exceptions::gphoto2_exception | |
int gphoto2pp::ChoicesWidget::countChoices |
( |
| ) |
const |
Counts the number of choices/options to set for this widget.
- Returns
- the number of choices
- Note
- Direct wrapper for
gp_widget_count_choices(...)
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
int gphoto2pp::ChoicesWidget::getChoice |
( |
| ) |
const |
Gets the currently set choice at the specified index.
- Returns
- the choices index
- Note
- Direct wrapper for
gp_widget_get_choice(...)
- Exceptions
-
GPhoto2pp::exceptions::IndexOutOfRange | if the index is greater than countChoices of choices |
GPhoto2pp::exceptions::gphoto2_exception | |
std::vector<std::string> gphoto2pp::ChoicesWidget::getChoices |
( |
| ) |
const |
Gets all the possible choices.
- Returns
- the choices
- Note
- Helper which iterates through all choices compiling them into a vector
- Exceptions
-
GPhoto2pp::exceptions::gphoto2_exception | |
void gphoto2pp::ChoicesWidget::setChoice |
( |
int |
index | ) |
|
Sets the choice at the specified index.
- Parameters
-
[in] | index | of the choice to set |
- Note
- Helper which calls getChoice with the provided index and then setValue with the response
- Exceptions
-
GPhoto2pp::exceptions::IndexOutOfRange | if the index is greater than countChoices |
GPhoto2pp::exceptions::gphoto2_exception | |
Friends And Related Function Documentation
The documentation for this class was generated from the following files: