Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Web.DataVisualization / Common / General / IChartRenderingEngine.cs
1 //-------------------------------------------------------------
2 // <copyright company=\92Microsoft Corporation\92>
3 //   Copyright © Microsoft Corporation. All Rights Reserved.
4 // </copyright>
5 //-------------------------------------------------------------
6 // @owner=alexgor, deliant
7 //=================================================================
8 //  File:               IChartRenderingEngine.cs
9 //
10 //  Namespace:  DataVisualization.Charting
11 //
12 //      Classes:        IChartRenderingEngine, IChartAnimationEngine
13 //
14 //  Purpose:    Defines interfaces which must be implemented by 
15 //                              every rendering and animation engine class. These 
16 //              interfaces are used in GDI+, SVG and Flash rendering. 
17 //              Note that animation is only available in SVG and 
18 //              Flash rendering engines.
19 //
20 //      Reviwed:        AG - Jul 15, 2003
21 //              AG - MArch 14, 2007
22 //
23 //===================================================================
24
25 #region Used namespaces
26
27 using System;
28 using System.Drawing;
29 using System.Drawing.Drawing2D;
30 using System.Drawing.Text;
31 using System.Drawing.Imaging;
32 using System.ComponentModel;
33 using System.Collections;
34
35 #endregion
36
37 #if WINFORMS_CONTROL
38     namespace System.Windows.Forms.DataVisualization.Charting
39 #else
40 namespace System.Web.UI.DataVisualization.Charting
41
42 #endif
43 {
44         /// <summary>
45     /// IChartRenderingEngine interface defines a set of methods and properties 
46     /// which must be implemented by any chart rendering engine. It contains 
47     /// methods for drawing basic shapes.
48         /// </summary>
49         internal interface IChartRenderingEngine
50         {
51                 #region Drawing Methods
52
53                 /// <summary>
54                 /// Draws a line connecting two PointF structures.
55                 /// </summary>
56                 /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
57                 /// <param name="pt1">PointF structure that represents the first point to connect.</param>
58                 /// <param name="pt2">PointF structure that represents the second point to connect.</param>
59                 void DrawLine(
60                         Pen pen,
61                         PointF pt1,
62                         PointF pt2
63                         );
64
65                 /// <summary>
66                 /// Draws a line connecting the two points specified by coordinate pairs.
67                 /// </summary>
68                 /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
69                 /// <param name="x1">x-coordinate of the first point.</param>
70                 /// <param name="y1">y-coordinate of the first point.</param>
71                 /// <param name="x2">x-coordinate of the second point.</param>
72                 /// <param name="y2">y-coordinate of the second point.</param>
73                 void DrawLine(
74                         Pen pen,
75                         float x1,
76                         float y1,
77                         float x2,
78                         float y2
79                         );
80
81                 /// <summary>
82                 /// Draws the specified portion of the specified Image object at the specified location and with the specified size.
83                 /// </summary>
84                 /// <param name="image">Image object to draw.</param>
85                 /// <param name="destRect">Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.</param>
86                 /// <param name="srcX">x-coordinate of the upper-left corner of the portion of the source image to draw.</param>
87                 /// <param name="srcY">y-coordinate of the upper-left corner of the portion of the source image to draw.</param>
88                 /// <param name="srcWidth">Width of the portion of the source image to draw.</param>
89                 /// <param name="srcHeight">Height of the portion of the source image to draw.</param>
90                 /// <param name="srcUnit">Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.</param>
91                 /// <param name="imageAttr">ImageAttributes object that specifies recoloring and gamma information for the image object.</param>
92                 void DrawImage(
93             System.Drawing.Image image,
94                         Rectangle destRect,
95                         int srcX,
96                         int srcY,
97                         int srcWidth,
98                         int srcHeight,
99                         GraphicsUnit srcUnit,
100                         ImageAttributes imageAttr
101                         );
102
103                 /// <summary>
104                 /// Draws an ellipse defined by a bounding rectangle specified by 
105                 /// a pair of coordinates, a height, and a width.
106                 /// </summary>
107                 /// <param name="pen">Pen object that determines the color, width, and style of the ellipse.</param>
108                 /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.</param>
109                 /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.</param>
110                 /// <param name="width">Width of the bounding rectangle that defines the ellipse.</param>
111                 /// <param name="height">Height of the bounding rectangle that defines the ellipse.</param>
112                 void DrawEllipse(
113                         Pen pen,
114                         float x,
115                         float y,
116                         float width,
117                         float height
118                         );
119
120                 /// <summary>
121                 /// Draws a cardinal spline through a specified array of PointF structures 
122                 /// using a specified tension. The drawing begins offset from 
123                 /// the beginning of the array.
124                 /// </summary>
125                 /// <param name="pen">Pen object that determines the color, width, and height of the curve.</param>
126                 /// <param name="points">Array of PointF structures that define the spline.</param>
127                 /// <param name="offset">Offset from the first element in the array of the points parameter to the starting point in the curve.</param>
128                 /// <param name="numberOfSegments">Number of segments after the starting point to include in the curve.</param>
129                 /// <param name="tension">Value greater than or equal to 0.0F that specifies the tension of the curve.</param>
130                 void DrawCurve(
131                         Pen pen,
132                         PointF[] points,
133                         int offset,
134                         int numberOfSegments,
135                         float tension
136                         );
137
138                 /// <summary>
139                 /// Draws a rectangle specified by a coordinate pair, a width, and a height.
140                 /// </summary>
141                 /// <param name="pen">Pen object that determines the color, width, and style of the rectangle.</param>
142                 /// <param name="x">x-coordinate of the upper-left corner of the rectangle to draw.</param>
143                 /// <param name="y">y-coordinate of the upper-left corner of the rectangle to draw.</param>
144                 /// <param name="width">Width of the rectangle to draw.</param>
145                 /// <param name="height">Height of the rectangle to draw.</param>
146                 void DrawRectangle(
147                         Pen pen,
148                         int x,
149                         int y,
150                         int width,
151                         int height
152                         );
153
154                 /// <summary>
155                 /// Draws a polygon defined by an array of PointF structures.
156                 /// </summary>
157                 /// <param name="pen">Pen object that determines the color, width, and style of the polygon.</param>
158                 /// <param name="points">Array of PointF structures that represent the vertices of the polygon.</param>
159                 void DrawPolygon(
160                         Pen pen,
161                         PointF[] points
162                         );
163
164                 /// <summary>
165                 /// Draws the specified text string in the specified rectangle with the specified Brush and Font objects using the formatting properties of the specified StringFormat object.
166                 /// </summary>
167                 /// <param name="s">String to draw.</param>
168                 /// <param name="font">Font object that defines the text format of the string.</param>
169                 /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param>
170                 /// <param name="layoutRectangle">RectangleF structure that specifies the location of the drawn text.</param>
171                 /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
172                 void DrawString(
173                         string s,
174                         Font font,
175                         Brush brush,
176                         RectangleF layoutRectangle,
177                         StringFormat format
178                         );
179
180                 /// <summary>
181                 /// Draws the specified text string at the specified location with the specified Brush and Font objects using the formatting properties of the specified StringFormat object.
182                 /// </summary>
183                 /// <param name="s">String to draw.</param>
184                 /// <param name="font">Font object that defines the text format of the string.</param>
185                 /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param>
186                 /// <param name="point">PointF structure that specifies the upper-left corner of the drawn text.</param>
187                 /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
188                 void DrawString(
189                         string s,
190                         Font font,
191                         Brush brush,
192                         PointF point,
193                         StringFormat format
194                         );
195
196                 /// <summary>
197                 /// Draws the specified portion of the specified Image object at the specified location and with the specified size.
198                 /// </summary>
199                 /// <param name="image">Image object to draw.</param>
200                 /// <param name="destRect">Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.</param>
201                 /// <param name="srcX">x-coordinate of the upper-left corner of the portion of the source image to draw.</param>
202                 /// <param name="srcY">y-coordinate of the upper-left corner of the portion of the source image to draw.</param>
203                 /// <param name="srcWidth">Width of the portion of the source image to draw.</param>
204                 /// <param name="srcHeight">Height of the portion of the source image to draw.</param>
205                 /// <param name="srcUnit">Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.</param>
206                 /// <param name="imageAttrs">ImageAttributes object that specifies recoloring and gamma information for the image object.</param>
207                 void DrawImage(
208             System.Drawing.Image image,
209                         Rectangle destRect,
210                         float srcX,
211                         float srcY,
212                         float srcWidth,
213                         float srcHeight,
214                         GraphicsUnit srcUnit,
215                         ImageAttributes imageAttrs
216                         );
217
218                 /// <summary>
219                 /// Draws a rectangle specified by a coordinate pair, a width, and a height.
220                 /// </summary>
221                 /// <param name="pen">A Pen object that determines the color, width, and style of the rectangle.</param>
222                 /// <param name="x">The x-coordinate of the upper-left corner of the rectangle to draw.</param>
223                 /// <param name="y">The y-coordinate of the upper-left corner of the rectangle to draw.</param>
224                 /// <param name="width">The width of the rectangle to draw.</param>
225                 /// <param name="height">The height of the rectangle to draw.</param>
226                 void DrawRectangle(
227                         Pen pen,
228                         float x,
229                         float y,
230                         float width,
231                         float height
232                         );
233
234                 /// <summary>
235                 /// Draws a GraphicsPath object.
236                 /// </summary>
237                 /// <param name="pen">Pen object that determines the color, width, and style of the path.</param>
238                 /// <param name="path">GraphicsPath object to draw.</param>
239                 void DrawPath(
240                         Pen pen,
241                         GraphicsPath path
242                         );
243                                                 
244                 /// <summary>
245                 /// Draws a pie shape defined by an ellipse specified by a coordinate pair, a width, and a height and two radial lines.
246                 /// </summary>
247                 /// <param name="pen">Pen object that determines the color, width, and style of the pie shape.</param>
248                 /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
249                 /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
250                 /// <param name="width">Width of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
251                 /// <param name="height">Height of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
252                 /// <param name="startAngle">Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.</param>
253                 /// <param name="sweepAngle">Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape.</param>
254                 void DrawPie(
255                         Pen pen,
256                         float x,
257                         float y,
258                         float width,
259                         float height,
260                         float startAngle,
261                         float sweepAngle
262                         );
263
264                 /// <summary>
265                 /// Draws an arc representing a portion of an ellipse specified by a pair of coordinates, a width, and a height.
266                 /// </summary>
267                 /// <param name="pen">Pen object that determines the color, width, and style of the arc.</param>
268                 /// <param name="x">x-coordinate of the upper-left corner of the rectangle that defines the ellipse.</param>
269                 /// <param name="y">y-coordinate of the upper-left corner of the rectangle that defines the ellipse.</param>
270                 /// <param name="width">Width of the rectangle that defines the ellipse.</param>
271                 /// <param name="height">Height of the rectangle that defines the ellipse.</param>
272                 /// <param name="startAngle">Angle in degrees measured clockwise from the x-axis to the starting point of the arc.</param>
273                 /// <param name="sweepAngle">Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc.</param>
274                 void DrawArc(
275                         Pen pen,
276                         float x,
277                         float y,
278                         float width,
279                         float height,
280                         float startAngle,
281                         float sweepAngle
282                         );
283
284                 /// <summary>
285                 /// Draws the specified Image object at the specified location and with the specified size.
286                 /// </summary>
287                 /// <param name="image">Image object to draw.</param>
288                 /// <param name="rect">RectangleF structure that specifies the location and size of the drawn image.</param>
289                 void DrawImage(
290             System.Drawing.Image image,
291                         RectangleF rect
292                         );
293
294                 /// <summary>
295                 /// Draws an ellipse defined by a bounding RectangleF.
296                 /// </summary>
297                 /// <param name="pen">Pen object that determines the color, width, and style of the ellipse.</param>
298                 /// <param name="rect">RectangleF structure that defines the boundaries of the ellipse.</param>
299                 void DrawEllipse(
300                         Pen pen,
301                         RectangleF rect
302                         );
303
304                 /// <summary>
305                 /// Draws a series of line segments that connect an array of PointF structures.
306                 /// </summary>
307                 /// <param name="pen">Pen object that determines the color, width, and style of the line segments.</param>
308                 /// <param name="points">Array of PointF structures that represent the points to connect.</param>
309                 void DrawLines(
310                         Pen pen,
311                         PointF[] points
312                         );
313                 
314                 #endregion // Drawing Methods
315
316                 #region Filling Methods
317
318                 /// <summary>
319                 /// Fills the interior of an ellipse defined by a bounding rectangle 
320                 /// specified by a RectangleF structure.
321                 /// </summary>
322                 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
323                 /// <param name="rect">RectangleF structure that represents the bounding rectangle that defines the ellipse.</param>
324                 void FillEllipse(
325                         Brush brush,
326                         RectangleF rect
327                         );
328
329                 /// <summary>
330                 /// Fills the interior of a GraphicsPath object.
331                 /// </summary>
332                 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
333                 /// <param name="path">GraphicsPath object that represents the path to fill.</param>
334                 void FillPath(
335                         Brush brush,
336                         GraphicsPath path
337                         );
338
339                 /// <summary>
340                 /// Fills the interior of a Region object.
341                 /// </summary>
342                 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
343                 /// <param name="region">Region object that represents the area to fill.</param>
344                 void FillRegion(
345                         Brush brush,
346                         Region region
347                         );
348
349                 /// <summary>
350                 /// Fills the interior of a rectangle specified by a RectangleF structure.
351                 /// </summary>
352                 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
353                 /// <param name="rect">RectangleF structure that represents the rectangle to fill.</param>
354                 void FillRectangle(
355                         Brush brush,
356                         RectangleF rect
357                         );
358                 
359                 /// <summary>
360                 /// Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height.
361                 /// </summary>
362                 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
363                 /// <param name="x">x-coordinate of the upper-left corner of the rectangle to fill.</param>
364                 /// <param name="y">y-coordinate of the upper-left corner of the rectangle to fill.</param>
365                 /// <param name="width">Width of the rectangle to fill.</param>
366                 /// <param name="height">Height of the rectangle to fill.</param>
367                 void FillRectangle(
368                         Brush brush,
369                         float x,
370                         float y,
371                         float width,
372                         float height
373                         );
374
375                 /// <summary>
376                 /// Fills the interior of a polygon defined by an array of points specified by PointF structures .
377                 /// </summary>
378                 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
379                 /// <param name="points">Array of PointF structures that represent the vertices of the polygon to fill.</param>
380                 void FillPolygon(
381                         Brush brush,
382                         PointF[] points
383                         );
384
385                 /// <summary>
386                 /// Fills the interior of a pie section defined by an ellipse 
387                 /// specified by a pair of coordinates, a width, and a height 
388                 /// and two radial lines.
389                 /// </summary>
390                 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
391                 /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
392                 /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
393                 /// <param name="width">Width of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
394                 /// <param name="height">Height of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
395                 /// <param name="startAngle">Angle in degrees measured clockwise from the x-axis to the first side of the pie section.</param>
396                 /// <param name="sweepAngle">Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section.</param>
397                 void FillPie(
398                         Brush brush,
399                         float x,
400                         float y,
401                         float width,
402                         float height,
403                         float startAngle,
404                         float sweepAngle
405                         );
406
407                 #endregion // Filling Methods
408
409                 #region Other Methods
410
411                 /// <summary>
412                 /// Measures the specified string when drawn with the specified 
413                 /// Font object and formatted with the specified StringFormat object.
414                 /// </summary>
415                 /// <param name="text">String to measure.</param>
416                 /// <param name="font">Font object defines the text format of the string.</param>
417                 /// <param name="layoutArea">SizeF structure that specifies the maximum layout area for the text.</param>
418                 /// <param name="stringFormat">StringFormat object that represents formatting information, such as line spacing, for the string.</param>
419                 /// <returns>This method returns a SizeF structure that represents the size, in pixels, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.</returns>
420                 SizeF MeasureString(
421                         string text,
422                         Font font,
423                         SizeF layoutArea,
424                         StringFormat stringFormat
425                         );
426
427                 /// <summary>
428                 /// Measures the specified string when drawn with the specified 
429                 /// Font object and formatted with the specified StringFormat object.
430                 /// </summary>
431                 /// <param name="text">String to measure.</param>
432                 /// <param name="font">Font object defines the text format of the string.</param>
433                 /// <returns>This method returns a SizeF structure that represents the size, in pixels, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.</returns>
434                 SizeF MeasureString(
435                         string text,
436                         Font font
437                         );
438
439                 /// <summary>
440                 /// Saves the current state of this Graphics object and identifies the saved state with a GraphicsState object.
441                 /// </summary>
442                 /// <returns>This method returns a GraphicsState object that represents the saved state of this Graphics object.</returns>
443                 GraphicsState Save();
444
445                 /// <summary>
446                 /// Restores the saved state of graphics object.
447                 /// </summary>
448                 /// <param name="gstate">State to restore.</param>
449                 void Restore(
450                         GraphicsState gstate
451                         );
452
453                 /// <summary>
454                 /// Resets the clip region of this Graphics object to an infinite region.
455                 /// </summary>
456                 void ResetClip();
457
458                 /// <summary>
459                 /// Sets the clipping region of this Graphics object to the rectangle specified by a RectangleF structure.
460                 /// </summary>
461                 /// <param name="rect">RectangleF structure that represents the new clip region.</param>
462                 void SetClip(
463                         RectangleF rect
464                         );
465
466                 /// <summary>
467                 /// Sets the clipping region of this Graphics object to the result of the 
468                 /// specified operation combining the current clip region and the 
469                 /// specified GraphicsPath object.
470                 /// </summary>
471                 /// <param name="path">GraphicsPath object to combine.</param>
472                 /// <param name="combineMode">Member of the CombineMode enumeration that specifies the combining operation to use.</param>
473                 void SetClip(
474                         GraphicsPath path,
475                         CombineMode combineMode
476                         );
477
478                 /// <summary>
479                 /// Prepends the specified translation to the transformation matrix of this Graphics object.
480                 /// </summary>
481                 /// <param name="dx">x component of the translation.</param>
482                 /// <param name="dy">y component of the translation.</param>
483                 void TranslateTransform(
484                         float dx,
485                         float dy
486                         );
487
488                 /// <summary>
489                 /// This method starts Selection mode
490                 /// </summary>
491                 /// <param name="hRef">The location of the referenced object, expressed as a URI reference.</param>
492                 /// <param name="title">Title which could be used for tooltips.</param>
493                 void BeginSelection( string hRef, string title );
494
495                 /// <summary>
496                 /// This method stops Selection mode
497                 /// </summary>
498                 void EndSelection( );
499                 
500                 #endregion // Other Methods
501                 
502                 #region Properties
503
504                 /// <summary>
505                 /// Gets or sets the world transformation for this Graphics object.
506                 /// </summary>
507                 Matrix Transform {get; set;}
508
509                 /// <summary>
510                 /// Gets or sets the rendering quality for this Graphics object.
511                 /// </summary>
512                 SmoothingMode SmoothingMode {get; set;}
513
514                 /// <summary>
515                 /// Gets or sets the rendering mode for text associated with this Graphics object.
516                 /// </summary>
517                 TextRenderingHint TextRenderingHint {get; set;}
518
519                 /// <summary>
520                 /// Gets or sets a Region object that limits the drawing region of this Graphics object.
521                 /// </summary>
522                 Region Clip {get; set;}
523
524                 /// <summary>
525                 /// Reference to the Graphics object
526                 /// </summary>
527                 Graphics Graphics {get; set;}
528                 
529                 /// <summary>
530                 /// Gets a value indicating whether the clipping region of this Graphics object is empty.
531                 /// </summary>
532                 bool IsClipEmpty {get;}
533
534                 #endregion // Properties
535         }
536 }