okular/core/form.cpp
Pino Toscano db8a10dc2c Preliminary supports for text and choice form fields.
This includes:
- the interfaces for the generators
- the basic widgets for editing their value
- a top bar for show/hide the forms of a document
- the implementation of the forms for the PDF backend
still nothing that can be done with them, nor the value of the forms can be saved...
... but it's a start! :-)

svn path=/trunk/playground/graphics/okular/; revision=637001
2007-02-25 00:07:59 +00:00

111 lines
1.9 KiB
C++

/***************************************************************************
* Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
// local includes
#include "form.h"
using namespace Okular;
FormField::FormField( FormField::FieldType t )
: m_type( t )
{
}
FormField::~FormField()
{
}
FormField::FieldType FormField::type() const
{
return m_type;
}
bool FormField::isReadOnly() const
{
return false;
}
bool FormField::isVisible() const
{
return true;
}
FormFieldText::FormFieldText()
: FormField( FormField::FormText )
{
}
FormFieldText::~FormFieldText()
{
}
void FormFieldText::setText( const QString& )
{
}
bool FormFieldText::isPassword() const
{
return false;
}
bool FormFieldText::isRichText() const
{
return false;
}
int FormFieldText::maximumLength() const
{
return -1;
}
Qt::Alignment FormFieldText::textAlignment() const
{
return Qt::AlignVCenter | Qt::AlignLeft;
}
bool FormFieldText::canBeSpellChecked() const
{
return false;
}
FormFieldChoice::FormFieldChoice()
: FormField( FormField::FormChoice )
{
}
FormFieldChoice::~FormFieldChoice()
{
}
bool FormFieldChoice::isEditable() const
{
return false;
}
bool FormFieldChoice::multiSelect() const
{
return false;
}
void FormFieldChoice::setCurrentChoices( const QList< int >& )
{
}
Qt::Alignment FormFieldChoice::textAlignment() const
{
return Qt::AlignVCenter | Qt::AlignLeft;
}
bool FormFieldChoice::canBeSpellChecked() const
{
return false;
}