Medical Imaging Interaction Toolkit  2024.06.99-692c34ce
Medical Imaging Interaction Toolkit
mitk::Forms::Form Class Reference

#include <mitkForm.h>

Classes

class  Section
 

Public Member Functions

 Form (const std::string &title="", const std::string &description="")
 
 ~Form ()
 
 Form (Form &&other) noexcept
 
Formoperator= (Form &&other) noexcept
 
SectionAddSection (const std::string &title="", const std::string &description="")
 
int GetNumberOfSections () const
 
SectionGetSection (int index)
 
const SectionGetSection (int index) const
 
std::string GetTitle () const
 
void SetTitle (const std::string &title)
 
std::string GetDescription () const
 
void SetDescription (const std::string &description)
 
std::vector< Question * > GetQuestions () const
 
void AddQuestion (Question *question)
 
void AddSupplement (const std::string &key)
 Add extra data that is submitted together with the responses. More...
 
bool SetSupplement (const std::string &key, const std::string &value)
 Set the value of a certain existing supplement. More...
 
const std::map< std::string, std::string > & GetSupplements () const
 
std::vector< Section >::const_iterator begin () const
 
std::vector< Section >::const_iterator end () const
 
std::vector< Section >::iterator begin ()
 
std::vector< Section >::iterator end ()
 

Detailed Description

A form consisting of questions possibly divided into multiple sections/pages.

A form always has at least a single section, which is also used to define the form's general title and description. Helper methods like SetTitle() or SetDescription() can be used to conveniently set these properties of the first section.

Definition at line 36 of file mitkForm.h.

Constructor & Destructor Documentation

◆ Form() [1/2]

mitk::Forms::Form::Form ( const std::string &  title = "",
const std::string &  description = "" 
)
explicit

◆ ~Form()

mitk::Forms::Form::~Form ( )

◆ Form() [2/2]

mitk::Forms::Form::Form ( Form &&  other)
noexcept

Member Function Documentation

◆ AddQuestion()

void mitk::Forms::Form::AddQuestion ( Question question)

◆ AddSection()

Section& mitk::Forms::Form::AddSection ( const std::string &  title = "",
const std::string &  description = "" 
)

◆ AddSupplement()

void mitk::Forms::Form::AddSupplement ( const std::string &  key)

Add extra data that is submitted together with the responses.

Supplements are a rudimentary and delicate feature to add extra data to submissions, i.e., extra columns for CSV submissions.

Supplements are key-value pairs supposed to be completely set up before the first submission. Afterwards, do not add any new supplements. Values of existing supplements can be safely modified, though.

Note
Do not add new supplements after the first submission.
Submissions do not clear any supplements or their values.

◆ begin() [1/2]

std::vector<Section>::iterator mitk::Forms::Form::begin ( )

◆ begin() [2/2]

std::vector<Section>::const_iterator mitk::Forms::Form::begin ( ) const

◆ end() [1/2]

std::vector<Section>::iterator mitk::Forms::Form::end ( )

◆ end() [2/2]

std::vector<Section>::const_iterator mitk::Forms::Form::end ( ) const

◆ GetDescription()

std::string mitk::Forms::Form::GetDescription ( ) const

◆ GetNumberOfSections()

int mitk::Forms::Form::GetNumberOfSections ( ) const

◆ GetQuestions()

std::vector<Question*> mitk::Forms::Form::GetQuestions ( ) const

◆ GetSection() [1/2]

Section& mitk::Forms::Form::GetSection ( int  index)

◆ GetSection() [2/2]

const Section& mitk::Forms::Form::GetSection ( int  index) const

◆ GetSupplements()

const std::map<std::string, std::string>& mitk::Forms::Form::GetSupplements ( ) const

◆ GetTitle()

std::string mitk::Forms::Form::GetTitle ( ) const

◆ operator=()

Form& mitk::Forms::Form::operator= ( Form &&  other)
noexcept

◆ SetDescription()

void mitk::Forms::Form::SetDescription ( const std::string &  description)

◆ SetSupplement()

bool mitk::Forms::Form::SetSupplement ( const std::string &  key,
const std::string &  value 
)

Set the value of a certain existing supplement.

Returns
true if the supplement exists, false otherwise.
See also
AddSupplement()

◆ SetTitle()

void mitk::Forms::Form::SetTitle ( const std::string &  title)

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