libs/flake
KoCanvasResourceProvider Class Reference
The KoCanvasResourceProvider contains a set of per-canvas properties, like current foreground color, current background color and more. More...
#include <KoCanvasResourceProvider.h>

Signals | |
| void | resourceChanged (int key, const QVariant &value) |
Public Member Functions | |
| KoCanvasResourceProvider (QObject *parent=0) | |
| ~KoCanvasResourceProvider () | |
| KoLineBorder | activeBorder () |
| KoColor | backgroundColor () |
| bool | boolResource (int key) const |
| void | clearResource (int key) |
| qreal | doubleResource (int key) const |
| KoColor | foregroundColor () |
| uint | grabSensitivity () |
| int | handleRadius () |
| bool | hasResource (int key) |
| int | intResource (int key) const |
| KoColor | koColorResource (int key) |
| KoID | koIDResource (int key) |
| KoShape * | koShapeResource (int key) |
| QVariant | resource (int key) |
| void | setActiveBorder (const KoLineBorder &border) |
| void | setBackgroundColor (const KoColor &color) |
| void | setForegroundColor (const KoColor &color) |
| void | setGrabSensitivity (uint grabSensitivity) |
| void | setHandleRadius (int handleSize) |
| void | setResource (int key, KoShape *shape) |
| void | setResource (int key, const KoID &id) |
| void | setResource (int key, const KoColor &color) |
| void | setResource (int key, const QVariant &value) |
| void | setUnitChanged () |
| QSizeF | sizeResource (int key) |
| QString | stringResource (int key) |
Detailed Description
The KoCanvasResourceProvider contains a set of per-canvas properties, like current foreground color, current background color and more.
All tools belonging to the current canvas are notified when a Resource changes (is set). The properties come from the KoCanvasResource::CanvasResource enum.
Definition at line 80 of file KoCanvasResourceProvider.h.
Constructor & Destructor Documentation
| KoCanvasResourceProvider::KoCanvasResourceProvider | ( | QObject * | parent = 0 |
) | [explicit] |
Constructor.
- Parameters:
-
parent the parent QObject, used for memory management.
Definition at line 34 of file KoCanvasResourceProvider.cpp.
| KoCanvasResourceProvider::~KoCanvasResourceProvider | ( | ) |
Definition at line 41 of file KoCanvasResourceProvider.cpp.
Member Function Documentation
| KoLineBorder KoCanvasResourceProvider::activeBorder | ( | ) |
Returns the border resource.
Definition at line 167 of file KoCanvasResourceProvider.cpp.
| KoColor KoCanvasResourceProvider::backgroundColor | ( | ) |
Return the backgroundColor.
Definition at line 114 of file KoCanvasResourceProvider.cpp.
| bool KoCanvasResourceProvider::boolResource | ( | int | key | ) | const |
Return the resource determined by param key as a boolean.
- Parameters:
-
key the indentifying key for the resource, based on KoCanvasResource::CanvasResource..
Definition at line 181 of file KoCanvasResourceProvider.cpp.
| void KoCanvasResourceProvider::clearResource | ( | int | key | ) |
Remove the resource with key from the provider.
- Parameters:
-
key the key that will be used to remove the resource, based on KoCanvasResource::CanvasResource.. There will be a signal emitted with a variable that will return true on QVariable::isNull();
Definition at line 225 of file KoCanvasResourceProvider.cpp.
| qreal KoCanvasResourceProvider::doubleResource | ( | int | key | ) | const |
Return the resource determined by param key as a qreal.
- Parameters:
-
key the indentifying key for the resource, based on KoCanvasResource::CanvasResource..
Definition at line 195 of file KoCanvasResourceProvider.cpp.
| KoColor KoCanvasResourceProvider::foregroundColor | ( | ) |
Return the foregroundColor.
Definition at line 103 of file KoCanvasResourceProvider.cpp.
| uint KoCanvasResourceProvider::grabSensitivity | ( | ) |
Returns the actual grab sensitivity.
Definition at line 155 of file KoCanvasResourceProvider.cpp.
| int KoCanvasResourceProvider::handleRadius | ( | ) |
Returns the actual handle radius.
Definition at line 140 of file KoCanvasResourceProvider.cpp.
| bool KoCanvasResourceProvider::hasResource | ( | int | key | ) |
Returns true if there is a resource set with the requested key.
- Parameters:
-
key the indentifying key for the resource, based on KoCanvasResource::CanvasResource..
Definition at line 220 of file KoCanvasResourceProvider.cpp.
| int KoCanvasResourceProvider::intResource | ( | int | key | ) | const |
Return the resource determined by param key as an integer.
- Parameters:
-
key the indentifying key for the resource, based on KoCanvasResource::CanvasResource..
Definition at line 188 of file KoCanvasResourceProvider.cpp.
| KoColor KoCanvasResourceProvider::koColorResource | ( | int | key | ) |
Return the resource determined by param key as a KoColor.
- Parameters:
-
key the indentifying key for the resource, based on KoCanvasResource::CanvasResource..
Definition at line 88 of file KoCanvasResourceProvider.cpp.
| KoID KoCanvasResourceProvider::koIDResource | ( | int | key | ) |
Return the resource determined by param key as a KoID.
- Parameters:
-
key the indentifying key for the resource, based on KoCanvasResource::CanvasResource..
Definition at line 119 of file KoCanvasResourceProvider.cpp.
| KoShape * KoCanvasResourceProvider::koShapeResource | ( | int | key | ) |
Return the resource determined by param key as a pointer to a KoShape.
- Parameters:
-
key the indentifying key for the resource, based on KoCanvasResource::CanvasResource..
Definition at line 124 of file KoCanvasResourceProvider.cpp.
| QVariant KoCanvasResourceProvider::resource | ( | int | key | ) |
Returns a qvariant containing the specified resource or a standard one if the specified resource does not exist.
- Parameters:
-
key the key, based on KoCanvasResource::CanvasResource.
Definition at line 58 of file KoCanvasResourceProvider.cpp.
| void KoCanvasResourceProvider::resourceChanged | ( | int | key, | |
| const QVariant & | value | |||
| ) | [signal] |
This signal is emitted every time a resource is set that is either new or different from the previous set value.
- Parameters:
-
key the indentifying key for the resource, based on KoCanvasResource::CanvasResource. value the variants new value.
| void KoCanvasResourceProvider::setActiveBorder | ( | const KoLineBorder & | border | ) |
Sets the border resource.
Definition at line 160 of file KoCanvasResourceProvider.cpp.
| void KoCanvasResourceProvider::setBackgroundColor | ( | const KoColor & | color | ) |
Set the backgroundColor resource.
- Parameters:
-
color the new background color
Definition at line 109 of file KoCanvasResourceProvider.cpp.
| void KoCanvasResourceProvider::setForegroundColor | ( | const KoColor & | color | ) |
Set the foregroundColor resource.
- Parameters:
-
color the new foreground color
Definition at line 98 of file KoCanvasResourceProvider.cpp.
| void KoCanvasResourceProvider::setGrabSensitivity | ( | uint | grabSensitivity | ) |
Tools that are used to grab handles or similar with the mouse should use this value to determine if the mouse is near enough.
- Parameters:
-
grabSensitivity the grab sensitivity in pixels
Definition at line 147 of file KoCanvasResourceProvider.cpp.
| void KoCanvasResourceProvider::setHandleRadius | ( | int | handleSize | ) |
Tools that provide a handle for controlling the content that the tool can edit can use this property to alter the radius that a circular handle should have on screen.
- Parameters:
-
handleSize the radius in pixels.
Definition at line 132 of file KoCanvasResourceProvider.cpp.
| void KoCanvasResourceProvider::setResource | ( | int | key, | |
| KoShape * | shape | |||
| ) |
Set a resource of type KoShape*.
- Parameters:
-
key the integer key, based on KoCanvasResource::CanvasResource id the new value for the key.
Definition at line 81 of file KoCanvasResourceProvider.cpp.
| void KoCanvasResourceProvider::setResource | ( | int | key, | |
| const KoID & | id | |||
| ) |
Set a resource of type KoID.
- Parameters:
-
key the integer key, based on KoCanvasResource::CanvasResource id the new value for the key.
Definition at line 74 of file KoCanvasResourceProvider.cpp.
| void KoCanvasResourceProvider::setResource | ( | int | key, | |
| const KoColor & | color | |||
| ) |
Set a resource of type KoColor.
- Parameters:
-
key the integer key, based on KoCanvasResource::CanvasResource color the new value for the key.
Definition at line 67 of file KoCanvasResourceProvider.cpp.
| void KoCanvasResourceProvider::setResource | ( | int | key, | |
| const QVariant & | value | |||
| ) |
Set a resource of any type.
- Parameters:
-
key the integer key, based on KoCanvasResource::CanvasResource value the new value for the key.
Definition at line 46 of file KoCanvasResourceProvider.cpp.
| void KoCanvasResourceProvider::setUnitChanged | ( | ) |
Sets that the new unit of this canvas has changed The actual unit can be obtained directly from the canvas.
Definition at line 176 of file KoCanvasResourceProvider.cpp.
| QSizeF KoCanvasResourceProvider::sizeResource | ( | int | key | ) |
Return the resource determined by param key as a QSizeF.
- Parameters:
-
key the indentifying key for the resource, based on KoCanvasResource::CanvasResource..
Definition at line 211 of file KoCanvasResourceProvider.cpp.
| QString KoCanvasResourceProvider::stringResource | ( | int | key | ) |
Return the resource determined by param key as a QString .
- Parameters:
-
key the indentifying key for the resource, based on KoCanvasResource::CanvasResource..
Definition at line 202 of file KoCanvasResourceProvider.cpp.
The documentation for this class was generated from the following files:
