[[BackLinksMenu]]
[[TicketQuery(summary=FRAME_TEMPLATES_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|)]]
= Analysis =
== Overview ==
Frame templates provide the ability a frame to be saved as template and used to create new frames. Frame elements that are included into the template are frame properties (excluding z-order) and frame content. Frame templates can be accessed via Frames in Library flap. In later revisions a template editor may be present.
=== Frame behavior ===
* Creating - A frame template can be created by dragging the frame to the Frames in Library flap. Other ways may be present too (file -> save frame as template)
* Saving - When a frame is saved as template, the changed properties of the frame are saved - the other properties are with their previous (default) value.
* Editing - When a template is edited, the changes apply to all of the frames created with this template. A warning dialog is showed. Editing global templates reflect to all books that use this template. [[BR]]
When a frame created from a template is edited, it's "Use Template" checkbox is unchecked. If checked again, the value defined for this property is reset.
== Task requirements ==
You should provide templating of the following frame properties:
* position (frame bounds without z-order) (See Comments section)
* size (frame bounds without z-order)
* insets
* padding
* margins
* content
* border style
* color
* thickness?
* opacity
* shadow style
* color
* thickness
* opacity
* background style
* image
* color
* opacity
=== Frame HUD ===
* In the frame hud checkboxes "Use template" and "Lock" should be present for the following
* position
* size
* insets
* content
* border style
* shadow style
* background style
"Use template" resets the property to the template's value. This should be implemented in this task. [[BR]]
"Lock" prevents the property value from changing. This should be implemented in [wiki:FRAME_PROPERTY_LOCKING_R0]
== Task result ==
The result of this task should be code. You should provide a prototype of frame templating.
== Implementation idea ==
Provide templating for size, position, shadow, border and background. Provide templating for subelements if there is enough time.
== Related ==
[wiki:PAGE_TEMPLATES_R0] [[BR]]
[wiki:FRAME_CONTENT_R0] [[BR]]
[wiki:FRAME_BOUNDS_R0] [[BR]]
[wiki:FRAME_INSETS_R0] [[BR]]
[wiki:FRAME_MARGINS_R0] [[BR]]
[wiki:FRAME_PADDING_R0] [[BR]]
[wiki:FRAME_BORDERS_R0] [[BR]]
[wiki:FRAME_POSITION_R0] [[BR]]
[wiki:FRAME_SIZE_R0] [[BR]]
[wiki:FRAME_PROPERTY_LOCKING_R0]
== How to demo ==
Create frame insert feature (like text, image, etc).
= Design =
* Add following properties in the Frame class:
* RwProp template() - value property - It is the template frame of the frame.
* RwProp ownBorder() - The own border of this frame. It can be manipulated through a hud.
* Prop border() -auto property - It will be calculated depending on ownBorder(), template() and borderLock()
* RwProp ownBackground() - The own background of this frame. It can be manipulated through a hud.
* Prop background() -auto property - It will be calculated depending on ownBackground(), template() and backgroundLock()
* RwProp ownShadow() - The own shadow of this frame. It can be manipulated through a hud.
* Prop shadow() -auto property - It will be calculated depending on ownShadow(), template() and shadowLock()
= Implementation =
= Testing =
= Comments =
Different behavior should be present for creating a frame by dragging it or menu (when dragged, property "position" should not be used.) Saving the z-order should be discussed as it may be useful.