kexi

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)
void widgetCreated (QWidget *widget)

Public Member Functions

 WidgetLibrary (QObject *parent=0, const QStringList &supportedFactoryGroups=QStringList())
virtual ~WidgetLibrary ()
ActionList createWidgetActions (KXMLGUIClient *client, KActionCollection *parent, QObject *receiver, const char *slot)
void addCustomWidgetActions (KActionCollection *col)
QWidget * createWidget (const QCString &classname, QWidget *parent, const char *name, Container *c, int options=WidgetFactory::DefaultOptions)
bool createMenuActions (const QCString &c, QWidget *w, QPopupMenu *menu, KFormDesigner::Container *container)
WidgetFactory::CreateWidgetOptions showOrientationSelectionPopup (const QCString &classname, QWidget *parent, const QPoint &pos)
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)
void lookupFactories ()
void loadFactories ()

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 110 of file widgetlibrary.cpp.


Member Function Documentation

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

creates actions for widget creating

Definition at line 322 of file widgetlibrary.cpp.

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 362 of file widgetlibrary.cpp.

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 707 of file widgetlibrary.cpp.

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 501 of file widgetlibrary.cpp.

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 574 of file widgetlibrary.cpp.

void WidgetLibrary::setAdvancedPropertiesVisible ( bool  set  ) 

Sets advanced properties to be visible or not.

Definition at line 569 of file widgetlibrary.cpp.

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 641 of file widgetlibrary.cpp.

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 659 of file widgetlibrary.cpp.

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

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

Definition at line 677 of file widgetlibrary.cpp.

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 760 of file widgetlibrary.cpp.

void KFormDesigner::WidgetLibrary::widgetCreated ( QWidget *  widget  )  [signal]

Received by KexiFormPart::slotWidgetCreatedByFormsLibrary() so we can add drag/drop connection for the new widget.

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 128 of file widgetlibrary.cpp.

void WidgetLibrary::lookupFactories (  )  [protected]

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

Definition at line 196 of file widgetlibrary.cpp.

void WidgetLibrary::loadFactories (  )  [protected]

Loads widget factories found in lookupFactories().

This is called once.

Todo:
improve

Definition at line 231 of file widgetlibrary.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys