Kexi API Documentation (2.0 alpha)

KexiNameWidget Class Reference

#include <kexinamewidget.h>

Inheritance diagram for KexiNameWidget:

QWidget List of all members.

Public Slots

virtual void clear ()
bool checkValidity ()

Signals

void returnPressed ()
void textChanged ()
void messageChanged ()

Public Member Functions

 KexiNameWidget (const QString &message, QWidget *parent=0, const char *name=0, WFlags fl=0)
 KexiNameWidget (const QString &message, const QString &nameLabel, const QString &nameText, const QString &captionLabel, const QString &captionText, QWidget *parent=0, const char *name=0, WFlags fl=0)
virtual ~KexiNameWidget ()
QLabelcaptionLabel () const
QLabelnameLabel () const
KLineEditcaptionLineEdit () const
KLineEditnameLineEdit () const
QString messageText () const
void setMessageText (const QString &msg)
QString captionText () const
void setCaptionText (const QString &capt)
QString nameText () const
void setNameText (const QString &name)
void setWarningForName (const QString &txt)
void setWarningForCaption (const QString &txt)
bool empty () const
KexiUtils::ValidatornameValidator () const
void addNameSubvalidator (KexiUtils::Validator *validator, bool owned=true)
bool isNameRequired () const
void setNameRequired (bool set)
bool isCaptionRequired () const
void setCaptionRequired (bool set)

Protected Slots

void slotNameTxtChanged (const QString &)
void slotCaptionTxtChanged (const QString &)

Protected Member Functions

void init (const QString &message, const QString &nameLabel, const QString &nameText, const QString &captionLabel, const QString &captionText)

Protected Attributes

QLabellbl_message
QLabellbl_caption
QLabellbl_name
KLineEditle_caption
KLineEditle_name
QGridLayout * lyr
KexiUtils::MultiValidatorm_validator
QString m_nameWarning
QString m_captionWarning
bool m_le_name_txtchanged_disable: 1
bool m_le_name_autofill: 1
bool m_caption_required: 1

Friends

class KexiNameDialog

Constructor & Destructor Documentation

KexiNameWidget::KexiNameWidget const QString message,
QWidget parent = 0,
const char *  name = 0,
WFlags  fl = 0
 

Definition at line 35 of file kexinamewidget.cpp.

References init().

KexiNameWidget::KexiNameWidget const QString message,
const QString nameLabel,
const QString nameText,
const QString captionLabel,
const QString captionText,
QWidget parent = 0,
const char *  name = 0,
WFlags  fl = 0
 

Definition at line 42 of file kexinamewidget.cpp.

References init().

KexiNameWidget::~KexiNameWidget  )  [virtual]
 

Definition at line 107 of file kexinamewidget.cpp.


Member Function Documentation

void KexiNameWidget::addNameSubvalidator KexiUtils::Validator validator,
bool  owned = true
 

Adds subvalidator for name field. In fact it's is added to internal multivalidator. If owned is true, validator will be owned by the object.

See also:
MultiValidator::addSubvalidator().

Definition at line 209 of file kexinamewidget.cpp.

References KexiUtils::MultiValidator::addSubvalidator(), and m_validator.

QLabel* KexiNameWidget::captionLabel  )  const [inline]
 

Definition at line 47 of file kexinamewidget.h.

KLineEdit* KexiNameWidget::captionLineEdit  )  const [inline]
 

Definition at line 49 of file kexinamewidget.h.

Referenced by KexiNameDialog::show().

QString KexiNameWidget::captionText  )  const
 

Returns:
entered caption text

Definition at line 172 of file kexinamewidget.cpp.

References le_caption.

Referenced by KexiNameDialog::slotTextChanged().

bool KexiNameWidget::checkValidity  )  [slot]
 

Checks if both fields have valid values (i.e. not empty if acceptsEmptyValue() is false). If not, warning message is shown and false is returned.

Definition at line 182 of file kexinamewidget.cpp.

References KexiUtils::Validator::check(), KexiUtils::Validator::Error, isCaptionRequired(), isNameRequired(), le_caption, le_name, m_captionWarning, m_nameWarning, and m_validator.

Referenced by KexiNameDialog::accept().

void KexiNameWidget::clear  )  [virtual, slot]
 

Clears both name and caption.

Definition at line 131 of file kexinamewidget.cpp.

References le_caption, and le_name.

bool KexiNameWidget::empty  )  const
 

Returns:
true if name or caption is empty.

Definition at line 137 of file kexinamewidget.cpp.

References le_caption, and le_name.

void KexiNameWidget::init const QString message,
const QString nameLabel,
const QString nameText,
const QString captionLabel,
const QString captionText
[protected]
 

Definition at line 54 of file kexinamewidget.cpp.

References lbl_caption, lbl_message, lbl_name, le_caption, le_name, lyr, m_caption_required, m_captionWarning, m_le_name_autofill, m_le_name_txtchanged_disable, m_nameWarning, m_validator, returnPressed(), setMessageText(), slotCaptionTxtChanged(), slotNameTxtChanged(), and textChanged().

Referenced by KexiNameWidget().

bool KexiNameWidget::isCaptionRequired  )  const [inline]
 

Returns:
true if caption text cannot be empty (false by default).

Definition at line 92 of file kexinamewidget.h.

Referenced by checkValidity(), and KexiNameDialog::slotTextChanged().

bool KexiNameWidget::isNameRequired  )  const
 

Returns:
true if name text cannot be empty (true by default).

Definition at line 145 of file kexinamewidget.cpp.

References KexiUtils::Validator::acceptsEmptyValue(), and m_validator.

Referenced by checkValidity(), and KexiNameDialog::slotTextChanged().

void KexiNameWidget::messageChanged  )  [signal]
 

Emitted whenever the message changes

Referenced by setMessageText().

QString KexiNameWidget::messageText  )  const [inline]
 

Definition at line 52 of file kexinamewidget.h.

QLabel* KexiNameWidget::nameLabel  )  const [inline]
 

Definition at line 48 of file kexinamewidget.h.

KLineEdit* KexiNameWidget::nameLineEdit  )  const [inline]
 

Definition at line 50 of file kexinamewidget.h.

QString KexiNameWidget::nameText  )  const
 

Returns:
entered name text, always in lower case

Definition at line 177 of file kexinamewidget.cpp.

References le_name.

Referenced by KexiNameDialog::slotTextChanged().

Validator * KexiNameWidget::nameValidator  )  const
 

Definition at line 204 of file kexinamewidget.cpp.

References m_validator.

void KexiNameWidget::returnPressed  )  [signal]
 

Emitted whenever return key is pressed on name or caption label.

Referenced by init().

void KexiNameWidget::setCaptionRequired bool  set  )  [inline]
 

Definition at line 94 of file kexinamewidget.h.

void KexiNameWidget::setCaptionText const QString capt  ) 
 

Definition at line 148 of file kexinamewidget.cpp.

References le_caption, and m_le_name_autofill.

void KexiNameWidget::setMessageText const QString msg  ) 
 

Definition at line 160 of file kexinamewidget.cpp.

References lbl_message, and messageChanged().

Referenced by init().

void KexiNameWidget::setNameRequired bool  set  ) 
 

Definition at line 142 of file kexinamewidget.cpp.

References m_validator, and KexiUtils::Validator::setAcceptsEmptyValue().

void KexiNameWidget::setNameText const QString name  ) 
 

Definition at line 154 of file kexinamewidget.cpp.

References le_name, and m_le_name_autofill.

void KexiNameWidget::setWarningForCaption const QString txt  )  [inline]
 

Sets i18n'ed warning message displayed when user leaves 'name' field without filling it (if acceptsEmptyValue() is false). By default the message is equal "Please enter the caption."

Definition at line 74 of file kexinamewidget.h.

void KexiNameWidget::setWarningForName const QString txt  )  [inline]
 

Sets i18n'ed warning message displayed when user leaves 'name' field without filling it (if acceptsEmptyValue() is false). By default the message is equal "Please enter the name.".

Definition at line 69 of file kexinamewidget.h.

void KexiNameWidget::slotCaptionTxtChanged const QString  )  [protected, slot]
 

Definition at line 111 of file kexinamewidget.cpp.

References le_name, m_le_name_autofill, m_le_name_txtchanged_disable, KexiUtils::string2Identifier(), and textChanged().

Referenced by init().

void KexiNameWidget::slotNameTxtChanged const QString  )  [protected, slot]
 

Definition at line 123 of file kexinamewidget.cpp.

References m_le_name_autofill, m_le_name_txtchanged_disable, and textChanged().

Referenced by init().

void KexiNameWidget::textChanged  )  [signal]
 

Emitted whenever the caption or the name text changes

Referenced by init(), slotCaptionTxtChanged(), and slotNameTxtChanged().


Friends And Related Function Documentation

friend class KexiNameDialog [friend]
 

Definition at line 139 of file kexinamewidget.h.


Member Data Documentation

QLabel* KexiNameWidget::lbl_caption [protected]
 

Definition at line 127 of file kexinamewidget.h.

Referenced by init().

QLabel* KexiNameWidget::lbl_message [protected]
 

Definition at line 126 of file kexinamewidget.h.

Referenced by init(), setMessageText(), and KexiNameDialog::updateSize().

QLabel* KexiNameWidget::lbl_name [protected]
 

Definition at line 128 of file kexinamewidget.h.

Referenced by init().

KLineEdit* KexiNameWidget::le_caption [protected]
 

Definition at line 129 of file kexinamewidget.h.

Referenced by captionText(), checkValidity(), clear(), empty(), init(), and setCaptionText().

KLineEdit* KexiNameWidget::le_name [protected]
 

Definition at line 130 of file kexinamewidget.h.

Referenced by checkValidity(), clear(), empty(), init(), nameText(), setNameText(), and slotCaptionTxtChanged().

QGridLayout* KexiNameWidget::lyr [protected]
 

Definition at line 131 of file kexinamewidget.h.

Referenced by init().

bool KexiNameWidget::m_caption_required [protected]
 

Definition at line 137 of file kexinamewidget.h.

Referenced by init().

QString KexiNameWidget::m_captionWarning [protected]
 

Definition at line 133 of file kexinamewidget.h.

Referenced by checkValidity(), and init().

bool KexiNameWidget::m_le_name_autofill [protected]
 

Definition at line 136 of file kexinamewidget.h.

Referenced by init(), setCaptionText(), setNameText(), slotCaptionTxtChanged(), and slotNameTxtChanged().

bool KexiNameWidget::m_le_name_txtchanged_disable [protected]
 

Definition at line 135 of file kexinamewidget.h.

Referenced by init(), slotCaptionTxtChanged(), and slotNameTxtChanged().

QString KexiNameWidget::m_nameWarning [protected]
 

Definition at line 133 of file kexinamewidget.h.

Referenced by checkValidity(), and init().

KexiUtils::MultiValidator* KexiNameWidget::m_validator [protected]
 

Definition at line 132 of file kexinamewidget.h.

Referenced by addNameSubvalidator(), checkValidity(), init(), isNameRequired(), nameValidator(), and setNameRequired().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:50:13 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003