Fawkes API  Fawkes Development Version
fawkes::MultiInterfaceChooserDialog Class Reference

Blackboard interface chooser dialog that supports multiple choices. More...

#include <>>

Inheritance diagram for fawkes::MultiInterfaceChooserDialog:

Classes

class  Record
 Blackboard interface record. More...
 

Public Types

typedef std::pair< Glib::ustring, Glib::ustring > TypeIdPair
 Pair of type and IDs of interfaces. More...
 
typedef std::list< TypeIdPairTypeIdPairList
 List of type and ID of an interface. More...
 

Public Member Functions

virtual ~MultiInterfaceChooserDialog ()
 Destructor. More...
 
TypeIdPairList get_selected_interfaces () const
 Get selected interface types and their respective IDs. More...
 
TypeIdPairList get_newly_selected_interfaces () const
 Get selected interface types and their respective IDs. More...
 
- Public Member Functions inherited from fawkes::InterfaceChooserDialog
virtual ~InterfaceChooserDialog ()
 Destructor. More...
 
void get_selected_interface (Glib::ustring &type, Glib::ustring &id)
 Get selected interface type and ID. More...
 
fawkes::Interfacerun_and_open_for_reading ()
 Run dialog and try to connect. More...
 

Static Public Member Functions

static MultiInterfaceChooserDialogcreate (Gtk::Window &parent, BlackBoard *blackboard, const char *type_pattern, const char *id_pattern, const TypeIdPairList &loaded_interfaces, const Glib::ustring &title=DEFAULT_TITLE)
 Factory method. More...
 
- Static Public Member Functions inherited from fawkes::InterfaceChooserDialog
static InterfaceChooserDialogcreate (Gtk::Window &parent, BlackBoard *blackboard, const char *type_pattern, const char *id_pattern, const Glib::ustring &title=DEFAULT_TITLE)
 Factory method. More...
 

Protected Member Functions

 MultiInterfaceChooserDialog (Gtk::Window &parent, const TypeIdPairList &loaded_interfaces, const Glib::ustring &title)
 Constructor for subclasses. More...
 
virtual const Recordrecord () const
 Returns the Record of this chooser dialog. More...
 
virtual int init_columns ()
 Initializes the columns GUI-wise. More...
 
virtual void init_row (Gtk::TreeModel::Row &row, const InterfaceInfo &ii)
 Initializes a row with the given interface. More...
 
- Protected Member Functions inherited from fawkes::InterfaceChooserDialog
 InterfaceChooserDialog (Gtk::Window &parent, const Glib::ustring &title)
 Constructor for subclasses. More...
 
void init (BlackBoard *blackboard, const char *type_pattern, const char *id_pattern)
 Initialization method. More...
 

Additional Inherited Members

- Static Public Attributes inherited from fawkes::InterfaceChooserDialog
static const char *const DEFAULT_TITLE = "Select Interfaces"
 Default title of interface chooser dialogs. More...
 
- Protected Attributes inherited from fawkes::InterfaceChooserDialog
Gtk::TreeView __treeview
 Tree widget for interfaces. More...
 
Glib::RefPtr< Gtk::ListStore > __model
 Data model of the tree. More...
 

Detailed Description

Blackboard interface chooser dialog that supports multiple choices.

Allows to choose multiple blackboard interfaces from a list of interfaces matching given type and ID patterns.

Author
Christoph Schwering

Definition at line 34 of file multi_interface_chooser_dialog.h.

Member Typedef Documentation

◆ TypeIdPair

typedef std::pair<Glib::ustring, Glib::ustring> fawkes::MultiInterfaceChooserDialog::TypeIdPair

Pair of type and IDs of interfaces.

Definition at line 38 of file multi_interface_chooser_dialog.h.

◆ TypeIdPairList

List of type and ID of an interface.

Definition at line 40 of file multi_interface_chooser_dialog.h.

Constructor & Destructor Documentation

◆ ~MultiInterfaceChooserDialog()

fawkes::MultiInterfaceChooserDialog::~MultiInterfaceChooserDialog ( )
virtual

◆ MultiInterfaceChooserDialog()

fawkes::MultiInterfaceChooserDialog::MultiInterfaceChooserDialog ( Gtk::Window &  parent,
const TypeIdPairList loaded_interfaces,
const Glib::ustring &  title 
)
protected

Constructor for subclasses.

After calling this constructor, the init() method needs to be called.

Parameters
parentparent window
loaded_interfaceslist of interfaces which are already loaded
titletitle of the dialog

Definition at line 99 of file multi_interface_chooser_dialog.cpp.

References fawkes::InterfaceChooserDialog::__treeview.

Referenced by create().

Member Function Documentation

◆ create()

MultiInterfaceChooserDialog * fawkes::MultiInterfaceChooserDialog::create ( Gtk::Window &  parent,
BlackBoard blackboard,
const char *  type_pattern,
const char *  id_pattern,
const TypeIdPairList loaded_interfaces,
const Glib::ustring &  title = DEFAULT_TITLE 
)
static

Factory method.

Why a factory method instead of a ctor? The factory method calls init(), and init() calls other virtual methods. If this was a ctor, this ctor would not be allowed to be called by subclasses, because then the virtual methods in init() don't dispatch the right way during construction (see Effective C++ #9).

Parameters
parentparent window
blackboardblackboard instance to query interfaces from
type_patternpattern with shell like globs (* for any number of characters, ? for exactly one character) to match the interface type.
id_patternpattern with shell like globs (* for any number of characters, ? for exactly one character) to match the interface ID.
loaded_interfaceslist of interfaces which are already loaded
titletitle of the dialog
Returns
new MultiInterfaceChooserDialog

Definition at line 76 of file multi_interface_chooser_dialog.cpp.

References fawkes::InterfaceChooserDialog::init(), and MultiInterfaceChooserDialog().

Referenced by LaserGuiGtkWindow::on_select_clicked().

◆ get_newly_selected_interfaces()

MultiInterfaceChooserDialog::TypeIdPairList fawkes::MultiInterfaceChooserDialog::get_newly_selected_interfaces ( ) const

Get selected interface types and their respective IDs.

Returns
A list of type + id pairs of interfaces that are to be loaded, and NOT contained in the list of loaded interfaces handed over to create().

Definition at line 220 of file multi_interface_chooser_dialog.cpp.

References fawkes::InterfaceChooserDialog::__model, fawkes::MultiInterfaceChooserDialog::Record::load, and record().

◆ get_selected_interfaces()

MultiInterfaceChooserDialog::TypeIdPairList fawkes::MultiInterfaceChooserDialog::get_selected_interfaces ( ) const

Get selected interface types and their respective IDs.

Returns
A list of type + id pairs of interfaces that are to be loaded.

Definition at line 195 of file multi_interface_chooser_dialog.cpp.

References fawkes::InterfaceChooserDialog::__model, fawkes::MultiInterfaceChooserDialog::Record::load, and record().

◆ init_columns()

int fawkes::MultiInterfaceChooserDialog::init_columns ( )
protectedvirtual

Initializes the columns GUI-wise.

Called in the ctor. Subclasses of InterfaceChooserDialog might want to override this method, but should probably still call their super-class's implementation (i.e., this one).

Returns
The number of columns added.

Reimplemented from fawkes::InterfaceChooserDialog.

Definition at line 155 of file multi_interface_chooser_dialog.cpp.

References fawkes::InterfaceChooserDialog::__treeview, fawkes::InterfaceChooserDialog::init_columns(), and record().

◆ init_row()

void fawkes::MultiInterfaceChooserDialog::init_row ( Gtk::TreeModel::Row &  row,
const InterfaceInfo ii 
)
protectedvirtual

Initializes a row with the given interface.

Called in the ctor. Subclasses of InterfaceChooserDialog might want to override this method, but should probably still call their super-class's implementation (i.e., this one).

Parameters
rowThe row whose content is to be set.
iiThe interface info that should populate the row.

Reimplemented from fawkes::InterfaceChooserDialog.

Definition at line 182 of file multi_interface_chooser_dialog.cpp.

References fawkes::InterfaceInfo::id(), fawkes::InterfaceChooserDialog::init_row(), fawkes::MultiInterfaceChooserDialog::Record::load, record(), and fawkes::InterfaceInfo::type().

◆ record()

const MultiInterfaceChooserDialog::Record & fawkes::MultiInterfaceChooserDialog::record ( ) const
protectedvirtual

Returns the Record of this chooser dialog.

Subclasses of InterfaceChooserDialog might want to override this method.

Returns
Record implementation.

Reimplemented from fawkes::InterfaceChooserDialog.

Definition at line 137 of file multi_interface_chooser_dialog.cpp.

Referenced by get_newly_selected_interfaces(), get_selected_interfaces(), init_columns(), init_row(), and ~MultiInterfaceChooserDialog().


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