KFormDesigner::FormManager Class Reference
#include <formmanager.h>
Inheritance diagram for KFormDesigner::FormManager:

Detailed Description
This is Form Designer's main class, which is used by external APIs to access FormDesigner.This is the class you have to use to integrate FormDesigner into another program. It deals with creating, saving and loading Form, as well as widget insertion and copying. It also ensures all the components (ObjectTreeView, Form and PropertyEditor) are synced, and link them. It holds the WidgetLibrary, the WidgetPropertySet, links to ObjectTreeView and PropertyEditor, as well as the copied widget and the insert state.
Definition at line 72 of file formmanager.h.
Public Types | |
| enum | Options { HideEventsInPopupMenu = 1, SkipFileActions = 2, HideSignalSlotConnections = 4 } |
Public Slots | |
| void | deleteWidget () |
| void | copyWidget () |
| void | cutWidget () |
| void | pasteWidget () |
| void | selectAll () |
| void | clearWidgetContent () |
| void | undo () |
| void | redo () |
| void | editTabOrder () |
| void | adjustWidgetSize () |
| void | editFormPixmapCollection () |
| void | editConnections () |
| void | layoutHBox () |
| Lay out selected widgets using HBox layout (calls CreateLayoutCommand). | |
| void | layoutVBox () |
| Lay out selected widgets using VBox layout. | |
| void | layoutGrid () |
| Lay out selected widgets using Grid layout. | |
| void | layoutHSplitter () |
| Lay out selected widgets in an horizontal splitter. | |
| void | layoutVSplitter () |
| Lay out selected widgets in a verticak splitter. | |
| void | layoutHFlow () |
| Lay out selected widgets using HFlow layout. | |
| void | layoutVFlow () |
| Lay out selected widgets using VFlow layout. | |
| void | breakLayout () |
| Breaks selected layout(calls BreakLayoutCommand). | |
| void | alignWidgetsToLeft () |
| void | alignWidgetsToRight () |
| void | alignWidgetsToTop () |
| void | alignWidgetsToBottom () |
| void | alignWidgetsToGrid () |
| void | adjustSizeToGrid () |
| void | adjustWidthToSmall () |
| Resize all selected widgets to the width of the narrowest widget. | |
| void | adjustWidthToBig () |
| Resize all selected widgets to the width of the widest widget. | |
| void | adjustHeightToSmall () |
| Resize all selected widgets to the height of the shortest widget. | |
| void | adjustHeightToBig () |
| Resize all selected widgets to the height of the tallest widget. | |
| void | bringWidgetToFront () |
| void | sendWidgetToBack () |
| void | insertWidget (const QCString &classname) |
| void | stopInsert () |
| void | slotPointerClicked () |
| Slot called when the user presses 'Pointer' icon. Switch to Default mode. | |
| void | startCreatingConnection () |
| Enter the Connection creation mode. | |
| void | stopCreatingConnection () |
| Leave the Connection creation mode. | |
| void | windowChanged (QWidget *w) |
| void | deleteWidgetLater (QWidget *w) |
| Used to delayed widgets' deletion (in Container::deleteItem()). | |
| void | showFormUICode () |
| void | changeFont () |
Signals | |
| void | propertySetSwitched (KoProperty::Set *set, bool forceReload=false, const QCString &propertyToSelect=QCString()) |
| void | dirty (KFormDesigner::Form *form, bool isDirty=true) |
| void | widgetSelected (KFormDesigner::Form *form, bool multiple) |
| void | formWidgetSelected (KFormDesigner::Form *form) |
| void | noFormSelected () |
| void | undoEnabled (bool enabled, const QString &text=QString::null) |
| void | redoEnabled (bool enabled, const QString &text=QString::null) |
| void | createFormSlot (KFormDesigner::Form *form, const QString &widget, const QString &signal) |
| void | connectionCreated (KFormDesigner::Form *form, KFormDesigner::Connection &connection) |
| void | connectionAborted (KFormDesigner::Form *form) |
| void | autoTabStopsSet (KFormDesigner::Form *form, bool set) |
| void | aboutToDeleteForm (KFormDesigner::Form *form) |
| void | formCreated (KFormDesigner::Form *form) |
Public Member Functions | |
| FormManager (QObject *parent=0, int options=0, const char *name=0) | |
| virtual | ~FormManager () |
| ActionList | createActions (WidgetLibrary *lib, KActionCollection *collection, KXMLGUIClient *client) |
| virtual void | enableAction (const char *name, bool enable)=0 |
| virtual KAction * | action (const char *name)=0 |
| bool | isPasteEnabled () |
| WidgetPropertySet * | propertySet () const |
| bool | isInserting () const |
| QCString | selectedClass () const |
| void | setInsertPoint (const QPoint &p) |
| bool | isCreatingConnection () |
| Connection * | createdConnection () |
| void | resetCreatedConnection () |
| void | createSignalMenu (QWidget *w) |
| Creates and display a menu with all the signals of widget w. | |
| void | createSlotMenu (QWidget *w) |
| Creates and display a menu with all the slots of widget w. | |
| void | emitCreateSlot (const QString &widget, const QString &value) |
| Emits the signal createFormSlot(). Used by WidgetPropertySet. | |
| Form * | activeForm () const |
| Form * | formForWidget (QWidget *w) |
| bool | isTopLevel (QWidget *w) |
| virtual void | showPropertySet (WidgetPropertySet *set, bool forceReload=false, const QCString &propertyToSelect=QCString()) |
| void | blockPropertyEditorUpdating (void *blockingObject) |
| void | unblockPropertyEditorUpdating (void *blockingObject, WidgetPropertySet *set) |
| void | setEditor (KoProperty::Editor *editor) |
| void | setObjectTreeView (ObjectTreeView *treeview) |
| void | previewForm (Form *form, QWidget *w, Form *toForm=0) |
| void | importForm (Form *form=0, bool preview=false) |
| void | deleteForm (Form *form) |
| void | createContextMenu (QWidget *w, Container *container, bool popupAtCursor=true) |
| bool | snapWidgetsToGrid () |
| int | contextMenuKey () const |
| void | emitWidgetSelected (KFormDesigner::Form *form, bool multiple) |
| void | emitFormWidgetSelected (KFormDesigner::Form *form) |
| void | emitNoFormSelected () |
| bool | isRedoing () const |
Static Public Member Functions | |
| static WidgetLibrary * | createWidgetLibrary (FormManager *m, const QStringList &supportedFactoryGroups) |
| Creates widget library for supportedFactoryGroups and initializes FormManager singleton. | |
| static FormManager * | self () |
| Access to FormManager singleton. | |
Protected Slots | |
| void | deleteWidgetLaterTimeout () |
| void | buddyChosen (int id) |
| void | menuSignalChosen (int id) |
| void | slotStyle () |
| void | slotConnectionCreated (KFormDesigner::Form *, KFormDesigner::Connection &) |
| void | slotSettingsChanged (int category) |
Protected Member Functions | |
| void | initForm (Form *form) |
| void | createLayout (int layoutType) |
| void | alignWidgets (int type) |
| void | enableFormActions () |
| void | disableWidgetActions () |
| void | emitUndoEnabled (bool enabled, const QString &text) |
| void | emitRedoEnabled (bool enabled, const QString &text) |
Protected Attributes | |
| bool | m_emitSelectionSignalsUpdatesPropertySet: 1 |
Friends | |
| class | PropertyCommand |
| class | GeometryPropertyCommand |
| class | CutWidgetCommand |
| class | Form |
Member Enumeration Documentation
|
|
Options for creating FormManager objects. These are really bit-flags and may be or-ed together. Definition at line 94 of file formmanager.h. |
Constructor & Destructor Documentation
|
||||||||||||||||
|
Constructs FormManager object. Using options you can control manager's behaviour, see Options. Definition at line 108 of file formmanager.cpp. References connectionCreated(), deleteWidgetLaterTimeout(), m_emitSelectionSignalsUpdatesPropertySet, slotConnectionCreated(), and slotSettingsChanged(). |
|
|
Definition at line 151 of file formmanager.cpp. References KoMacro::_self, and m_managerDeleter. |
Member Function Documentation
|
|
Signal emitted before the form gets finally deleted. form is still a valid pointer, but the widgets inside the form are in unknown state. |
|
|
Implemented in KexiFormManager. |
|
|
|
Resize all selected widgets to the height of the tallest widget.
Definition at line 1347 of file formmanager.cpp. References activeForm(), and KFormDesigner::AdjustSizeCommand::SizeToBigHeight. |
|
|
Resize all selected widgets to the height of the shortest widget.
Definition at line 1337 of file formmanager.cpp. References activeForm(), and KFormDesigner::AdjustSizeCommand::SizeToSmallHeight. |
|
|
Definition at line 1307 of file formmanager.cpp. References activeForm(), and KFormDesigner::AdjustSizeCommand::SizeToGrid. |
|
|
Adjusts the size of the selected widget, ie resize it to its size hint. Definition at line 1287 of file formmanager.cpp. References activeForm(), and KFormDesigner::AdjustSizeCommand::SizeToFit. |
|
|
Resize all selected widgets to the width of the widest widget.
Definition at line 1327 of file formmanager.cpp. References activeForm(), and KFormDesigner::AdjustSizeCommand::SizeToBigWidth. |
|
|
Resize all selected widgets to the width of the narrowest widget.
Definition at line 1317 of file formmanager.cpp. References activeForm(), and KFormDesigner::AdjustSizeCommand::SizeToSmallWidth. |
|
|
Function called by all other AlignWidgets*() function. Calls AlignWidgetsCommand. Definition at line 1242 of file formmanager.cpp. References activeForm(). Referenced by alignWidgetsToBottom(), alignWidgetsToLeft(), alignWidgetsToRight(), and alignWidgetsToTop(). |
|
|
Definition at line 1281 of file formmanager.cpp. References KFormDesigner::AlignWidgetsCommand::AlignToBottom, and alignWidgets(). |
|
|
Definition at line 1297 of file formmanager.cpp. References activeForm(), and KFormDesigner::AlignWidgetsCommand::AlignToGrid. |
|
|
Definition at line 1263 of file formmanager.cpp. References KFormDesigner::AlignWidgetsCommand::AlignToLeft, and alignWidgets(). |
|
|
Definition at line 1269 of file formmanager.cpp. References KFormDesigner::AlignWidgetsCommand::AlignToRight, and alignWidgets(). |
|
|
Definition at line 1275 of file formmanager.cpp. References KFormDesigner::AlignWidgetsCommand::AlignToTop, and alignWidgets(). |
|
||||||||||||
|
Signal emitted when "autoTabStops" is changed. Referenced by editTabOrder(). |
|
|
Definition at line 1169 of file formmanager.cpp. |
|
|
Breaks selected layout(calls BreakLayoutCommand).
Definition at line 1130 of file formmanager.cpp. References activeForm(), KFormDesigner::Container::NoLayout, KFormDesigner::Container::setLayout(), and KFormDesigner::Container::widget(). |
|
|
Definition at line 1357 of file formmanager.cpp. References activeForm(). |
|
|
Slot called when a buddy is chosen in the buddy list. Sets the label buddy. Definition at line 997 of file formmanager.cpp. References activeForm(), and KFormDesigner::ObjectTreeItem::widget(). Referenced by createContextMenu(). |
|
|
Executes font dialog and changes it for currently selected widget(s). Definition at line 1658 of file formmanager.cpp. References dirty(), and KFormDesigner::WidgetPropertySet::property(). |
|
|
Clears the contents of the selected widget(s) (eg for a line edit or a listview). Definition at line 1392 of file formmanager.cpp. References activeForm(). |
|
|
Signal emitted when the Connection creation by drag-and-drop is aborted by user. Referenced by stopCreatingConnection(). |
|
||||||||||||
|
Signal emitted when the Connection creation by drag-and-drop ends. connection is the created Connection. You should copy it, because it is deleted just after the signal is emitted. Referenced by FormManager(), and menuSignalChosen(). |
|
|
Definition at line 208 of file formmanager.h. |
|
|
Copies the slected widget and all its children of the active Form using an XML representation. Definition at line 724 of file formmanager.cpp. References activeForm(), KFormDesigner::FormIO::cleanClipboard(), KFormDesigner::removeChildrenFromList(), and KFormDesigner::FormIO::saveWidget(). |
|
||||||||||||||||
|
Creates all the KActions related to widget insertion, and plug them into the collection. client XML GUI client is used to call lib->addCustomWidgetActions(client). These actions are automatically connected to insertWidget() slot.
Definition at line 195 of file formmanager.cpp. References KFormDesigner::WidgetLibrary::addCustomWidgetActions(), KFormDesigner::WidgetLibrary::createWidgetActions(), HideSignalSlotConnections, insertWidget(), slotPointerClicked(), slotStyle(), and startCreatingConnection(). |
|
||||||||||||||||
|
This function creates and displays the context menu corresponding to the widget w. The menu item are disabled if necessary, and the widget specific part is added (menu from the factory and buddy selection). Definition at line 840 of file formmanager.cpp. References activeForm(), buddyChosen(), KFormDesigner::Container::form(), HideEventsInPopupMenu, menuSignalChosen(), PLUG_ACTION, and KFormDesigner::Container::widget(). |
|
|
Definition at line 136 of file formmanager.h. |
|
||||||||||||||||
|
Signal emitted when the user choose a signal in 'Events' menu in context menu, or in 'Events' in property editor. The code editor should then create the slot connected to this signal. Referenced by menuSignalChosen(). |
|
|
Function called by the "Lay out in..." menu items. It creates a layout from the currently selected widgets (that must have the same parent). Calls CreateLayoutCommand. Definition at line 1095 of file formmanager.cpp. References KFormDesigner::ObjectTreeItem::container(), KFormDesigner::WidgetPropertySet::contains(), and KFormDesigner::Container::layoutTypeToString(). Referenced by layoutGrid(), layoutHBox(), layoutHFlow(), layoutHSplitter(), layoutVBox(), layoutVFlow(), and layoutVSplitter(). |
|
|
Creates and display a menu with all the signals of widget w.
Definition at line 788 of file formmanager.cpp. References menuSignalChosen(), and resetCreatedConnection(). |
|
|
Creates and display a menu with all the slots of widget w.
Definition at line 809 of file formmanager.cpp. References menuSignalChosen(), resetCreatedConnection(), and KFormDesigner::Connection::signal(). |
|
||||||||||||
|
Creates widget library for supportedFactoryGroups and initializes FormManager singleton. m should be always the same for every call. Definition at line 169 of file formmanager.cpp. References KoMacro::_self, and m_managerDeleter. Referenced by KexiFormPart::KexiFormPart(), KexiReportPart::KexiReportPart(), and KFormDesignerKDevPart::KFormDesignerKDevPart(). |
|
|
Cuts (ie Copies and deletes) the selected widget and all its children of the active Form using an XML representation. Definition at line 756 of file formmanager.cpp. References activeForm(), and CutWidgetCommand. |
|
|
Deletes the Form form and removes it from our list. Definition at line 594 of file formmanager.cpp. References propertySetSwitched(). |
|
|
Deletes the selected widget in active Form and all of its children. Definition at line 705 of file formmanager.cpp. References activeForm(). |
|
|
Used to delayed widgets' deletion (in Container::deleteItem()).
Definition at line 1402 of file formmanager.cpp. |
|
|
Definition at line 1411 of file formmanager.cpp. Referenced by FormManager(). |
|
||||||||||||
|
This signal is emitted when any change is made to the Form form, so it will need to be saved. Referenced by changeFont(), editTabOrder(), and windowChanged(). |
|
|
Definition at line 1616 of file formmanager.cpp. References enableAction(). Referenced by emitNoFormSelected(). |
|
|
Creates a dialog to edit the Connection of activeForm(). Definition at line 1230 of file formmanager.cpp. References activeForm(), KFormDesigner::ConnectionDialog::exec(), and HideSignalSlotConnections. |
|
|
Creates a dialog to edit the activeForm() PixmapCollection. Definition at line 1220 of file formmanager.cpp. References activeForm(). |
|
|
Displays a dialog where the user can modify the tab order of the active Form, by drag-n-drop or using up/down buttons. Definition at line 1187 of file formmanager.cpp. References activeForm(), KFormDesigner::TabStopDialog::autoTabStops(), autoTabStopsSet(), dirty(), and KFormDesigner::TabStopDialog::exec(). |
|
||||||||||||
|
Emits the signal createFormSlot(). Used by WidgetPropertySet.
Definition at line 150 of file formmanager.h. |
|
|
Definition at line 1530 of file formmanager.cpp. References enableAction(), enableFormActions(), formWidgetSelected(), KFormDesigner::Container::NoLayout, KFormDesigner::Form::objectTree(), KFormDesigner::Form::selectedWidgets(), and KFormDesigner::Form::toplevelContainer(). |
|
|
Definition at line 1568 of file formmanager.cpp. References activeForm(), disableWidgetActions(), enableAction(), HideSignalSlotConnections, noFormSelected(), and SkipFileActions. Referenced by windowChanged(). |
|
||||||||||||
|
Definition at line 1651 of file formmanager.cpp. References enableAction(), and redoEnabled(). |
|
||||||||||||
|
Definition at line 1644 of file formmanager.cpp. References enableAction(), and undoEnabled(). |
|
||||||||||||
|
||||||||||||
|
Enables or disables actions name. KFD uses KPart's, action collection here. Kexi implements this to get (shared) actions defined elsewhere. Implemented in KexiFormManager. Referenced by disableWidgetActions(), emitFormWidgetSelected(), emitNoFormSelected(), emitRedoEnabled(), emitUndoEnabled(), emitWidgetSelected(), and enableFormActions(). |
|
|
Definition at line 1595 of file formmanager.cpp. References enableAction(), HideSignalSlotConnections, isPasteEnabled(), and SkipFileActions. Referenced by emitFormWidgetSelected(), and emitWidgetSelected(). |
|
|
Signal emitted when new form gets created. |
|
|
Definition at line 583 of file formmanager.cpp. References KFormDesigner::Form::toplevelContainer(), and KFormDesigner::Form::widget(). |
|
|
Signal emitted when the form widget is selected inside form. Use this to update actions state. Referenced by emitFormWidgetSelected(). |
|
||||||||||||
|
Adds a existing form w and changes it to a container Definition at line 610 of file formmanager.cpp. References initForm(), and KFormDesigner::Form::setDesignMode(). |
|
|
Inits the Form, adds it to m_forms, and conects slots. Definition at line 622 of file formmanager.cpp. References windowChanged(). Referenced by importForm(). |
|
|
This slot is called when the user presses a "Widget" toolbar button or a "Widget" menu item. Prepares all Forms for creation of a new widget (ie changes cursor ...). Definition at line 281 of file formmanager.cpp. References KFormDesigner::FormPrivate::cursors, KFormDesigner::Form::d, stopCreatingConnection(), KFormDesigner::Form::toplevelContainer(), and KFormDesigner::Form::widget(). Referenced by createActions(). |
|
|
Definition at line 133 of file formmanager.h. Referenced by windowChanged(). |
|
|
Definition at line 123 of file formmanager.h. |
|
|
Definition at line 255 of file formmanager.cpp. Referenced by enableFormActions(). |
|
|
Definition at line 220 of file formmanager.h. |
|
|
Definition at line 689 of file formmanager.cpp. References activeForm(), and KFormDesigner::ObjectTreeItem::parent(). |
