Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/SharpVectorCore/Svg/DocumentStructure/ISvgSVGElement.cs @ 12762

Last change on this file since 12762 was 12762, checked in by aballeit, 9 years ago

#2283 GUI updates, Tree-chart, MCTS Version 2 (prune leaves)

File size: 21.6 KB
Line 
1// <developer>niklas@protocol7.com</developer>
2// <completed>20</completed>
3
4using System.Xml;
5using SharpVectors.Dom.Events;
6
7namespace SharpVectors.Dom.Svg
8{
9    /// <summary>
10    /// A key interface definition is the
11    /// <see cref="ISvgSvgElement">ISvgSvgElement</see> interface, which is
12    /// the interface that corresponds to the 'svg' element.
13    /// </summary>
14    /// <remarks>
15    /// This interface
16    /// contains various miscellaneous commonly-used utility methods, such
17    /// as matrix operations and the ability to control the time of redraw
18    /// on visual rendering devices.
19    /// <see cref="ISvgSvgElement">ISvgSvgElement</see> extends ViewCSS and
20    /// DocumentCSS to provide access to
21    /// the computed values of properties and the override style sheet as
22    /// described in DOM2.
23    /// </remarks>
24    public interface ISvgSvgElement : ISvgElement, ISvgTests, ISvgLangSpace,
25        ISvgExternalResourcesRequired, ISvgStylable, ISvgLocatable, ISvgFitToViewBox,
26        ISvgZoomAndPan, IEventTarget
27    {
28        /// <summary>
29        /// Corresponds to attribute x on the given 'svg' element.
30        /// </summary>
31        ISvgAnimatedLength X
32        {
33            get;
34        }
35
36        /// <summary>
37        /// Corresponds to attribute y on the given 'svg' element.
38        /// </summary>
39        ISvgAnimatedLength Y
40        {
41            get;
42        }
43
44        /// <summary>
45        /// Corresponds to attribute width on the given 'svg' element.
46        /// </summary>
47        ISvgAnimatedLength Width
48        {
49            get;
50        }
51
52        /// <summary>
53        /// Corresponds to attribute height on the given 'svg' element.
54        /// </summary>
55        ISvgAnimatedLength Height
56        {
57            get;
58        }
59
60        /// <summary>
61        /// Corresponds to attribute contentScriptType on the given 'svg'
62        /// element.
63        /// </summary>
64        string ContentScriptType
65        {
66            get;
67            set;
68        }
69
70        /// <summary>
71        /// Corresponds to attribute contentStyleType on the given 'svg' element.
72        /// </summary>
73        string ContentStyleType
74        {
75            get;
76            set;
77        }
78
79        /// <summary>
80        /// The position and size of the viewport (implicit or explicit) that
81        /// corresponds to this 'svg' element.
82        /// </summary>
83        /// <remarks>
84        /// <p>
85        /// When the user agent is
86        /// actually rendering the content, then the position and size values
87        /// represent the actual values when rendering. The position and size
88        /// values are unitless values in the coordinate system of the parent
89        /// element. If no parent element exists (i.e., 'svg' element
90        /// represents the root of the document tree), if this SVG document
91        /// is embedded as part of another document (e.g., via the HTML
92        /// 'object' element), then the position and size are unitless values
93        /// in the coordinate system of the parent document. (If the parent
94        /// uses CSS or XSL layout, then unitless values represent pixel units
95        /// for the current CSS or XSL viewport, as described in the CSS2
96        /// specification.) If the parent element does not have a coordinate
97        /// system, then the user agent should provide reasonable default
98        /// values for this attribute.
99        /// </p>
100        /// <p>
101        /// The object itself and its contents are both readonly.
102        /// </p>
103        /// </remarks>
104        ISvgRect Viewport
105        {
106            get;
107        }
108
109        /// <summary>
110        /// Size of a pixel unit (as defined by CSS2) along the x-axis of the
111        /// viewport, which represents a unit somewhere in the range of 70dpi
112        /// to 120dpi, and, on systems that support this, might actually match
113        /// the characteristics of the target medium.
114        /// </summary>
115        /// <remarks>
116        /// On systems where it is impossible to know the size of a pixel, a
117        /// suitable default pixel size is provided.
118        /// </remarks>
119        float PixelUnitToMillimeterX
120        {
121            get;
122        }
123
124        /// <summary>
125        /// Corresponding size of a pixel unit along the y-axis of the viewport.
126        /// </summary>
127        float PixelUnitToMillimeterY
128        {
129            get;
130        }
131
132        /// <summary>
133        /// User interface (UI) events in DOM Level 2 indicate the screen
134        /// positions at which the given UI event occurred. When the user
135        /// agent actually knows the physical size of a "screen unit", this
136        /// attribute will express that information; otherwise, user agents
137        /// will provide a suitable default value such as .28mm.
138        /// </summary>
139        float ScreenPixelToMillimeterX
140        {
141            get;
142        }
143
144        /// <summary>
145        /// Corresponding size of a screen pixel along the y-axis of the
146        /// viewport.
147        /// </summary>
148        float ScreenPixelToMillimeterY
149        {
150            get;
151        }
152
153        /// <summary>
154        /// The initial view (i.e., before magnification and panning) of the
155        /// current innermost SVG document fragment can be either the
156        /// "standard" view (i.e., based on attributes on the 'svg' element
157        /// such as fitBoxToViewport) or to a "custom" view (i.e., a
158        /// hyperlink into a particular 'view' or other element - see
159        /// <a href="http://www.w3.org/TR/SVG/linking.html#LinksIntoSVG"
160        /// >Linking into SVG content: URI fragments and SVG views</a>). If
161        /// the initial view is the "standard" view, then this attribute is
162        /// false. If the initial view is a "custom" view, then this
163        /// attribute is true.
164        /// </summary>
165        bool UseCurrentView
166        {
167            get;
168            set;
169        }
170
171        /// <summary>
172        /// The definition of the initial view (i.e., before magnification
173        /// and panning) of the current innermost SVG document fragment.
174        /// </summary>
175        /// <remarks>
176        /// The meaning depends on the situation:
177        /// <list type="bullet">
178        ///  <item><description>
179        ///  If the initial view was a "standard" view, then:
180        ///   <list type="bullet">
181        ///    <item><description>
182        ///    the values for viewBox, preserveAspectRatio and zoomAndPan
183        ///    within currentView will match the values for the corresponding
184        ///    DOM attributes that are on SVGSVGElement directly
185        ///    </description></item>
186        ///    <item><description>
187        ///    the values for transform and viewTarget within currentView will
188        ///    be null
189        ///    </description></item>
190        ///   </list>
191        ///  </description></item>
192        ///  <item><description>
193        ///  If the initial view was a link into a 'view' element, then:
194        ///    <list type="bullet">
195        ///     <item><description>
196        ///     the values for viewBox, preserveAspectRatio and zoomAndPan within
197        ///     currentView will correspond to the corresponding attributes for
198        ///     the given 'view' element
199        ///     </description></item>
200        ///     <item><description>
201        ///     the values for transform and viewTarget within currentView will
202        ///     be null
203        ///     </description></item>
204        ///    </list>
205        ///  </description></item>
206        ///  <item><description>
207        ///  If the initial view was a link into another element (i.e., other
208        ///  than a 'view'), then:
209        ///   <list type="bullet">
210        ///    <item><description>
211        ///    the values for viewBox, preserveAspectRatio and zoomAndPan
212        ///    within currentView will match the values for the corresponding
213        ///    DOM attributes that are on SVGSVGElement directly for the
214        ///    closest ancestor 'svg' element
215        ///    </description></item>
216        ///    <item><description>
217        ///    the values for transform within currentView will be null
218        ///    </description></item>
219        ///    <item><description>
220        ///    the viewTarget within currentView will represent the target of
221        ///    the link
222        ///    </description></item>
223        ///   </list>
224        ///  </description></item>
225        ///  <item><description>
226        ///  If the initial view was a link into the SVG document fragment
227        ///  using an SVG view specification fragment identifier (i.e.,
228        ///  #svgView(...)), then:
229        ///   <list type="bullet">
230        ///     <item><description>
231        ///     the values for viewBox, preserveAspectRatio, zoomAndPan,
232        ///     transform and viewTarget within currentView will correspond
233        ///     to the values from the SVG view specification fragment
234        ///     identifier
235        ///     </description></item>
236        ///   </list>
237        ///  </description></item>
238        /// </list>
239        /// The object itself and its contents are both readonly.
240        /// </remarks>
241        ISvgViewSpec CurrentView
242        {
243            get;
244        }
245
246        /// <summary>
247        /// This attribute indicates the current scale factor relative to
248        /// the initial view to take into account user magnification and
249        /// panning operations, as described under <a
250        /// href="http://www.w3.org/TR/SVG/interact.html#ZoomAndPanAttribute"
251        /// >Magnification and panning</a>.
252        /// </summary>
253        /// <remarks>
254        /// DOM attributes currentScale and currentTranslate are
255        /// equivalent to the 2x3 matrix [a b c d e f] = [currentScale 0
256        /// 0 currentScale currentTranslate.x currentTranslate.y]. If
257        /// "magnification" is enabled (i.e., zoomAndPan="magnify"), then
258        /// the effect is as if an extra transformation were placed at the
259        /// outermost level on the SVG document fragment (i.e., outside the
260        /// outermost 'svg' element).
261        /// </remarks>
262        float CurrentScale
263        {
264            get;
265            set;
266        }
267
268        /// <summary>
269        /// The corresponding translation factor that takes into account
270        /// user "magnification".
271        /// </summary>
272        ISvgPoint CurrentTranslate
273        {
274            get;
275        }
276
277        /// <summary>
278        /// Takes a time-out value which indicates that redraw shall not
279        /// occur until certain conditions are met.
280        /// </summary>
281        /// <remarks>
282        /// Takes a time-out value which indicates that redraw shall not
283        /// occur until: (a) the corresponding unsuspendRedraw(
284        /// suspend_handle_id) call has been made, (b) an
285        /// unsuspendRedrawAll() call has been made, or (c) its timer
286        /// has timed out. In environments that do not support
287        /// interactivity (e.g., print media), then redraw shall not be
288        /// suspended. suspend_handle_id = suspendRedraw(
289        /// max_wait_milliseconds) and unsuspendRedraw(suspend_handle_id)
290        /// must be packaged as balanced pairs. When you want to suspend
291        /// redraw actions as a collection of SVG DOM changes occur,
292        /// then precede the changes to the SVG DOM with a method call
293        /// similar to suspend_handle_id = suspendRedraw(
294        /// max_wait_milliseconds) and follow the changes with a method
295        /// call similar to unsuspendRedraw(suspend_handle_id). Note
296        /// that multiple suspendRedraw calls can be used at once and
297        /// that each such method call is treated independently of the
298        /// other suspendRedraw method calls.
299        /// </remarks>
300        /// <param name="max_wait_milliseconds">
301        /// The amount of time in milliseconds to hold off before redrawing
302        /// the device. Values greater than 60 seconds will be truncated down
303        /// to 60 seconds.
304        /// </param>
305        /// <returns>
306        /// A number which acts as a unique identifier for the given
307        /// suspendRedraw() call. This value must be passed as the parameter
308        /// to the corresponding unsuspendRedraw() method call.
309        /// </returns>
310        int SuspendRedraw(int max_wait_milliseconds);
311
312        /// <summary>
313        /// Cancels a specified suspendRedraw() by providing a unique
314        /// suspend_handle_id.
315        /// </summary>
316        /// <param name="suspend_handle_id">
317        /// A number which acts as a unique identifier for the desired
318        /// suspendRedraw() call. The number supplied must be a value
319        /// returned from a previous call to suspendRedraw()
320        /// </param>
321        void UnsuspendRedraw(int suspend_handle_id);
322
323        /// <summary>
324        /// Cancels all currently active suspendRedraw() method calls.
325        /// been cancelled.
326        /// </summary>
327        /// <remarks>
328        /// This method is most useful at the very end of a set of SVG
329        /// DOM calls to ensure that all pending suspendRedraw() method
330        /// calls have been cancelled.
331        /// </remarks>
332        void UnsuspendRedrawAll();
333
334        /// <summary>
335        /// In rendering environments supporting interactivity, forces the
336        /// user agent to immediately redraw all regions of the viewport
337        /// that require updating.
338        /// </summary>
339        void ForceRedraw();
340
341        /// <summary>
342        /// Suspends (i.e., pauses) all currently running animations that are
343        /// defined within the SVG document fragment corresponding to this
344        /// 'svg' element, causing the animation clock corresponding to this
345        /// document fragment to stand still until it is unpaused.
346        /// </summary>
347        void PauseAnimations();
348
349        /// <summary>
350        /// Unsuspends (i.e., unpauses) currently running animations that are
351        /// defined within the SVG document fragment, causing the animation
352        /// clock to continue from the time at which it was suspended.
353        /// </summary>
354        void UnpauseAnimations();
355
356        /// <summary>
357        /// Returns true if this SVG document fragment is in a paused state.
358        /// </summary>
359        /// <returns>
360        /// Boolean indicating whether this SVG document fragment is in a
361        /// paused state.
362        /// </returns>
363        bool AnimationsPaused();
364
365        /// <summary>
366        /// The current time in seconds relative to the start time
367        /// for the current SVG document fragment.
368        /// </summary>
369        float CurrentTime
370        {
371            get;
372            set;
373        }
374
375        /// <summary>
376        /// Returns the list of graphics elements whose rendered content
377        /// intersects the supplied rectangle, honoring the 'pointer-events'
378        /// property value on each candidate graphics element.
379        /// </summary>
380        /// <param name="rect">
381        /// The test rectangle. The values are in the initial coordinate
382        /// system for the current 'svg' element.
383        /// </param>
384        /// <param name="referenceElement">
385        /// If not null, then only return elements whose drawing order has
386        /// them below the given reference element.
387        /// </param>
388        /// <returns>
389        /// A list of Elements whose content intersects the supplied
390        /// rectangle.
391        /// </returns>
392        XmlNodeList GetIntersectionList(ISvgRect rect, ISvgElement referenceElement);
393
394        /// <summary>
395        /// Returns the list of graphics elements whose rendered content is
396        /// entirely contained within the supplied rectangle, honoring the
397        /// 'pointer-events' property value on each candidate graphics
398        /// element.
399        /// </summary>
400        /// <param name="rect">
401        /// The test rectangle. The values are in the initial coordinate
402        /// system for the current 'svg' element.
403        /// </param>
404        /// <param name="referenceElement">
405        /// If not null, then only return elements whose drawing order has
406        /// them below the given reference element.
407        /// </param>
408        /// <returns>
409        /// A list of Elements whose content is enclosed by the supplied
410        /// rectangle.
411        /// </returns>
412        XmlNodeList GetEnclosureList(ISvgRect rect, ISvgElement referenceElement);
413
414        /// <summary>
415        /// Returns true if the rendered content of the given element
416        /// intersects the supplied rectangle, honoring the 'pointer-events'
417        /// property value on each candidate graphics element.
418        /// </summary>
419        /// <param name="element">
420        /// The element on which to perform the given test.
421        /// </param>
422        /// <param name="rect">
423        /// The test rectangle. The values are in the initial coordinate
424        /// system for the current 'svg' element.
425        /// </param>
426        /// <returns>
427        /// True or false, depending on whether the given element intersects
428        /// the supplied rectangle.
429        /// </returns>
430        bool CheckIntersection(ISvgElement element, ISvgRect rect);
431
432        /// <summary>
433        /// Returns true if the rendered content of the given element is
434        /// entirely contained within the supplied rectangle, honoring the
435        /// 'pointer-events' property value on each candidate graphics
436        /// element.
437        /// </summary>
438        /// <param name="element">
439        /// The element on which to perform the given test.
440        /// </param>
441        /// <param name="rect">
442        /// The test rectangle. The values are in the initial coordinate
443        /// system for the current 'svg' element.
444        /// </param>
445        /// <returns>
446        /// True or false, depending on whether the given element is
447        /// enclosed by the supplied rectangle.
448        /// </returns>
449        bool CheckEnclosure(ISvgElement element, ISvgRect rect);
450
451        /// <summary>
452        /// Unselects any selected objects, including any selections of text
453        /// strings and type-in bars.
454        /// </summary>
455        void DeselectAll();
456
457        /// <summary>
458        /// Creates an SVGNumber object outside of any document trees. The
459        /// object is initialized to a value of zero.
460        /// </summary>
461        /// <returns>
462        /// An SVGNumber object.
463        /// </returns>
464        ISvgNumber CreateSvgNumber();
465
466        /// <summary>
467        /// Creates an SVGLength object outside of any document trees. The
468        /// object is initialized to the value of 0 user units.
469        /// </summary>
470        /// <returns>
471        /// An SVGLength object.
472        /// </returns>
473        ISvgLength CreateSvgLength();
474
475        /// <summary>
476        /// Creates an SVGAngle object outside of any document trees. The
477        /// object is initialized to the value 0 degrees (unitless).
478        /// </summary>
479        /// <returns>
480        /// An SVGAngle object.
481        /// </returns>
482        ISvgAngle CreateSvgAngle();
483
484        /// <summary>
485        /// Creates an SVGPoint object outside of any document trees. The
486        /// object is initialized to the point (0,0) in the user coordinate
487        /// system.
488        /// </summary>
489        /// <returns>
490        /// An SVGPoint object.
491        /// </returns>
492        ISvgPoint CreateSvgPoint();
493
494        /// <summary>
495        /// Creates an SVGMatrix object outside of any document trees. The
496        /// object is initialized to the identity matrix.
497        /// </summary>
498        /// <returns>
499        /// An SVGMatrix object.
500        /// </returns>
501        ISvgMatrix CreateSvgMatrix();
502
503        /// <summary>
504        /// Creates an SVGRect object outside of any document trees. The
505        /// object is initialized such that all values are set to 0 user
506        /// units.
507        /// </summary>
508        /// <returns>
509        /// An SVGRect object.
510        /// </returns>
511        ISvgRect CreateSvgRect();
512
513        /// <summary>
514        /// Creates an SVGTransform object outside of any document trees. The
515        /// object is initialized to an identity matrix transform
516        /// (SVG_TRANSFORM_MATRIX).
517        /// </summary>
518        /// <returns>
519        /// An SVGTransform object.
520        /// </returns>
521        ISvgTransform CreateSvgTransform();
522
523        /// <summary>
524        /// Creates an SVGTransform object outside of any document trees.
525        /// The object is initialized to the given matrix transform (i.e.,
526        /// SVG_TRANSFORM_MATRIX).
527        /// </summary>
528        /// <param name="matrix">
529        /// The transform matrix.
530        /// </param>
531        /// <returns>
532        /// An SVGTransform object.
533        /// </returns>
534        ISvgTransform CreateSvgTransformFromMatrix(ISvgMatrix matrix);
535
536        /// <summary>
537        /// Searches this SVG document fragment (i.e., the search is
538        /// restricted to a subset of the document tree) for an Element whose
539        /// id is given by elementId.
540        /// </summary>
541        /// <remarks>
542        /// If an Element is found, that Element is
543        /// returned. If no such element exists, returns null. Behavior is
544        /// not defined if more than one element has this id.
545        /// </remarks>
546        /// <param name="elementId">
547        /// The unique id value for an element.
548        /// </param>
549        /// <returns>
550        /// The matching element.
551        /// </returns>
552        XmlElement GetElementById(string elementId);
553    }
554}
Note: See TracBrowser for help on using the repository browser.