Kexi API Documentation (2.0 alpha)

KFormDesigner::WidgetInfo Class Reference

#include <widgetfactory.h>

Inheritance diagram for KFormDesigner::WidgetInfo:

KexiDataAwareWidgetInfo List of all members.

Detailed Description

This class holds properties of widget classes provided by a factory.

Definition at line 65 of file widgetfactory.h.

Public Types

typedef QPtrList< WidgetInfoList
typedef QAsciiDict< WidgetInfoDict

Public Member Functions

 WidgetInfo (WidgetFactory *f)
 WidgetInfo (WidgetFactory *f, const char *parentFactoryName, const char *inheritedClassName=0)
virtual ~WidgetInfo ()
QString pixmap () const
QCString className () const
QString namePrefix () const
QString name () const
QString description () const
QString includeFileName () const
QValueList< QCString > alternateClassNames () const
QString savingName () const
WidgetFactoryfactory () const
void setPixmap (const QString &p)
void setClassName (const QCString &s)
void setName (const QString &n)
void setNamePrefix (const QString &n)
void setDescription (const QString &desc)
void setIncludeFileName (const QString &name)
void addAlternateClassName (const QCString &alternateName, bool override=false)
bool isOverriddenClassName (const QCString &alternateName) const
void setSavingName (const QString &saveName)
void setAutoSyncForProperty (const char *propertyName, tristate flag)
tristate autoSyncForProperty (const char *propertyName) const
QCString parentFactoryName () const
WidgetInfoinheritedClass () const
void setCustomTypeForProperty (const char *propertyName, int type)
int customTypeForProperty (const char *propertyName) const

Protected Attributes

QCString m_parentFactoryName
QCString m_inheritedClassName
 Used for inheriting widgets between factories.
WidgetInfom_inheritedClass

Friends

class WidgetLibrary


Member Typedef Documentation

typedef QAsciiDict<WidgetInfo> KFormDesigner::WidgetInfo::Dict
 

Definition at line 69 of file widgetfactory.h.

typedef QPtrList<WidgetInfo> KFormDesigner::WidgetInfo::List
 

Definition at line 68 of file widgetfactory.h.


Constructor & Destructor Documentation

WidgetInfo::WidgetInfo WidgetFactory f  ) 
 

Definition at line 58 of file widgetfactory.cpp.

WidgetInfo::WidgetInfo WidgetFactory f,
const char *  parentFactoryName,
const char *  inheritedClassName = 0
 

Definition at line 67 of file widgetfactory.cpp.

WidgetInfo::~WidgetInfo  )  [virtual]
 

Definition at line 80 of file widgetfactory.cpp.


Member Function Documentation

void WidgetInfo::addAlternateClassName const QCString &  alternateName,
bool  override = false
 

Sets alternate names for this class. If this name is found when loading a .ui file, the className() will be used instead. It allows to support both KDE and Qt versions of widget, without duplicating code. As a rule, className() should always return a class name which is inherited from alternate class. For example KListView class has alternate QListView class.

override parameter overrides class name of a widget, even if it was implemented in other factory. By default it's set to false, what means that no other class is overridden by this widget class if there is already a class implementing it (no matter in which factory). By forced overriding existing class with other - custom, user will be able to see more or less properties and experience different behaviour. For example, in Kexi application, KLineEdit class contains additional "datasource" property for binding to database sources.

Definition at line 87 of file widgetfactory.cpp.

Referenced by ContainerFactory::ContainerFactory(), KexiDBFactory::KexiDBFactory(), KFormDesigner::WidgetLibrary::loadFactoryWidgets(), and StdWidgetFactory::StdWidgetFactory().

QValueList<QCString> KFormDesigner::WidgetInfo::alternateClassNames  )  const [inline]
 

Definition at line 92 of file widgetfactory.h.

Referenced by KFormDesigner::WidgetLibrary::loadFactoryWidgets().

tristate WidgetInfo::autoSyncForProperty const char *  propertyName  )  const
 

Returns:
autoSync override value (true or false) for propertyName. If cancelled value is returned, there is no overriding (the default).

Definition at line 122 of file widgetfactory.cpp.

References cancelled.

QCString KFormDesigner::WidgetInfo::className  )  const [inline]
 

Returns:
the class name of a widget e.g. 'QLineEdit'

Definition at line 81 of file widgetfactory.h.

Referenced by KFormDesigner::WidgetFactory::addClass(), KFormDesigner::WidgetLibrary::autoSaveProperties(), KFormDesigner::WidgetLibrary::clearWidgetContent(), KFormDesigner::WidgetLibrary::createMenuActions(), KFormDesigner::WidgetLibrary::createWidget(), KFormDesigner::WidgetLibrary::isPropertyVisible(), KFormDesigner::LibActionWidget::LibActionWidget(), KFormDesigner::WidgetLibrary::loadFactoryWidgets(), KFormDesigner::WidgetLibrary::previewWidget(), KFormDesigner::WidgetLibrary::readSpecialProperty(), KFormDesigner::WidgetLibrary::saveSpecialProperty(), and KFormDesigner::WidgetLibrary::startEditing().

int WidgetInfo::customTypeForProperty const char *  propertyName  )  const
 

Returns:
custom type for property propertyName. If no specific custom type has been assigned, KoProperty::Auto is returned.
See also:
setCustomTypeForProperty()

Definition at line 140 of file widgetfactory.cpp.

QString KFormDesigner::WidgetInfo::description  )  const [inline]
 

Definition at line 90 of file widgetfactory.h.

Referenced by KFormDesigner::LibActionWidget::LibActionWidget(), and KFormDesigner::WidgetLibrary::loadFactoryWidgets().

WidgetFactory* KFormDesigner::WidgetInfo::factory  )  const [inline]
 

Definition at line 94 of file widgetfactory.h.

Referenced by KFormDesigner::WidgetLibrary::autoSaveProperties(), KFormDesigner::WidgetLibrary::clearWidgetContent(), KFormDesigner::WidgetLibrary::createMenuActions(), KFormDesigner::WidgetLibrary::createWidget(), KFormDesigner::WidgetLibrary::factoryForClassName(), KFormDesigner::WidgetLibrary::internalProperty(), KFormDesigner::WidgetLibrary::isPropertyVisible(), KFormDesigner::WidgetLibrary::previewWidget(), KFormDesigner::WidgetLibrary::propertyDescForName(), KFormDesigner::WidgetLibrary::propertySetShouldBeReloadedAfterPropertyChange(), KFormDesigner::WidgetLibrary::readSpecialProperty(), KFormDesigner::WidgetLibrary::saveSpecialProperty(), KFormDesigner::WidgetLibrary::setPropertyOptions(), KFormDesigner::WidgetLibrary::showOrientationSelectionPopup(), and KFormDesigner::WidgetLibrary::startEditing().

QString KFormDesigner::WidgetInfo::includeFileName  )  const [inline]
 

Definition at line 91 of file widgetfactory.h.

Referenced by KFormDesigner::WidgetLibrary::includeFileName(), and KFormDesigner::WidgetLibrary::loadFactoryWidgets().

WidgetInfo* KFormDesigner::WidgetInfo::inheritedClass  )  const [inline]
 

Definition at line 151 of file widgetfactory.h.

Referenced by KFormDesigner::WidgetLibrary::autoSaveProperties(), KFormDesigner::WidgetFactory::changeTextInternal(), KFormDesigner::WidgetLibrary::clearWidgetContent(), KFormDesigner::WidgetLibrary::createMenuActions(), KFormDesigner::WidgetLibrary::createWidget(), KFormDesigner::WidgetLibrary::internalProperty(), KFormDesigner::WidgetLibrary::isPropertyVisible(), KFormDesigner::WidgetLibrary::previewWidget(), KFormDesigner::WidgetLibrary::readSpecialProperty(), KFormDesigner::WidgetLibrary::saveSpecialProperty(), KFormDesigner::WidgetLibrary::showOrientationSelectionPopup(), and KFormDesigner::WidgetLibrary::startEditing().

bool WidgetInfo::isOverriddenClassName const QCString &  alternateName  )  const
 

Returns:
true is a class alternateName is defined as alternate name with 'override' flag set to true, using addAlternateClassName(). If this flag is set to false (the default) or there's no such alternate class name defined.

Definition at line 101 of file widgetfactory.cpp.

Referenced by KFormDesigner::WidgetLibrary::loadFactoryWidgets().

QString KFormDesigner::WidgetInfo::name  )  const [inline]
 

Returns:
the real name e.g. 'Line Edit', showed eg in ObjectTreeView

Definition at line 88 of file widgetfactory.h.

Referenced by KFormDesigner::WidgetLibrary::displayName(), KFormDesigner::InsertWidgetCommand::execute(), KFormDesigner::LibActionWidget::LibActionWidget(), KFormDesigner::WidgetLibrary::loadFactoryWidgets(), KFormDesigner::WidgetLibrary::showOrientationSelectionPopup(), and KFormDesigner::WidgetLibrary::textForWidgetName().

QString KFormDesigner::WidgetInfo::namePrefix  )  const [inline]
 

Returns:
the name used to name widget, that will appear eg in scripts (must not contain spaces nor non-latin1 characters)

Definition at line 85 of file widgetfactory.h.

Referenced by KFormDesigner::WidgetLibrary::loadFactoryWidgets(), KFormDesigner::WidgetLibrary::namePrefix(), and KFormDesigner::WidgetLibrary::textForWidgetName().

QCString KFormDesigner::WidgetInfo::parentFactoryName  )  const [inline]
 

Definition at line 149 of file widgetfactory.h.

Referenced by KFormDesigner::WidgetFactory::editor(), KFormDesigner::WidgetFactory::setEditor(), and KFormDesigner::WidgetFactory::setWidget().

QString KFormDesigner::WidgetInfo::pixmap  )  const [inline]
 

Returns:
a pixmap associated with the widget

Definition at line 78 of file widgetfactory.h.

Referenced by KFormDesigner::WidgetLibrary::iconName(), KFormDesigner::WidgetLibrary::loadFactoryWidgets(), and KFormDesigner::WidgetLibrary::showOrientationSelectionPopup().

QString KFormDesigner::WidgetInfo::savingName  )  const [inline]
 

Definition at line 93 of file widgetfactory.h.

Referenced by KFormDesigner::WidgetLibrary::savingName().

void WidgetInfo::setAutoSyncForProperty const char *  propertyName,
tristate  flag
 

Sets autoSync flag for property propertyName. This allows to override autoSync flag for certain widget's property, because e.g. KoProperty::Editor can have autoSync flag set to false or true, but not all properties have to comply with that. flag equal to cancelled value means there is no overriding (the default).

Definition at line 106 of file widgetfactory.cpp.

Referenced by ContainerFactory::ContainerFactory(), KexiDataAwareWidgetInfo::init(), and KexiDBFactory::KexiDBFactory().

void KFormDesigner::WidgetInfo::setClassName const QCString &  s  )  [inline]
 

Definition at line 97 of file widgetfactory.h.

Referenced by ContainerFactory::ContainerFactory(), KexiDBFactory::KexiDBFactory(), KexiReportFactory::KexiReportFactory(), and StdWidgetFactory::StdWidgetFactory().

void WidgetInfo::setCustomTypeForProperty const char *  propertyName,
int  type
 

Sets custom type type for property propertyName. This allows to override default type, especially when custom property and custom property editor item has to be used.

Definition at line 130 of file widgetfactory.cpp.

void KFormDesigner::WidgetInfo::setDescription const QString desc  )  [inline]
 

Definition at line 100 of file widgetfactory.h.

Referenced by ContainerFactory::ContainerFactory(), KexiDBFactory::KexiDBFactory(), KexiReportFactory::KexiReportFactory(), KFormDesigner::WidgetLibrary::loadFactoryWidgets(), and StdWidgetFactory::StdWidgetFactory().

void KFormDesigner::WidgetInfo::setIncludeFileName const QString name  )  [inline]
 

Sets the C++ include file corresponding to this class, that uic will need to add when creating the file. You don't have to set this for Qt std widgets.

Definition at line 104 of file widgetfactory.h.

Referenced by ContainerFactory::ContainerFactory(), KFormDesigner::WidgetLibrary::loadFactoryWidgets(), and StdWidgetFactory::StdWidgetFactory().

void KFormDesigner::WidgetInfo::setName const QString n  )  [inline]
 

Definition at line 98 of file widgetfactory.h.

Referenced by ContainerFactory::ContainerFactory(), KexiDBFactory::KexiDBFactory(), KexiReportFactory::KexiReportFactory(), KFormDesigner::WidgetLibrary::loadFactoryWidgets(), and StdWidgetFactory::StdWidgetFactory().

void KFormDesigner::WidgetInfo::setNamePrefix const QString n  )  [inline]
 

Definition at line 99 of file widgetfactory.h.

Referenced by ContainerFactory::ContainerFactory(), KexiDBFactory::KexiDBFactory(), KexiReportFactory::KexiReportFactory(), KFormDesigner::WidgetLibrary::loadFactoryWidgets(), and StdWidgetFactory::StdWidgetFactory().

void KFormDesigner::WidgetInfo::setPixmap const QString p  )  [inline]
 

Definition at line 96 of file widgetfactory.h.

Referenced by ContainerFactory::ContainerFactory(), KexiDBFactory::KexiDBFactory(), KexiReportFactory::KexiReportFactory(), KFormDesigner::WidgetLibrary::loadFactoryWidgets(), and StdWidgetFactory::StdWidgetFactory().

void KFormDesigner::WidgetInfo::setSavingName const QString saveName  )  [inline]
 

Sets the name that will be written in the .ui file when saving. This name must be one of alternate names (or loading will be impossible).

On form data saving to XML .ui format, saveName is used instead, so .ui format is not broken and still usable with other software as Qt Designer. Custom properties are saved as well with 'stdset' attribute set to 0.

Definition at line 136 of file widgetfactory.h.

Referenced by ContainerFactory::ContainerFactory(), and StdWidgetFactory::StdWidgetFactory().


Friends And Related Function Documentation

friend class WidgetLibrary [friend]
 

Definition at line 181 of file widgetfactory.h.


Member Data Documentation

WidgetInfo* KFormDesigner::WidgetInfo::m_inheritedClass [protected]
 

Definition at line 165 of file widgetfactory.h.

Referenced by KFormDesigner::WidgetLibrary::loadFactoryWidgets().

QCString KFormDesigner::WidgetInfo::m_inheritedClassName [protected]
 

Used for inheriting widgets between factories.

Definition at line 164 of file widgetfactory.h.

Referenced by KFormDesigner::WidgetLibrary::loadFactoryWidgets().

QCString KFormDesigner::WidgetInfo::m_parentFactoryName [protected]
 

Definition at line 164 of file widgetfactory.h.

Referenced by KFormDesigner::WidgetLibrary::loadFactoryWidgets(), KFormDesigner::WidgetLibrary::propertyDescForName(), and KFormDesigner::WidgetLibrary::setPropertyOptions().


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:51:01 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003