#include <formmanager.h>
Inherits TQObject.
Inherited by KFDPart_FormManager, and KexiFormManager.
|
| enum | Options { HideEventsInPopupMenu = 1
, SkipFileActions = 2
, HideSignalSlotConnections = 4
} |
| |
|
| void | propertySetSwitched (KoProperty::Set *set, bool forceReload=false, const TQCString &propertyToSelect=TQCString()) |
| |
| 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 TQString &text=TQString()) |
| |
| void | redoEnabled (bool enabled, const TQString &text=TQString()) |
| |
| void | createFormSlot (KFormDesigner::Form *form, const TQString &widget, const TQString &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) |
| |
|
| | FormManager (TQObject *parent=0, int options=0, const char *name=0) |
| |
| ActionList | createActions (WidgetLibrary *lib, TDEActionCollection *collection, KXMLGUIClient *client) |
| |
| virtual void | enableAction (const char *name, bool enable)=0 |
| |
| virtual TDEAction * | action (const char *name)=0 |
| |
| bool | isPasteEnabled () |
| |
| WidgetPropertySet * | propertySet () const |
| |
| bool | isInserting () const |
| |
| TQCString | selectedClass () const |
| |
| void | setInsertPoint (const TQPoint &p) |
| |
| bool | isCreatingConnection () |
| |
| Connection * | createdConnection () |
| |
| void | resetCreatedConnection () |
| |
| void | createSignalMenu (TQWidget *w) |
| |
| void | createSlotMenu (TQWidget *w) |
| |
| void | emitCreateSlot (const TQString &widget, const TQString &value) |
| |
| Form * | activeForm () const |
| |
| Form * | formForWidget (TQWidget *w) |
| |
| bool | isTopLevel (TQWidget *w) |
| |
| virtual void | showPropertySet (WidgetPropertySet *set, bool forceReload=false, const TQCString &propertyToSelect=TQCString()) |
| |
| void | blockPropertyEditorUpdating (void *blockingObject) |
| |
| void | unblockPropertyEditorUpdating (void *blockingObject, WidgetPropertySet *set) |
| |
| void | setEditor (KoProperty::Editor *editor) |
| |
| void | setObjectTreeView (ObjectTreeView *treeview) |
| |
| void | previewForm (Form *form, TQWidget *w, Form *toForm=0) |
| |
| void | importForm (Form *form=0, bool preview=false) |
| |
| void | deleteForm (Form *form) |
| |
| void | createContextMenu (TQWidget *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 |
| |
A class to manage (create/load/save) Forms.
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.
◆ Options
Options for creating FormManager objects. These are really bit-flags and may be or-ed together.
Definition at line 95 of file formmanager.h.
◆ FormManager()
| FormManager::FormManager |
( |
TQObject * |
parent = 0, |
|
|
int |
options = 0, |
|
|
const char * |
name = 0 |
|
) |
| |
◆ ~FormManager()
| FormManager::~FormManager |
( |
| ) |
|
|
virtual |
◆ aboutToDeleteForm
Signal emitted before the form gets finally deleted. form is still a valid pointer, but the widgets inside the form are in unknown state.
◆ action()
| virtual TDEAction * KFormDesigner::FormManager::action |
( |
const char * |
name | ) |
|
|
pure virtual |
◆ activeForm()
| Form * FormManager::activeForm |
( |
| ) |
const |
◆ adjustHeightToBig
| void FormManager::adjustHeightToBig |
( |
| ) |
|
|
slot |
Resize all selected widgets to the height of the tallest widget.
Definition at line 1347 of file formmanager.cpp.
◆ adjustHeightToSmall
| void FormManager::adjustHeightToSmall |
( |
| ) |
|
|
slot |
Resize all selected widgets to the height of the shortest widget.
Definition at line 1337 of file formmanager.cpp.
◆ adjustSizeToGrid
| void FormManager::adjustSizeToGrid |
( |
| ) |
|
|
slot |
◆ adjustWidgetSize
| void FormManager::adjustWidgetSize |
( |
| ) |
|
|
slot |
Adjusts the size of the selected widget, ie resize it to its size hint.
Definition at line 1287 of file formmanager.cpp.
◆ adjustWidthToBig
| void FormManager::adjustWidthToBig |
( |
| ) |
|
|
slot |
Resize all selected widgets to the width of the widest widget.
Definition at line 1327 of file formmanager.cpp.
◆ adjustWidthToSmall
| void FormManager::adjustWidthToSmall |
( |
| ) |
|
|
slot |
Resize all selected widgets to the width of the narrowest widget.
Definition at line 1317 of file formmanager.cpp.
◆ alignWidgets()
| void FormManager::alignWidgets |
( |
int |
type | ) |
|
|
protected |
◆ alignWidgetsToBottom
| void FormManager::alignWidgetsToBottom |
( |
| ) |
|
|
slot |
◆ alignWidgetsToGrid
| void FormManager::alignWidgetsToGrid |
( |
| ) |
|
|
slot |
◆ alignWidgetsToLeft
| void FormManager::alignWidgetsToLeft |
( |
| ) |
|
|
slot |
◆ alignWidgetsToRight
| void FormManager::alignWidgetsToRight |
( |
| ) |
|
|
slot |
◆ alignWidgetsToTop
| void FormManager::alignWidgetsToTop |
( |
| ) |
|
|
slot |
◆ autoTabStopsSet
Signal emitted when "autoTabStops" is changed.
◆ blockPropertyEditorUpdating()
| void FormManager::blockPropertyEditorUpdating |
( |
void * |
blockingObject | ) |
|
◆ breakLayout
| void FormManager::breakLayout |
( |
| ) |
|
|
slot |
◆ bringWidgetToFront
| void FormManager::bringWidgetToFront |
( |
| ) |
|
|
slot |
◆ buddyChosen
| void FormManager::buddyChosen |
( |
int |
id | ) |
|
|
protectedslot |
Slot called when a buddy is chosen in the buddy list. Sets the label buddy.
Definition at line 997 of file formmanager.cpp.
◆ changeFont
| void FormManager::changeFont |
( |
| ) |
|
|
slot |
Executes font dialog and changes it for currently selected widget(s).
- Todo:
- this modification is not added to UNDO BUFFER: do it when KoProperty::Set supports multiple selections
Definition at line 1658 of file formmanager.cpp.
◆ clearWidgetContent
| void FormManager::clearWidgetContent |
( |
| ) |
|
|
slot |
Clears the contents of the selected widget(s) (eg for a line edit or a listview).
Definition at line 1392 of file formmanager.cpp.
◆ connectionAborted
Signal emitted when the Connection creation by drag-and-drop is aborted by user.
◆ connectionCreated
| void KFormDesigner::FormManager::connectionCreated |
( |
KFormDesigner::Form * |
form, |
|
|
KFormDesigner::Connection & |
connection |
|
) |
| |
|
signal |
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.
◆ contextMenuKey()
| int KFormDesigner::FormManager::contextMenuKey |
( |
| ) |
const |
|
inline |
◆ copyWidget
| void FormManager::copyWidget |
( |
| ) |
|
|
slot |
Copies the slected widget and all its children of the active Form using an XML representation.
Definition at line 724 of file formmanager.cpp.
◆ createActions()
| ActionList FormManager::createActions |
( |
WidgetLibrary * |
lib, |
|
|
TDEActionCollection * |
collection, |
|
|
KXMLGUIClient * |
client |
|
) |
| |
Creates all the TDEActions 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. - Returns
- a TQPtrList of the created actions.
Definition at line 195 of file formmanager.cpp.
◆ createContextMenu()
| void FormManager::createContextMenu |
( |
TQWidget * |
w, |
|
|
Container * |
container, |
|
|
bool |
popupAtCursor = true |
|
) |
| |
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.
◆ createdConnection()
| Connection * KFormDesigner::FormManager::createdConnection |
( |
| ) |
|
|
inline |
- Returns
- the Connection being created.
Definition at line 137 of file formmanager.h.
◆ createFormSlot
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.
◆ createLayout()
| void FormManager::createLayout |
( |
int |
layoutType | ) |
|
|
protected |
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.
◆ createSignalMenu()
| void FormManager::createSignalMenu |
( |
TQWidget * |
w | ) |
|
Creates and display a menu with all the signals of widget w.
Definition at line 788 of file formmanager.cpp.
◆ createSlotMenu()
| void FormManager::createSlotMenu |
( |
TQWidget * |
w | ) |
|
Creates and display a menu with all the slots of widget w.
Definition at line 809 of file formmanager.cpp.
◆ createWidgetLibrary()
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.
◆ cutWidget
| void FormManager::cutWidget |
( |
| ) |
|
|
slot |
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.
◆ deleteForm()
| void FormManager::deleteForm |
( |
Form * |
form | ) |
|
◆ deleteWidget
| void FormManager::deleteWidget |
( |
| ) |
|
|
slot |
Deletes the selected widget in active Form and all of its children.
Definition at line 705 of file formmanager.cpp.
◆ deleteWidgetLater
| void FormManager::deleteWidgetLater |
( |
TQWidget * |
w | ) |
|
|
slot |
Used to delayed widgets' deletion (in Container::deleteItem())
Definition at line 1402 of file formmanager.cpp.
◆ deleteWidgetLaterTimeout
| void FormManager::deleteWidgetLaterTimeout |
( |
| ) |
|
|
protectedslot |
◆ dirty
This signal is emitted when any change is made to the Form form, so it will need to be saved.
◆ disableWidgetActions()
| void FormManager::disableWidgetActions |
( |
| ) |
|
|
protected |
◆ editConnections
| void FormManager::editConnections |
( |
| ) |
|
|
slot |
◆ editFormPixmapCollection
| void FormManager::editFormPixmapCollection |
( |
| ) |
|
|
slot |
◆ editTabOrder
| void FormManager::editTabOrder |
( |
| ) |
|
|
slot |
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.
◆ emitCreateSlot()
| void KFormDesigner::FormManager::emitCreateSlot |
( |
const TQString & |
widget, |
|
|
const TQString & |
value |
|
) |
| |
|
inline |
◆ emitFormWidgetSelected()
◆ emitNoFormSelected()
| void FormManager::emitNoFormSelected |
( |
| ) |
|
◆ emitRedoEnabled()
| void FormManager::emitRedoEnabled |
( |
bool |
enabled, |
|
|
const TQString & |
text |
|
) |
| |
|
protected |
◆ emitUndoEnabled()
| void FormManager::emitUndoEnabled |
( |
bool |
enabled, |
|
|
const TQString & |
text |
|
) |
| |
|
protected |
◆ emitWidgetSelected()
◆ enableAction()
| virtual void KFormDesigner::FormManager::enableAction |
( |
const char * |
name, |
|
|
bool |
enable |
|
) |
| |
|
pure virtual |
Enables or disables actions name. KFD uses KPart's, action collection here. Kexi implements this to get (shared) actions defined elsewhere.
◆ enableFormActions()
| void FormManager::enableFormActions |
( |
| ) |
|
|
protected |
◆ formCreated
Signal emitted when new form gets created.
◆ formForWidget()
| Form * FormManager::formForWidget |
( |
TQWidget * |
w | ) |
|
- Returns
- the Form whose toplevel widget is w, or 0 if there is not or the Form is in preview mode.
Definition at line 583 of file formmanager.cpp.
◆ formWidgetSelected
Signal emitted when the form widget is selected inside form. Use this to update actions state.
◆ importForm()
| void FormManager::importForm |
( |
Form * |
form = 0, |
|
|
bool |
preview = false |
|
) |
| |
Adds a existing form w and changes it to a container
Definition at line 610 of file formmanager.cpp.
◆ initForm()
| void FormManager::initForm |
( |
Form * |
form | ) |
|
|
protected |
◆ insertWidget
| void FormManager::insertWidget |
( |
const TQCString & |
classname | ) |
|
|
slot |
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.
◆ isCreatingConnection()
| bool KFormDesigner::FormManager::isCreatingConnection |
( |
| ) |
|
|
inline |
- Returns
- If we are creating a Connection by drag-and-drop or not.
Definition at line 134 of file formmanager.h.
◆ isInserting()
| bool KFormDesigner::FormManager::isInserting |
( |
| ) |
const |
|
inline |
- Returns
- true if one of the insert buttons was pressed and the forms are ready to create a widget.
Definition at line 124 of file formmanager.h.
◆ isPasteEnabled()
| bool FormManager::isPasteEnabled |
( |
| ) |
|
◆ isRedoing()
| bool KFormDesigner::FormManager::isRedoing |
( |
| ) |
const |
|
inline |
◆ isTopLevel()
| bool FormManager::isTopLevel |
( |
TQWidget * |
w | ) |
|
- Returns
- true if w is a toplevel widget, ie. it is the main widget of a Form (so it should have a caption , an icon ...)
Definition at line 689 of file formmanager.cpp.
◆ layoutGrid
| void FormManager::layoutGrid |
( |
| ) |
|
|
slot |
◆ layoutHBox
| void FormManager::layoutHBox |
( |
| ) |
|
|
slot |
◆ layoutHFlow
| void FormManager::layoutHFlow |
( |
| ) |
|
|
slot |
◆ layoutHSplitter
| void FormManager::layoutHSplitter |
( |
| ) |
|
|
slot |
Lay out selected widgets in an horizontal splitter.
Definition at line 1071 of file formmanager.cpp.
◆ layoutVBox
| void FormManager::layoutVBox |
( |
| ) |
|
|
slot |
◆ layoutVFlow
| void FormManager::layoutVFlow |
( |
| ) |
|
|
slot |
◆ layoutVSplitter
| void FormManager::layoutVSplitter |
( |
| ) |
|
|
slot |
Lay out selected widgets in a verticak splitter.
Definition at line 1077 of file formmanager.cpp.
◆ menuSignalChosen
| void FormManager::menuSignalChosen |
( |
int |
id | ) |
|
|
protectedslot |
Slot called when the user chooses an item in signal (or slot) menu. The createdConnection() is updated, and the connection created (for the signal menu).
Definition at line 1016 of file formmanager.cpp.
◆ noFormSelected
| void KFormDesigner::FormManager::noFormSelected |
( |
| ) |
|
|
signal |
Signal emitted when no form (or a preview form) is selected. Use this to update actions state.
◆ pasteWidget
| void FormManager::pasteWidget |
( |
| ) |
|
|
slot |
Pastes the XML representation of the copied or cut widget. The widget is pasted when the user clicks the Form to indicate the new position of the widget, or at the position of the contextual menu if there is one.
Definition at line 770 of file formmanager.cpp.
◆ previewForm()
| void FormManager::previewForm |
( |
Form * |
form, |
|
|
TQWidget * |
w, |
|
|
Form * |
toForm = 0 |
|
) |
| |
Previews the Form form using the widget w as toplevel container for this Form.
designMode, we need to set it early enough
Definition at line 648 of file formmanager.cpp.
◆ propertySet()
| WidgetPropertySet * KFormDesigner::FormManager::propertySet |
( |
| ) |
const |
|
inline |
- Returns
- A pointer to the WidgetPropertySet owned by this Manager.
Definition at line 120 of file formmanager.h.
◆ propertySetSwitched
| void KFormDesigner::FormManager::propertySetSwitched |
( |
KoProperty::Set * |
set, |
|
|
bool |
forceReload = false, |
|
|
const TQCString & |
propertyToSelect = TQCString() |
|
) |
| |
|
signal |
This signal is emitted as the property set switched. If forceReload is true, the set needs to be reloaded even if it's the same as previous one.
◆ redo
| void FormManager::redo |
( |
| ) |
|
|
slot |
◆ redoEnabled
| void KFormDesigner::FormManager::redoEnabled |
( |
bool |
enabled, |
|
|
const TQString & |
text = TQString() |
|
) |
| |
|
signal |
Signal emitted when redo action activation changes. text is the full text of the action (including command name).
◆ resetCreatedConnection()
| void FormManager::resetCreatedConnection |
( |
| ) |
|
Resets the Connection being created. We stay in Connection creation mode, but we start a new connection (when the user clicks outside of signals/slots menu).
Definition at line 400 of file formmanager.cpp.
◆ selectAll
| void FormManager::selectAll |
( |
| ) |
|
|
slot |
Selects all toplevel widgets in trhe current form.
Definition at line 1377 of file formmanager.cpp.
◆ selectedClass()
| TQCString KFormDesigner::FormManager::selectedClass |
( |
| ) |
const |
|
inline |
- Returns
- The name of the class being inserted, corresponding to the menu item or the toolbar button clicked.
Definition at line 128 of file formmanager.h.
◆ self()
◆ sendWidgetToBack
| void FormManager::sendWidgetToBack |
( |
| ) |
|
|
slot |
◆ setEditor()
| void FormManager::setEditor |
( |
KoProperty::Editor * |
editor | ) |
|
Sets the external property editor pane used by FormDesigner (it may be docked).
Definition at line 177 of file formmanager.cpp.
◆ setInsertPoint()
| void FormManager::setInsertPoint |
( |
const TQPoint & |
p | ) |
|
Sets the point where the pasted widget should be moved to.
Definition at line 782 of file formmanager.cpp.
◆ setObjectTreeView()
Sets the external object tree view used by FormDesigner (it may be docked). This function also connects appropriate signals and slots to ensure sync with the current Form.
Definition at line 186 of file formmanager.cpp.
◆ showFormUICode
| void FormManager::showFormUICode |
( |
| ) |
|
|
slot |
For debugging purposes only: shows a text window containing contents of .ui XML definition of the current form.
Definition at line 1417 of file formmanager.cpp.
◆ showPropertySet()
| void FormManager::showPropertySet |
( |
WidgetPropertySet * |
set, |
|
|
bool |
forceReload = false, |
|
|
const TQCString & |
propertyToSelect = TQCString() |
|
) |
| |
|
virtual |
- Returns
- A pointer to the KoProperty::Editor we use.
Shows a property set set in a Property Editor. If buff is 0, Property Editor will be cleared. If forceReload is true, the set will be reloaded even if it's the same as previous one. If propertyToSelect is not empty, an item for this name will be selected (usable when previously there was no set visible).
Definition at line 1153 of file formmanager.cpp.
◆ slotConnectionCreated
◆ slotPointerClicked
| void FormManager::slotPointerClicked |
( |
| ) |
|
|
slot |
Slot called when the user presses 'Pointer' icon. Switch to Default mode.
Definition at line 348 of file formmanager.cpp.
◆ slotSettingsChanged
| void FormManager::slotSettingsChanged |
( |
int |
category | ) |
|
|
protectedslot |
◆ slotStyle
| void FormManager::slotStyle |
( |
| ) |
|
|
protectedslot |
Slot called when the user changes current style using combbox in toolbar or menu.
Definition at line 1204 of file formmanager.cpp.
◆ snapWidgetsToGrid()
| bool FormManager::snapWidgetsToGrid |
( |
| ) |
|
- Returns
- If we align widgets to grid or not.
Definition at line 463 of file formmanager.cpp.
◆ startCreatingConnection
| void FormManager::startCreatingConnection |
( |
| ) |
|
|
slot |
◆ stopCreatingConnection
| void FormManager::stopCreatingConnection |
( |
| ) |
|
|
slot |
◆ stopInsert
| void FormManager::stopInsert |
( |
| ) |
|
|
slot |
Stops the current widget insertion (ie unset the cursor ...).
Definition at line 313 of file formmanager.cpp.
◆ unblockPropertyEditorUpdating()
| void FormManager::unblockPropertyEditorUpdating |
( |
void * |
blockingObject, |
|
|
WidgetPropertySet * |
set |
|
) |
| |
◆ undo
| void FormManager::undo |
( |
| ) |
|
|
slot |
◆ undoEnabled
| void KFormDesigner::FormManager::undoEnabled |
( |
bool |
enabled, |
|
|
const TQString & |
text = TQString() |
|
) |
| |
|
signal |
Signal emitted when undo action activation changes. text is the full text of the action (including command name).
◆ widgetSelected
Signal emitted when a normal widget is selected inside form (ie not form widget). If multiple is true, then more than one widget is selected. Use this to update actions state.
◆ windowChanged
| void FormManager::windowChanged |
( |
TQWidget * |
w | ) |
|
|
slot |
Calls this slot when the window activated changes (eg connect to TQWorkspace::windowActivated(TQWidget*)). You need to connect to this slot, it will crash otherwise.
Definition at line 469 of file formmanager.cpp.
◆ CutWidgetCommand
◆ Form
◆ GeometryPropertyCommand
◆ PropertyCommand
◆ m_emitSelectionSignalsUpdatesPropertySet
| bool KFormDesigner::FormManager::m_emitSelectionSignalsUpdatesPropertySet |
|
protected |
The documentation for this class was generated from the following files:
|