Kexi API Documentation (2.0 alpha)

KFormDesigner::WidgetLibrary Class Reference

#include <widgetlibrary.h>

List of all members.


Detailed Description

This class searches for factories and provides KActions for widget creation.

Every widget can be located using this library. You call WidgetLibrary functions instead of calling directly factories. See WidgetFactory for a description of the functions.

Definition at line 56 of file widgetlibrary.h.

Signals

void prepareInsert (const QCString &c)

Public Member Functions

 WidgetLibrary (QObject *parent=0, const QStringList &supportedFactoryGroups=QStringList())
virtual ~WidgetLibrary ()
ActionList createWidgetActions (KXMLGUIClient *client, KActionCollection *parent, QObject *receiver, const char *slot)
 creates actions for widget creating
void addCustomWidgetActions (KActionCollection *col)
QWidgetcreateWidget (const QCString &classname, QWidget *parent, const char *name, Container *c, int options=WidgetFactory::DefaultOptions)
 searches the right factory and creates a widget.
bool createMenuActions (const QCString &c, QWidget *w, QPopupMenu *menu, KFormDesigner::Container *container)
WidgetFactory::CreateWidgetOptions showOrientationSelectionPopup (const QCString &classname, QWidget *parent, const QPoint &pos)
 Shows orientation selection popup.
QString internalProperty (const QCString &classname, const QCString &property)
QString displayName (const QCString &classname)
QString namePrefix (const QCString &classname)
QString textForWidgetName (const QCString &name, const QCString &className)
QCString classNameForAlternate (const QCString &classname)
QString iconName (const QCString &classname)
QString includeFileName (const QCString &classname)
QString savingName (const QCString &classname)
bool startEditing (const QCString &classname, QWidget *w, Container *container)
bool previewWidget (const QCString &classname, QWidget *widget, Container *container)
bool clearWidgetContent (const QCString &classname, QWidget *w)
bool saveSpecialProperty (const QCString &classname, const QString &name, const QVariant &value, QWidget *w, QDomElement &parentNode, QDomDocument &parent)
bool readSpecialProperty (const QCString &classname, QDomElement &node, QWidget *w, ObjectTreeItem *item)
bool isPropertyVisible (const QCString &classname, QWidget *w, const QCString &property, bool multiple=false, bool isTopLevel=false)
QValueList< QCString > autoSaveProperties (const QCString &classname)
WidgetInfowidgetInfoForClassName (const char *classname)
WidgetFactoryfactoryForClassName (const char *className)
WidgetFactoryfactory (const char *factoryName) const
bool advancedPropertiesVisible () const
void setAdvancedPropertiesVisible (bool set)
QString propertyDescForName (WidgetInfo *winfo, const QCString &propertyName)
QString propertyDescForValue (WidgetInfo *winfo, const QCString &name)
void setPropertyOptions (WidgetPropertySet &list, const WidgetInfo &winfo, QWidget *w)
bool propertySetShouldBeReloadedAfterPropertyChange (const QCString &classname, QWidget *w, const QCString &property)

Protected Member Functions

void loadFactoryWidgets (WidgetFactory *f)
 Adds a factory to the library, creates actions for widgets in the added factory.
void lookupFactories ()
 Lookups widget factories list (note that this function get called once in ctor).
void loadFactories ()
 Loads widget factories found in lookupFactories().

Protected Attributes

WidgetLibraryPrivate * d


Constructor & Destructor Documentation

WidgetLibrary::WidgetLibrary QObject *  parent = 0,
const QStringList &  supportedFactoryGroups = QStringList()
 

Constructs WidgetLibrary object. In supportedFactoryGroups you can provide factory group list to be supported. Factory groups are defined by "X-KFormDesigner-FactoryGroup" field in every factory serviece's .desktop file. By default (when supportedFactoryGroups is empty) only factories having empty "X-KFormDesigner-FactoryGroup" field will be loaded. Factory group names are case-insensitive.

Definition at line 109 of file widgetlibrary.cpp.

References d, and lookupFactories().

WidgetLibrary::~WidgetLibrary  )  [virtual]
 

Definition at line 121 of file widgetlibrary.cpp.

References d.


Member Function Documentation

void WidgetLibrary::addCustomWidgetActions KActionCollection *  col  ) 
 

Definition at line 350 of file widgetlibrary.cpp.

References d.

Referenced by KFormDesigner::FormManager::createActions().

bool WidgetLibrary::advancedPropertiesVisible  )  const
 

Returns:
true if advanced properties like "mouseTracking" should be user-visible. True by default (in KFD), but Kexi set's this to false. See WidgetLibraryPrivate class implementation for complete list of advanced properties.

Definition at line 569 of file widgetlibrary.cpp.

References d.

QValueList< QCString > WidgetLibrary::autoSaveProperties const QCString &  classname  ) 
 

Definition at line 608 of file widgetlibrary.cpp.

References KFormDesigner::WidgetInfo::className(), d, KFormDesigner::WidgetInfo::factory(), KFormDesigner::WidgetInfo::inheritedClass(), and loadFactories().

QCString WidgetLibrary::classNameForAlternate const QCString &  classname  ) 
 

Checks if the classname is an alternate classname, and returns the good classname. If classname is not alternate, classname is returned.

Definition at line 496 of file widgetlibrary.cpp.

References d, and loadFactories().

bool WidgetLibrary::clearWidgetContent const QCString &  classname,
QWidget w
 

Definition at line 432 of file widgetlibrary.cpp.

References KFormDesigner::WidgetInfo::className(), d, KFormDesigner::WidgetInfo::factory(), KFormDesigner::WidgetInfo::inheritedClass(), and loadFactories().

bool WidgetLibrary::createMenuActions const QCString &  c,
QWidget w,
QPopupMenu *  menu,
KFormDesigner::Container container
 

Definition at line 380 of file widgetlibrary.cpp.

References KFormDesigner::WidgetInfo::className(), d, KFormDesigner::WidgetInfo::factory(), KFormDesigner::WidgetInfo::inheritedClass(), and loadFactories().

QWidget * WidgetLibrary::createWidget const QCString &  classname,
QWidget parent,
const char *  name,
Container c,
int  options = WidgetFactory::DefaultOptions
 

searches the right factory and creates a widget.

Returns:
the widget or 0 if something falid

Definition at line 361 of file widgetlibrary.cpp.

References KFormDesigner::WidgetInfo::className(), d, KFormDesigner::WidgetInfo::factory(), KFormDesigner::WidgetInfo::inheritedClass(), and loadFactories().

Referenced by KFormDesigner::CreateLayoutCommand::execute().

ActionList WidgetLibrary::createWidgetActions KXMLGUIClient *  client,
KActionCollection *  parent,
QObject *  receiver,
const char *  slot
 

creates actions for widget creating

Definition at line 321 of file widgetlibrary.cpp.

References d, loadFactories(), and prepareInsert().

Referenced by KFormDesigner::FormManager::createActions().

QString WidgetLibrary::displayName const QCString &  classname  ) 
 

Definition at line 448 of file widgetlibrary.cpp.

References d, loadFactories(), and KFormDesigner::WidgetInfo::name().

WidgetFactory * WidgetLibrary::factory const char *  factoryName  )  const
 

Definition at line 685 of file widgetlibrary.cpp.

References d.

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

WidgetFactory * WidgetLibrary::factoryForClassName const char *  className  ) 
 

Definition at line 630 of file widgetlibrary.cpp.

References KFormDesigner::WidgetInfo::factory(), and widgetInfoForClassName().

Referenced by KFormDesigner::WidgetFactory::editor().

QString WidgetLibrary::iconName const QCString &  classname  ) 
 

Definition at line 523 of file widgetlibrary.cpp.

References d, loadFactories(), and KFormDesigner::WidgetInfo::pixmap().

Referenced by showOrientationSelectionPopup().

QString WidgetLibrary::includeFileName const QCString &  classname  ) 
 

Definition at line 512 of file widgetlibrary.cpp.

References d, KFormDesigner::WidgetInfo::includeFileName(), and loadFactories().

Referenced by KFormDesigner::FormIO::saveWidget().

QString WidgetLibrary::internalProperty const QCString &  classname,
const QCString &  property
 

Definition at line 690 of file widgetlibrary.cpp.

References d, KFormDesigner::WidgetInfo::factory(), KFormDesigner::WidgetInfo::inheritedClass(), and loadFactories().

bool WidgetLibrary::isPropertyVisible const QCString &  classname,
QWidget w,
const QCString &  property,
bool  multiple = false,
bool  isTopLevel = false
 

Definition at line 575 of file widgetlibrary.cpp.

References KFormDesigner::WidgetInfo::className(), d, KFormDesigner::WidgetInfo::factory(), KFormDesigner::WidgetInfo::inheritedClass(), and loadFactories().

void WidgetLibrary::loadFactories  )  [protected]
 

Loads widget factories found in lookupFactories().

This is called once.

Definition at line 230 of file widgetlibrary.cpp.

References d, loadFactoryWidgets(), KFormDesigner::WidgetFactory::m_hiddenClasses, KFormDesigner::WidgetFactory::m_library, KFormDesigner::WidgetFactory::m_showAdvancedProperties, and KFormDesigner::WidgetFactory::m_xmlGUIFileName.

Referenced by autoSaveProperties(), classNameForAlternate(), clearWidgetContent(), createMenuActions(), createWidget(), createWidgetActions(), displayName(), iconName(), includeFileName(), internalProperty(), isPropertyVisible(), namePrefix(), previewWidget(), readSpecialProperty(), saveSpecialProperty(), savingName(), showOrientationSelectionPopup(), startEditing(), textForWidgetName(), and widgetInfoForClassName().

void WidgetLibrary::loadFactoryWidgets WidgetFactory f  )  [protected]
 

Adds a factory to the library, creates actions for widgets in the added factory.

This function is not called directly but by the factory locater.

Definition at line 127 of file widgetlibrary.cpp.

References KFormDesigner::WidgetInfo::addAlternateClassName(), KFormDesigner::WidgetInfo::alternateClassNames(), KFormDesigner::WidgetFactory::classes(), KFormDesigner::WidgetInfo::className(), d, KFormDesigner::WidgetInfo::description(), foreach, KFormDesigner::WidgetInfo::includeFileName(), KFormDesigner::WidgetInfo::isOverriddenClassName(), KFormDesigner::WidgetInfo::m_alternateNames, KFormDesigner::WidgetFactory::m_classesByName, KFormDesigner::WidgetInfo::m_inheritedClass, KFormDesigner::WidgetInfo::m_inheritedClassName, KFormDesigner::WidgetInfo::m_parentFactoryName, KFormDesigner::WidgetInfo::name(), KFormDesigner::WidgetInfo::namePrefix(), KFormDesigner::WidgetInfo::pixmap(), KFormDesigner::WidgetInfo::setDescription(), KFormDesigner::WidgetInfo::setIncludeFileName(), KFormDesigner::WidgetInfo::setName(), KFormDesigner::WidgetInfo::setNamePrefix(), and KFormDesigner::WidgetInfo::setPixmap().

Referenced by loadFactories().

void WidgetLibrary::lookupFactories  )  [protected]
 

Lookups widget factories list (note that this function get called once in ctor).

Definition at line 195 of file widgetlibrary.cpp.

References d, and KFormDesigner::version().

Referenced by WidgetLibrary().

QString WidgetLibrary::namePrefix const QCString &  classname  ) 
 

Definition at line 471 of file widgetlibrary.cpp.

References d, loadFactories(), and KFormDesigner::WidgetInfo::namePrefix().

void KFormDesigner::WidgetLibrary::prepareInsert const QCString &  c  )  [signal]
 

Referenced by createWidgetActions().

bool WidgetLibrary::previewWidget const QCString &  classname,
QWidget widget,
Container container
 

Definition at line 416 of file widgetlibrary.cpp.

References KFormDesigner::WidgetInfo::className(), d, KFormDesigner::WidgetInfo::factory(), KFormDesigner::WidgetInfo::inheritedClass(), and loadFactories().

Referenced by KFormDesigner::Form::setDesignMode().

QString WidgetLibrary::propertyDescForName WidgetInfo winfo,
const QCString &  propertyName
 

Returns:
The i18n'ed name of the property propertyName for a class described by winfo. The name can be displayed in PropertyEditor. The name is retrieved from class' widget library. If this library doesn't define description for such property, and there is a parent library for winfo defined, parent library is asked for returning description string. Eventually, if even this failed, empty string is returned.
See also:
WidgetFactory::propertyDescForName()

Definition at line 636 of file widgetlibrary.cpp.

References d, KFormDesigner::WidgetInfo::factory(), KFormDesigner::WidgetInfo::m_parentFactoryName, and KFormDesigner::WidgetFactory::propertyDescForName().

QString WidgetLibrary::propertyDescForValue WidgetInfo winfo,
const QCString &  name
 

Returns:
The i18n'ed name of the property's value whose name is name. Works in the same way as propertyDescForName(): if actual library does not define a description we are looking for, parent factory is asked to return such description. Eventually, if even this failed, empty string is returned.
See also:
WidgetFactory::propertyDescForValue()

Definition at line 654 of file widgetlibrary.cpp.

References d, and KFormDesigner::WidgetFactory::propertyDescForValue().

bool WidgetLibrary::propertySetShouldBeReloadedAfterPropertyChange const QCString &  classname,
QWidget w,
const QCString &  property
 

Returns:
true if property sets should be reloaded for property property, classname class and widget w when a given property value changed.

Definition at line 755 of file widgetlibrary.cpp.

References KFormDesigner::WidgetInfo::factory(), and widgetInfoForClassName().

bool WidgetLibrary::readSpecialProperty const QCString &  classname,
QDomElement &  node,
QWidget w,
ObjectTreeItem item
 

Definition at line 550 of file widgetlibrary.cpp.

References KFormDesigner::WidgetInfo::className(), d, KFormDesigner::WidgetInfo::factory(), KFormDesigner::WidgetInfo::inheritedClass(), and loadFactories().

bool WidgetLibrary::saveSpecialProperty const QCString &  classname,
const QString name,
const QVariant &  value,
QWidget w,
QDomElement &  parentNode,
QDomDocument &  parent
 

Definition at line 534 of file widgetlibrary.cpp.

References KFormDesigner::WidgetInfo::className(), d, KFormDesigner::WidgetInfo::factory(), KFormDesigner::WidgetInfo::inheritedClass(), and loadFactories().

Referenced by KFormDesigner::FormIO::savePropertyValue().

QString WidgetLibrary::savingName const QCString &  classname  ) 
 

Definition at line 459 of file widgetlibrary.cpp.

References d, loadFactories(), and KFormDesigner::WidgetInfo::savingName().

Referenced by KFormDesigner::FormIO::saveWidget().

void WidgetLibrary::setAdvancedPropertiesVisible bool  set  ) 
 

Sets advanced properties to be visible or not.

Definition at line 564 of file widgetlibrary.cpp.

References d.

Referenced by KexiFormPart::KexiFormPart(), and KexiReportPart::KexiReportPart().

void WidgetLibrary::setPropertyOptions WidgetPropertySet list,
const WidgetInfo winfo,
QWidget w
 

Used by WidgetPropertySet::setWidget() after creating properties.

Definition at line 672 of file widgetlibrary.cpp.

References d, KFormDesigner::WidgetInfo::factory(), KFormDesigner::WidgetInfo::m_parentFactoryName, and KFormDesigner::WidgetFactory::setPropertyOptions().

WidgetFactory::CreateWidgetOptions WidgetLibrary::showOrientationSelectionPopup const QCString &  classname,
QWidget parent,
const QPoint &  pos
 

Shows orientation selection popup.

Returns:
one of the following values:

Definition at line 702 of file widgetlibrary.cpp.

References KFormDesigner::WidgetFactory::AnyOrientation, d, KFormDesigner::WidgetInfo::factory(), KFormDesigner::WidgetFactory::HorizontalOrientation, iconName(), KFormDesigner::WidgetInfo::inheritedClass(), loadFactories(), KFormDesigner::WidgetInfo::name(), KFormDesigner::WidgetInfo::pixmap(), and KFormDesigner::WidgetFactory::VerticalOrientation.

bool WidgetLibrary::startEditing const QCString &  classname,
QWidget w,
Container container
 

Definition at line 400 of file widgetlibrary.cpp.

References KFormDesigner::WidgetInfo::className(), d, KFormDesigner::WidgetInfo::factory(), KFormDesigner::WidgetInfo::inheritedClass(), and loadFactories().

QString WidgetLibrary::textForWidgetName const QCString &  name,
const QCString &  className
 

Definition at line 482 of file widgetlibrary.cpp.

References d, loadFactories(), KFormDesigner::WidgetInfo::name(), and KFormDesigner::WidgetInfo::namePrefix().

WidgetInfo * WidgetLibrary::widgetInfoForClassName const char *  classname  ) 
 

Definition at line 623 of file widgetlibrary.cpp.

References d, and loadFactories().

Referenced by factoryForClassName(), and propertySetShouldBeReloadedAfterPropertyChange().


Member Data Documentation

WidgetLibraryPrivate* KFormDesigner::WidgetLibrary::d [protected]
 

Definition at line 204 of file widgetlibrary.h.

Referenced by addCustomWidgetActions(), advancedPropertiesVisible(), autoSaveProperties(), classNameForAlternate(), clearWidgetContent(), createMenuActions(), createWidget(), createWidgetActions(), displayName(), factory(), iconName(), includeFileName(), internalProperty(), isPropertyVisible(), loadFactories(), loadFactoryWidgets(), lookupFactories(), namePrefix(), previewWidget(), propertyDescForName(), propertyDescForValue(), readSpecialProperty(), saveSpecialProperty(), savingName(), setAdvancedPropertiesVisible(), setPropertyOptions(), showOrientationSelectionPopup(), startEditing(), textForWidgetName(), widgetInfoForClassName(), WidgetLibrary(), and ~WidgetLibrary().


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