chalk

KisCanvasSubject Class Referenceabstract

#include <kis_canvas_subject.h>

Public Member Functions

virtual void attach (KisCanvasObserver *observer)=0
virtual void detach (KisCanvasObserver *observer)=0
virtual void notifyObservers ()=0
virtual KisImageSP currentImg () const =0
virtual KisColor bgColor () const =0
virtual void setBGColor (const KisColor &c)=0
virtual KisColor fgColor () const =0
virtual void setFGColor (const KisColor &c)=0
virtual float HDRExposure () const =0
virtual void setHDRExposure (float exposure)=0
virtual KisBrush * currentBrush () const =0
virtual KisPattern * currentPattern () const =0
virtual KisGradient * currentGradient () const =0
virtual KisID currentPaintop () const =0
virtual const KisPaintOpSettings * currentPaintopSettings () const =0
virtual double zoomFactor () const =0
virtual KisUndoAdapter * undoAdapter () const =0
virtual KisCanvasController * canvasController () const =0
virtual KisToolControllerInterface * toolController () const =0
virtual KisDoc * document () const =0
virtual KisProgressDisplayInterface * progressDisplay () const =0
virtual KisSelectionManager * selectionManager ()=0
virtual KoPaletteManager * paletteManager ()=0
virtual KisProfile * monitorProfile ()=0
virtual KisPerspectiveGridManager * perspectiveGridManager ()=0

Detailed Description

KisCanvasSubject is part of the Observer pattern.

Classes implementing KisCanvasObserver that have attached themselves to a class implementing this interface will be notified whenever any of the methods defined in this class will return something different.

Historical notes: This class has grown a bit an now seems to be the abstract definition of the View part in the Model-View-Controller pattern. We need to fix this!

Definition at line 52 of file kis_canvas_subject.h.

Constructor & Destructor Documentation

◆ KisCanvasSubject()

KisCanvasSubject::KisCanvasSubject ( )
inline

Definition at line 55 of file kis_canvas_subject.h.

◆ ~KisCanvasSubject()

virtual KisCanvasSubject::~KisCanvasSubject ( )
inlinevirtual

Definition at line 56 of file kis_canvas_subject.h.

Member Function Documentation

◆ attach()

virtual void KisCanvasSubject::attach ( KisCanvasObserver * observer)
pure virtual

From now on, the observer will be notified of changes in brush, foreground color, background color, pattern, gradient and paintop.

◆ bgColor()

virtual KisColor KisCanvasSubject::bgColor ( ) const
pure virtual
Returns
the background color

◆ canvasController()

virtual KisCanvasController * KisCanvasSubject::canvasController ( ) const
pure virtual
Returns
the interface to the canvas widget

◆ currentBrush()

virtual KisBrush * KisCanvasSubject::currentBrush ( ) const
pure virtual
Returns
the current brush object.

◆ currentGradient()

virtual KisGradient * KisCanvasSubject::currentGradient ( ) const
pure virtual
Returns
the current gradient object

◆ currentImg()

virtual KisImageSP KisCanvasSubject::currentImg ( ) const
pure virtual
Returns
the image that is currently active.

◆ currentPaintop()

virtual KisID KisCanvasSubject::currentPaintop ( ) const
pure virtual
Returns
the identification of the current paintop object, not the paintop object itself.

◆ currentPaintopSettings()

virtual const KisPaintOpSettings * KisCanvasSubject::currentPaintopSettings ( ) const
pure virtual
Returns
the settings for the current paintop object, or 0 if there are no options set.

◆ currentPattern()

virtual KisPattern * KisCanvasSubject::currentPattern ( ) const
pure virtual
Returns
the current pattern object.

◆ detach()

virtual void KisCanvasSubject::detach ( KisCanvasObserver * observer)
pure virtual

From now on, the specified observer will no longer be informed of changes.

◆ document()

virtual KisDoc * KisCanvasSubject::document ( ) const
pure virtual

XXX: Remove this method.

◆ fgColor()

virtual KisColor KisCanvasSubject::fgColor ( ) const
pure virtual
Returns
the currently set foreground or painting color

◆ HDRExposure()

virtual float KisCanvasSubject::HDRExposure ( ) const
pure virtual
Returns
the exposure value. This determines which exposure of multiple exposure or HDR images will be displayed

◆ monitorProfile()

virtual KisProfile * KisCanvasSubject::monitorProfile ( )
pure virtual

Get the profile that this view uses to display itself on he monitor.

◆ notifyObservers()

virtual void KisCanvasSubject::notifyObservers ( )
pure virtual

Calling this method will notify all observers.

Do not call this method from the Update method of a KisCanvasObserver!

◆ paletteManager()

virtual KoPaletteManager * KisCanvasSubject::paletteManager ( )
pure virtual

XXX: Remove this method.

◆ perspectiveGridManager()

virtual KisPerspectiveGridManager * KisCanvasSubject::perspectiveGridManager ( )
pure virtual

Get the perspective grid manager.

◆ progressDisplay()

virtual KisProgressDisplayInterface * KisCanvasSubject::progressDisplay ( ) const
pure virtual

XXX: Remove this method.

◆ selectionManager()

virtual KisSelectionManager * KisCanvasSubject::selectionManager ( )
pure virtual

XXX: Remove this method.

◆ setBGColor()

virtual void KisCanvasSubject::setBGColor ( const KisColor & c)
pure virtual

Set the background color.

This should cause all observers to be notified. Do not call from KisCanvasObserver::update()!

Parameters
cthe new background color

◆ setFGColor()

virtual void KisCanvasSubject::setFGColor ( const KisColor & c)
pure virtual

Set the foreground or painting color.

This should cause all observers to be notified. Do not call from KisCanvasObserver::update()!

Parameters
cthe new foreground color

◆ setHDRExposure()

virtual void KisCanvasSubject::setHDRExposure ( float exposure)
pure virtual

Set the exposure value.

This determines which exposure of multiple exposure or HDR images will be displayed. All observers should be notified.

Parameters
exposurethe new exposure value

◆ toolController()

virtual KisToolControllerInterface * KisCanvasSubject::toolController ( ) const
pure virtual

XXX: Remove this method.

◆ undoAdapter()

virtual KisUndoAdapter * KisCanvasSubject::undoAdapter ( ) const
pure virtual

retrieve the undo adapater – there is one undo adapter per document, and it collects all transactions

◆ zoomFactor()

virtual double KisCanvasSubject::zoomFactor ( ) const
pure virtual
Returns
the currently applied zoom factor. XXX: Shouldn't this be in the canvas controller?

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