Krita Source Code Documentation
Loading...
Searching...
No Matches
KoShapeConfigWidgetBase Class Referenceabstract

#include <KoShapeConfigWidgetBase.h>

+ Inheritance diagram for KoShapeConfigWidgetBase:

Signals

void accept ()
 is emitted when the dialog should be accepted ie a file double clicked in a filebrowser
 
void propertyChanged ()
 is emitted after one of the config options has changed
 

Public Member Functions

virtual KUndo2CommandcreateCommand ()
 Creates a command which applies all changes to the opened shape.
 
 KoShapeConfigWidgetBase ()
 
virtual void open (KoShape *shape)=0
 
virtual void save ()=0
 
void setResourceManager (KoCanvasResourceProvider *rm)
 called to set the canvas resource manager of the canvas the user used to insert the new shape.
 
virtual void setUnit (const KoUnit &unit)
 
virtual bool showOnShapeCreate ()
 Return true if the shape config panel should be shown after the shape is created.
 
virtual bool showOnShapeSelect ()
 Return true if the shape config panel should be shown when the shape is selected.
 
 ~KoShapeConfigWidgetBase () override
 

Protected Attributes

KoCanvasResourceProviderm_resourceManager
 the resource provider with data for this canvas
 

Detailed Description

Base widget for shape-configuration panels. This is an interface type class used by classes that intend to provide a GUI for configuring newly created shapes as created by a KoShapeFactoryBase.

Every time after a shape is created the KoShapeFactoryBase for that shape-type will be queried for all the config widgets; both factory specific as well as those set by the hosting application. A dialog will be shown with all those panels, each extending this class. The framework will then call open() to populate the widget with data from the param shape. After the user ok-ed the dialog the save() will be called to allow the widget to apply all settings from the widget to the shape.

Definition at line 32 of file KoShapeConfigWidgetBase.h.

Constructor & Destructor Documentation

◆ KoShapeConfigWidgetBase()

KoShapeConfigWidgetBase::KoShapeConfigWidgetBase ( )

Default constructor

Definition at line 9 of file KoShapeConfigWidgetBase.cpp.

11{
12}
KoCanvasResourceProvider * m_resourceManager
the resource provider with data for this canvas

◆ ~KoShapeConfigWidgetBase()

KoShapeConfigWidgetBase::~KoShapeConfigWidgetBase ( )
override

Definition at line 14 of file KoShapeConfigWidgetBase.cpp.

15{
16}

Member Function Documentation

◆ accept

void KoShapeConfigWidgetBase::accept ( )
signal

is emitted when the dialog should be accepted ie a file double clicked in a filebrowser

◆ createCommand()

KUndo2Command * KoShapeConfigWidgetBase::createCommand ( )
virtual

Creates a command which applies all changes to the opened shape.

Reimplemented in EllipseShapeConfigWidget, RectangleShapeConfigWidget, SpiralShapeConfigWidget, and StarShapeConfigWidget.

Definition at line 37 of file KoShapeConfigWidgetBase.cpp.

38{
39 return 0;
40}

◆ open()

virtual void KoShapeConfigWidgetBase::open ( KoShape * shape)
pure virtual

Open the argument shape by interpreting the data and setting that data on this widget.

Parameters
shapethe shape that is to be queried for the data this widget can edit.

Implemented in EllipseShapeConfigWidget, RectangleShapeConfigWidget, SpiralShapeConfigWidget, and StarShapeConfigWidget.

◆ propertyChanged

void KoShapeConfigWidgetBase::propertyChanged ( )
signal

is emitted after one of the config options has changed

◆ save()

virtual void KoShapeConfigWidgetBase::save ( )
pure virtual

Save the data of this widget to the shape passed to open earlier to apply any user changed options. Called by the tool that created the shape.

Implemented in EllipseShapeConfigWidget, RectangleShapeConfigWidget, SpiralShapeConfigWidget, and StarShapeConfigWidget.

◆ setResourceManager()

void KoShapeConfigWidgetBase::setResourceManager ( KoCanvasResourceProvider * rm)

called to set the canvas resource manager of the canvas the user used to insert the new shape.

Definition at line 22 of file KoShapeConfigWidgetBase.cpp.

23{
25}

References m_resourceManager.

◆ setUnit()

void KoShapeConfigWidgetBase::setUnit ( const KoUnit & unit)
virtual

Overwrite this method to set the application unit type and update all unit-widgets in this panel. Called by the tool that created the shape using KoCanvasBase::unit()

Parameters
unitthe new unit to show data in.

Reimplemented in RectangleShapeConfigWidget, and StarShapeConfigWidget.

Definition at line 18 of file KoShapeConfigWidgetBase.cpp.

19{
20}

◆ showOnShapeCreate()

bool KoShapeConfigWidgetBase::showOnShapeCreate ( )
virtual

Return true if the shape config panel should be shown after the shape is created.

Reimplemented in EllipseShapeConfigWidget, RectangleShapeConfigWidget, SpiralShapeConfigWidget, and StarShapeConfigWidget.

Definition at line 27 of file KoShapeConfigWidgetBase.cpp.

28{
29 return false;
30}

◆ showOnShapeSelect()

bool KoShapeConfigWidgetBase::showOnShapeSelect ( )
virtual

Return true if the shape config panel should be shown when the shape is selected.

Definition at line 32 of file KoShapeConfigWidgetBase.cpp.

33{
34 return true;
35}

Member Data Documentation

◆ m_resourceManager

KoCanvasResourceProvider* KoShapeConfigWidgetBase::m_resourceManager
protected

the resource provider with data for this canvas

Definition at line 83 of file KoShapeConfigWidgetBase.h.


The documentation for this class was generated from the following files: