![]() |
LeechCraft Monocle
0.6.70-6645-gcd10d7e
Modular document viewer for LeechCraft
|
Interface to be implemented by button fields. More...
#include "iformfield.h"
Public Types | |
enum | Type { Type::Pushbutton, Type::Checkbox, Type::Radiobutton } |
Describes various types of button fields. More... | |
Public Member Functions | |
virtual | ~IFormFieldButton () |
Virtual destructor. More... | |
virtual Type | GetButtonType () const =0 |
Returns the exact type of this button field. More... | |
virtual QString | GetCaption () const =0 |
Returns the caption of this button. More... | |
virtual bool | IsChecked () const =0 |
Returns whether the button is checked. More... | |
virtual void | SetChecked (bool state)=0 |
Updates the check state of this button. More... | |
virtual QList< int > | GetButtonGroup () const =0 |
Returns the button group this button belongs to. More... | |
virtual void | HandleActivated ()=0 |
Notifies the field that it has been triggered. More... | |
Interface to be implemented by button fields.
If a field is of type FormType::Button, it should also implement this interface.
Definition at line 366 of file iformfield.h.
|
strong |
Describes various types of button fields.
Enumerator | |
---|---|
Pushbutton |
A button that can be pushed.
|
Checkbox |
A field that can be checked independently of others.
|
Radiobutton |
A field that can be checked with respect to the check state of others.
|
Definition at line 377 of file iformfield.h.
|
inlinevirtual |
Virtual destructor.
Definition at line 371 of file iformfield.h.
|
pure virtual |
Returns the button group this button belongs to.
This method returns the list of IDs (returned by the IFormField::GetID() method) that form the same button group, where only one button at a time can be checked.
If an empty list is returned, it is interpreted as if the button doesn't belong to any button groups.
The returned list should be sorted and contain the self ID (the ID of the field that returns the list).
This method only makes sense for buttons of Type::Radiobutton.
|
pure virtual |
Returns the exact type of this button field.
|
pure virtual |
Returns the caption of this button.
This method should return the user-visible text on the button which may be way different form IFormField::GetName().
|
pure virtual |
Notifies the field that it has been triggered.
This method is invoked by Monocle when the corresponding field is triggered. Currently it only means that a field of Type::Pushbutton is activated by the user, and this method is never invoked for other types of fields.
|
pure virtual |
Returns whether the button is checked.
This method doesn't make sense for Type::Pushbutton buttons.
|
pure virtual |
Updates the check state of this button.
If the type of this button is Type::Radiobutton and this radio button belongs to a group (GetButtonGroup() returns a non-empty list), setting the check state to code true leads to setting the check state of the previously checked radio button to false.
This method doesn't make sense for Type::Pushbutton and thus does nothing for push buttons.
[in] | state | The new check state of this radio button or check box. |