gphoto2pp
A C++ Wrapper for libgphoto2
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
gphoto2pp::CameraWidgetWrapper Class Reference

#include <camera_widget_wrapper.hpp>

Inheritance diagram for gphoto2pp::CameraWidgetWrapper:

Public Member Functions

virtual ~CameraWidgetWrapper ()
 CameraWidgetWrapper (CameraWidgetWrapper &&other)
CameraWidgetWrapperoperator= (CameraWidgetWrapper &&other)
 CameraWidgetWrapper (CameraWidgetWrapper const &other)
CameraWidgetWrapperoperator= (CameraWidgetWrapper const &other)
gphoto2::_CameraWidget * getPtr () const
 Gets the raw resource RAII indicates we still should allow our users access to the RAW Resource and it is applicable.
std::string getName () const
 Gets the widget's name.
CameraWidgetTypeWrapper getType () const
 Gets the widget's type.
std::string getLabel () const
 Gets the widget's label.
std::string getInfo () const
 Gets the widget's info.
int getId () const
 Gets the widget's unique id.
CameraWidgetWrapper getRoot () const
 Gets the widget's Root. This is likely going to be the Window Widget (same widget from ICameraWrapper::getConfig()).
CameraWidgetWrapper getParent () const
 Gets the widget's parent. This is the immediate parent of the widget. If the current widget is a leaf node, then this is likely a Section Widget, but could also be a Window Widget.

Protected Member Functions

 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.

Protected Attributes

gphoto2::_CameraWidget * m_cameraWidget = nullptr

Detailed Description

This class provides a RAII wrapper around the gphoto2 CameraWidget struct. In the gphoto2 the camera's abilities are represented by an N-ary tree.

Gphoto2 has 9 node types. 7 of them compose the leaf nodes of the tree and contian read, or read/write values. 2 of them (window and section) are non value widgets, and represent the internal nodes with 1 or more children.

Every camera abilities tree has Only 1 root node, which is always of type Window. Then this can have n children, typically they are Section widgets.

Please review the above graphical tree to look at the inheritance hierarchy of the widget types to understand the underlying value they each represent.

Type Value Node Type
Window N/A Root
Section N/A Non Leaf
Text string Leaf
Range float Leaf
Toggle int Leaf
Radio string Leaf
Menu string Leaf
Button N/A Leaf
Date time_t Leaf

Constructor & Destructor Documentation

virtual gphoto2pp::CameraWidgetWrapper::~CameraWidgetWrapper ( )
virtual
gphoto2pp::CameraWidgetWrapper::CameraWidgetWrapper ( CameraWidgetWrapper &&  other)
gphoto2pp::CameraWidgetWrapper::CameraWidgetWrapper ( CameraWidgetWrapper const &  other)
gphoto2pp::CameraWidgetWrapper::CameraWidgetWrapper ( gphoto2::_CameraWidget *  cameraWidget)
protected

Member Function Documentation

int gphoto2pp::CameraWidgetWrapper::getId ( ) const

Gets the widget's unique id.

Returns
the widget's id
Note
Direct wrapper for gp_widget_get_id(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
std::string gphoto2pp::CameraWidgetWrapper::getInfo ( ) const

Gets the widget's info.

Returns
the widget info
Note
Direct wrapper for gp_widget_get_info(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
std::string gphoto2pp::CameraWidgetWrapper::getLabel ( ) const

Gets the widget's label.

Returns
the widget label
Note
Direct wrapper for gp_widget_get_label(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
std::string gphoto2pp::CameraWidgetWrapper::getName ( ) const

Gets the widget's name.

Returns
the widget name
Note
Direct wrapper for gp_widget_get_name(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
CameraWidgetWrapper gphoto2pp::CameraWidgetWrapper::getParent ( ) const

Gets the widget's parent. This is the immediate parent of the widget. If the current widget is a leaf node, then this is likely a Section Widget, but could also be a Window Widget.

Returns
the parent widget
Note
Direct wrapper for gp_widget_get_parent(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
gphoto2::_CameraWidget* gphoto2pp::CameraWidgetWrapper::getParentDefault ( ) const
protected

Gets the unwrapped CameraWidget struct pointer of the parent.

Note
Direct wrapper for gp_widget_get_root(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
gphoto2::_CameraWidget* gphoto2pp::CameraWidgetWrapper::getPtr ( ) const

Gets the raw resource RAII indicates we still should allow our users access to the RAW Resource and it is applicable.

Returns
the gphoto2 CameraWidget struct
CameraWidgetWrapper gphoto2pp::CameraWidgetWrapper::getRoot ( ) const

Gets the widget's Root. This is likely going to be the Window Widget (same widget from ICameraWrapper::getConfig()).

Returns
the root widget
Note
Direct wrapper for gp_widget_get_root(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
gphoto2::_CameraWidget* gphoto2pp::CameraWidgetWrapper::getRootDefault ( ) const
protected

Gets the unwrapped CameraWidget struct pointer of the root.

Note
Direct wrapper for gp_widget_get_root(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
CameraWidgetTypeWrapper gphoto2pp::CameraWidgetWrapper::getType ( ) const

Gets the widget's type.

Returns
the widget type
Note
Direct wrapper for gp_widget_get_type(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
CameraWidgetWrapper& gphoto2pp::CameraWidgetWrapper::operator= ( CameraWidgetWrapper &&  other)
CameraWidgetWrapper& gphoto2pp::CameraWidgetWrapper::operator= ( CameraWidgetWrapper const &  other)
void gphoto2pp::CameraWidgetWrapper::ref ( )
protected

Adds a reference count to the internal gphoto2::CameraWidget struct.

Note
Direct wrapper for gp_widget_ref(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
void gphoto2pp::CameraWidgetWrapper::unref ( )
protected

Subtracts a reference count to the internal gphoto2::CameraWidget struct.

Note
Direct wrapper for gp_widget_unref(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception

Member Data Documentation

gphoto2::_CameraWidget* gphoto2pp::CameraWidgetWrapper::m_cameraWidget = nullptr
protected

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