![]() |
LeechCraft Monocle
0.6.70-13729-g7046a9d2a7
Modular document viewer for LeechCraft
|
Interface to be implemented by choice fields. More...
#include "iformfield.h"
Public Types | |
enum | Type { Type::Combobox, Type::ListBox } |
Describes various types of choice fields. More... | |
Public Member Functions | |
virtual | ~IFormFieldChoice () |
Virtual destructor. More... | |
virtual Type | GetChoiceType () const =0 |
Returns the exact type of this choice field. More... | |
virtual QStringList | GetAllChoices () const =0 |
Returns all available choices. More... | |
virtual QList< int > | GetCurrentChoices () const =0 |
Returns the list of current choices for a listbox. More... | |
virtual void | SetCurrentChoices (const QList< int > &choices)=0 |
Sets the currently selected choices for a listbox. More... | |
virtual QString | GetEditChoice () const =0 |
Returns the current choice for a combobox. More... | |
virtual void | SetEditChoice (const QString &choice)=0 |
Sets the current choice for a combobox. More... | |
virtual bool | IsEditable () const =0 |
Returns whether this combobox is editable. More... | |
Interface to be implemented by choice fields.
If a field is of type FormType::Choice, it should also implement this interface.
Definition at line 233 of file iformfield.h.
|
strong |
Describes various types of choice fields.
Enumerator | |
---|---|
Combobox | Combobox with choices. Only single choice is allowed.
|
ListBox | List widget with choices. Multiple choices are possibly allowed.
|
Definition at line 240 of file iformfield.h.
|
inlinevirtual |
Virtual destructor.
Definition at line 261 of file iformfield.h.
|
pure virtual |
Returns all available choices.
This method returns the list of all available choices for both Type::Combobox and Type::ListBox choice fields.
Please note that user can enter his own choice variant for Type::Combobox fields that are editable.
|
pure virtual |
Returns the exact type of this choice field.
|
pure virtual |
Returns the list of current choices for a listbox.
This method returns the currently selected variants in a Type::ListBox choice field. It does nothing for other types of fields.
The numbers in the returned list are the indexes of the choices in the array returned by GetAllChoices().
|
pure virtual |
Returns the current choice for a combobox.
This method returns the current choice in a Type::Combobox choice field. The returned value can be either one of the variants in the list returned by GetAllChoices() or it can be a custom text if this combobox is editable (that is, IsEditable() returns true).
For other types of choice fields this method does nothing.
|
pure virtual |
Returns whether this combobox is editable.
This method returns whether this Type::Combobox choice field is editable — that is, whether custom user text can be passed to the SetEditChoice() method.
For other types of fields this method doesn't make sense and always returns false
.
|
pure virtual |
Sets the currently selected choices for a listbox.
This method sets the currently selected variants in a Type::ListBox choice field. It does nothing for other types of fields.
The numbers in the choices list are the indexes of the choices in the array returned by GetAllChoices().
|
pure virtual |
Sets the current choice for a combobox.
This method updates the current choice in a Type::Combobox choice field. The choice can be either one of the variants in the list returned by GetAllChoices() or it can be a custom text if this combobox is editable (that is, IsEditable() returns true).
For other types of choice fields this method does nothing.
[in] | choice | The new choice, either predefined one or a custom one for an editable combobox. |