LeechCraft Monocle  0.6.70-6645-gcd10d7e
Modular document viewer for LeechCraft
LeechCraft::Monocle::IFormField Class Referenceabstract

Base interface to be implemented by form fields. More...

#include "iformfield.h"

Public Member Functions

virtual ~IFormField ()
 Virtual destructor. More...
 
virtual FormType GetType () const =0
 Returns the type of this field. More...
 
virtual int GetID () const =0
 Returns the unique ID of this field. More...
 
virtual QString GetName () const =0
 Returns the user-visible name of this field. More...
 
virtual QRectF GetRect () const =0
 Returns the rectangle this field occupies. More...
 
virtual Qt::Alignment GetAlignment () const =0
 Returns the alignment of the contents of this field. More...
 

Detailed Description

Base interface to be implemented by form fields.

This is a base interface that should be implemented by all form fields disregarding their type. Depending on the type of this field returned by the GetType() method the corresponding class should also implement other interfaces. See FormType documentation for details.

As a general rule, there is no "Apply" method in form interfaces. Instead, changes should be applied as soon as corresponding interface's setter method is called.

See also
IFormFieldText, IFormFieldChoice, IFormFieldButton

Definition at line 86 of file iformfield.h.

Constructor & Destructor Documentation

virtual LeechCraft::Monocle::IFormField::~IFormField ( )
inlinevirtual

Virtual destructor.

Definition at line 91 of file iformfield.h.

Member Function Documentation

virtual Qt::Alignment LeechCraft::Monocle::IFormField::GetAlignment ( ) const
pure virtual

Returns the alignment of the contents of this field.

This method returns, for example, text alignment in a text entry field or options alignment in a list widget.

Returns
The alignment of the contents of this field.
virtual int LeechCraft::Monocle::IFormField::GetID ( ) const
pure virtual

Returns the unique ID of this field.

The ID should be unique across the whole document.

Returns
The unique ID of this field.
virtual QString LeechCraft::Monocle::IFormField::GetName ( ) const
pure virtual

Returns the user-visible name of this field.

Returns
The human-readable name of this field.
virtual QRectF LeechCraft::Monocle::IFormField::GetRect ( ) const
pure virtual

Returns the rectangle this field occupies.

All fields occupy a fixed area on the page and cannot grow or shrink depending on their content. This method returns the rectangle of the area that this field should occupy.

The returned rectangle is expected to be in relative page coordinates — that is, with width and height in [0; 1] range, 0 meaning left or top and 1 meaning right or bottom.

Returns
The rectangle this field occupies in relative page coordinates.
virtual FormType LeechCraft::Monocle::IFormField::GetType ( ) const
pure virtual

Returns the type of this field.

Returns
The type of this field.

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