Add licensing info
[mono.git] / mcs / class / System.Windows.Forms / System.Windows.Forms / RichTextBox.cs
1 //
2 // System.Windows.Forms.RichTextBox.cs
3 //
4 // Author:
5 //   stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
6 //   Dennis Hayes (dennish@Raytek.com)
7 //
8 // (C) 2002/3 Ximian, Inc
9 //
10
11 //
12 // Permission is hereby granted, free of charge, to any person obtaining
13 // a copy of this software and associated documentation files (the
14 // "Software"), to deal in the Software without restriction, including
15 // without limitation the rights to use, copy, modify, merge, publish,
16 // distribute, sublicense, and/or sell copies of the Software, and to
17 // permit persons to whom the Software is furnished to do so, subject to
18 // the following conditions:
19 // 
20 // The above copyright notice and this permission notice shall be
21 // included in all copies or substantial portions of the Software.
22 // 
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 //
31 using System.Drawing;
32 using System.IO;
33
34 namespace System.Windows.Forms {
35
36         // <summary>
37         //
38         // </summary>
39
40     public class RichTextBox : TextBoxBase 
41         {
42                 private IntPtr  handleCommCtrlLib;
43
44                 //
45                 //  --- Constructor
46                 //
47                 [MonoTODO]
48                 public RichTextBox()
49                 {
50                         handleCommCtrlLib = Win32.LoadLibraryA("riched20.dll");
51                 }
52
53                 #region Properties
54                 //
55                 //  --- Public Properties
56                 //
57                 [MonoTODO]
58                 public override bool AllowDrop {
59                         get {
60                                 //FIXME:
61                                 return base.AllowDrop;
62                         }
63                         set {
64                                 //FIXME:
65                                 base.AllowDrop = value;
66                         }
67                 }
68                 [MonoTODO]
69                 public override bool AutoSize {
70                         get {
71                                 //FIXME:
72                                 return base.AutoSize;;
73                         }
74                         set {
75                                 //FIXME:
76                                 base.AutoSize = value;
77                         }
78                 }
79                 [MonoTODO]
80                 public bool AutoWordSelection {
81                         get {
82                                 throw new NotImplementedException ();
83                         }
84                         set {
85                                 throw new NotImplementedException ();
86                         }
87                 }
88                 [MonoTODO]
89                 public override Image BackgroundImage {
90                         get {
91                                 //FIXME:
92                                 return base.BackgroundImage;
93                         }
94                         set {
95                                 //FIXME:
96                                 base.BackgroundImage = value;
97                         }
98                 }
99                 [MonoTODO]
100                 public int BulletIndent {
101                         get {
102                                 throw new NotImplementedException ();
103                         }
104                         set {
105                                 throw new NotImplementedException ();
106                         }
107                 }
108                 [MonoTODO]
109                 public bool CanRedo {
110                         get {
111                                 throw new NotImplementedException ();
112                         }
113                 }
114                 [MonoTODO]
115                 public bool DetectUrls {
116                         get {
117                                 throw new NotImplementedException ();
118                         }
119                         set {
120                                 throw new NotImplementedException ();
121                         }
122                 }
123                 [MonoTODO]
124                 public override Font Font {
125                         get {
126                                 //FIXME:
127                                 return base.Font;
128                         }
129                         set {
130                                 //FIXME:
131                                 base.Font = value;
132                         }
133                 }
134                 [MonoTODO]
135                 public override Color ForeColor {
136                         get {
137                                 //FIXME:
138                                 return base.ForeColor;
139                         }
140                         set {
141                                 //FIXME:
142                                 base.ForeColor = value;
143                         }
144                 }
145                 [MonoTODO]
146                 public override int MaxLength {
147                         get {
148                                 throw new NotImplementedException ();
149                         }
150                         set {
151                                 throw new NotImplementedException ();
152                         }
153                 }
154                 [MonoTODO]
155                 public override bool Multiline {
156                         get {
157                                 throw new NotImplementedException ();
158                         }
159                         set {
160                                 throw new NotImplementedException ();
161                         }
162                 }
163                 [MonoTODO]
164                 public string RedoActionName {
165                         get {
166                                 throw new NotImplementedException ();
167                         }
168                 }
169                 [MonoTODO]
170                 public int RightMargin {
171                         get {
172                                 throw new NotImplementedException ();
173                         }
174                         set {
175                                 throw new NotImplementedException ();
176                         }
177                 }
178                 [MonoTODO]
179                 public string Rtf {
180                         get {
181                                 throw new NotImplementedException ();
182                         }
183                         set {
184                                 throw new NotImplementedException ();
185                         }
186                 }
187                 [MonoTODO]
188                 public RichTextBoxScrollBars ScrollBars {
189                         get {
190                                 throw new NotImplementedException ();
191                         }
192                         set {
193                                 throw new NotImplementedException ();
194                         }
195                 }
196                 [MonoTODO]
197                 public string SelectedRtf {
198                         get {
199                                 throw new NotImplementedException ();
200                         }
201                         set {
202                                 throw new NotImplementedException ();
203                         }
204                 }
205                 [MonoTODO]
206                 public override string SelectedText {
207                         get {
208                                 throw new NotImplementedException ();
209                         }
210                         set {
211                                 throw new NotImplementedException ();
212                         }
213                 }
214                 [MonoTODO]
215                 public HorizontalAlignment SelectionAlignment {
216                         get {
217                                 throw new NotImplementedException ();
218                         }
219                         set {
220                                 throw new NotImplementedException ();
221                         }
222                 }
223                 [MonoTODO]
224                 public bool SelectionBullet {
225                         get {
226                                 throw new NotImplementedException ();
227                         }
228                         set {
229                                 throw new NotImplementedException ();
230                         }
231                 }
232                 [MonoTODO]
233                 public int SelectionCharOffset {
234                         get {
235                                 throw new NotImplementedException ();
236                         }
237                         set {
238                                 throw new NotImplementedException ();
239                         }
240                 }
241                 [MonoTODO]
242                 public Color SelectionColor {
243                         get {
244                                 throw new NotImplementedException ();
245                         }
246                         set {
247                                 throw new NotImplementedException ();
248                         }
249                 }
250                 [MonoTODO]
251                 public Font SelectionFont {
252                         get {
253                                 throw new NotImplementedException ();
254                         }
255                         set {
256                                 throw new NotImplementedException ();
257                         }
258                 }
259                 [MonoTODO]
260                 public int SelectionHangingIndent {
261                         get {
262                                 throw new NotImplementedException ();
263                         }
264                         set {
265                                 throw new NotImplementedException ();
266                         }
267                 }
268                 [MonoTODO]
269                 public int SelectionIndent {
270                         get {
271                                 throw new NotImplementedException ();
272                         }
273                         set {
274                                 throw new NotImplementedException ();
275                         }
276                 }
277                 [MonoTODO]
278                 public override int SelectionLength {
279                         get {
280                                 throw new NotImplementedException ();
281                         }
282                         set {
283                                 throw new NotImplementedException ();
284                         }
285                 }
286                 [MonoTODO]
287                 public bool SelectionProtected {
288                         get {
289                                 throw new NotImplementedException ();
290                         }
291                         set {
292                                 throw new NotImplementedException ();
293                         }
294                 }
295                 [MonoTODO]
296                 public int SelectionRightIndent {
297                         get {
298                                 throw new NotImplementedException ();
299                         }
300                         set {
301                                 throw new NotImplementedException ();
302                         }
303                 }
304                 [MonoTODO]
305                 public int[] SelectionTabs {
306                         get {
307                                 throw new NotImplementedException ();
308                         }
309                         set {
310                                 throw new NotImplementedException ();
311                         }
312                 }
313                 [MonoTODO]
314                 public RichTextBoxSelectionTypes SelectionType {
315                         get {
316                                 throw new NotImplementedException ();
317                         }
318                 }
319                 [MonoTODO]
320                 public bool ShowSelectionMargin {
321                         get {
322                                 throw new NotImplementedException ();
323                         }
324                         set {
325                                 throw new NotImplementedException ();
326                         }
327                 }
328                 [MonoTODO]
329                 public override string Text {
330                         get {
331                                 return base.Text;
332                         }
333                         set {
334                                 base.Text = value;
335                         }
336                 }
337                 [MonoTODO]
338                 public override int TextLength {
339                         get {
340                                 throw new NotImplementedException ();
341                         }
342                 }
343                 [MonoTODO]
344                 public string UndoActionName {
345                         get {
346                                 throw new NotImplementedException ();
347                         }
348                 }
349                 [MonoTODO]
350                 public float ZoomFactor {
351                         get {
352                                 throw new NotImplementedException ();
353                         }
354                         set {
355                                 throw new NotImplementedException ();
356                         }
357                 }
358                 #endregion
359
360                 #region Public Methods
361                 //
362                 //  --- Public Methods
363                 //
364
365                 protected override void Dispose(bool disposing)
366                 {
367                         base.Dispose(disposing);
368                         Win32.FreeLibrary(handleCommCtrlLib);
369                 }
370
371
372                 [MonoTODO]
373                 public bool CanPaste(DataFormats.Format clipFormat)
374                 {
375                         throw new NotImplementedException ();
376                 }
377
378                 [MonoTODO]
379                 public int Find(char[] characterSet)
380                 {
381                         throw new NotImplementedException ();
382                 }
383                 [MonoTODO]
384                 public int Find(string str)
385                 {
386                         throw new NotImplementedException ();
387                 }
388                 [MonoTODO]
389                 public int Find(char[] characterSet, int start)
390                 {
391                         throw new NotImplementedException ();
392                 }
393                 [MonoTODO]
394                 public int Find(string str, RichTextBoxFinds options)
395                 {
396                         throw new NotImplementedException ();
397                 }
398                 [MonoTODO]
399                 public int Find(char[] characterSet, int start, int end)
400                 {
401                         throw new NotImplementedException ();
402                 }
403                 [MonoTODO]
404                 public int Find(string str, int start, RichTextBoxFinds options)
405                 {
406                         throw new NotImplementedException ();
407                 }
408                 [MonoTODO]
409                 public int Find(string str, int val1, int val2, RichTextBoxFinds finds)
410                 {
411                         throw new NotImplementedException ();
412                 }
413                 [MonoTODO]
414                 public char GetCharFromPosition(Point pt)
415                 {
416                         throw new NotImplementedException ();
417                 }
418                 [MonoTODO]
419                 public int GetLineFromCharIndex(int index)
420                 {
421                         throw new NotImplementedException ();
422                 }
423                 [MonoTODO]
424                 public Point GetPositionFromCharIndex(int index)
425                 {
426                         throw new NotImplementedException ();
427                 }
428
429                 [MonoTODO]
430                 public void LoadFile(string path)
431                 {
432                         throw new NotImplementedException ();
433                 }
434                 [MonoTODO]
435                 public void LoadFile(Stream path, RichTextBoxStreamType fileType)
436                 {
437                         throw new NotImplementedException ();
438                 }
439                 
440
441                 [MonoTODO]
442                 public void Paste(DataFormats.Format clipFormat)
443                 {
444                         throw new NotImplementedException ();
445                 }
446
447                 [MonoTODO]
448                 public void Redo()
449                 {
450                         throw new NotImplementedException ();
451                 }
452
453                 [MonoTODO]
454                 public void SaveFile(string path)
455                 {
456                         throw new NotImplementedException ();
457                 }
458                 [MonoTODO]
459                 public void SaveFile(Stream path, RichTextBoxStreamType fileType)
460                 {
461                         throw new NotImplementedException ();
462                 }
463                 [MonoTODO]
464                 public void SaveFile(string path, RichTextBoxStreamType fileType)
465                 {
466                         throw new NotImplementedException ();
467                 }
468                 #endregion
469
470                 #region Public Events
471                 //
472                 //  --- Public Events
473                 //
474                 public event ContentsResizedEventHandler ContentsResized;
475                 public event EventHandler HScroll;
476                 public event EventHandler ImeChange;
477                 public event LinkClickedEventHandler LinkClicked;
478                 public event EventHandler Protected;
479                 public event EventHandler SelectionChanged;
480                 public event EventHandler VScroll;
481                 #endregion
482
483                 #region Protected Properties
484                 //
485                 //  --- Protected Properties
486                 //
487                 [MonoTODO]
488                 protected override CreateParams CreateParams 
489                 {
490                         get {
491                                 CreateParams createParams = base.CreateParams;
492
493                                 createParams.ClassName = "RichEdit20A";
494                                 createParams.Style = (int) ( WindowStyles.WS_CHILD | WindowStyles.WS_VISIBLE);
495                                 return createParams;
496                         }               
497                 }
498
499                 [MonoTODO]
500                 protected override Size DefaultSize {
501                         get {
502                                 return new System.Drawing.Size(300,300);
503                         }
504                 }
505                 #endregion
506
507                 #region Protected Methods
508                 //
509                 //  --- Protected Methods
510                 //
511
512                 [MonoTODO]
513                 protected virtual object CreateRichEditOleCallback()
514                 {
515                         throw new NotImplementedException ();
516                 }
517
518                 [MonoTODO]
519                 protected override void OnBackColorChanged(EventArgs e)
520                 {
521                         throw new NotImplementedException ();
522                 }
523
524                 [MonoTODO]
525                 protected virtual void OnContentsResized(ContentsResizedEventArgs e)
526                 {
527                         throw new NotImplementedException ();
528                 }
529
530                 [MonoTODO]
531                 protected override void  OnContextMenuChanged(EventArgs e)
532                 {
533                         throw new NotImplementedException ();
534                 }
535
536                 [MonoTODO]
537                 protected override void  OnHandleCreated(EventArgs e)
538                 {
539                 }
540
541                 [MonoTODO]
542                 protected override void  OnHandleDestroyed(EventArgs e)
543                 {
544                         throw new NotImplementedException ();
545                 }
546
547                 [MonoTODO]
548                 protected virtual void OnHScroll(EventArgs e)
549                 {
550                         throw new NotImplementedException ();
551                 }
552
553                 [MonoTODO]
554                 protected virtual void OnImeChange(EventArgs e)
555                 {
556                         throw new NotImplementedException ();
557                 }
558
559                 [MonoTODO]
560                 protected virtual void OnLinkClicked(LinkClickedEventArgs e)
561                 {
562                         throw new NotImplementedException ();
563                 }
564
565                 [MonoTODO]
566                 protected virtual void OnProtected(EventArgs e)
567                 {
568                         throw new NotImplementedException ();
569                 }
570
571                 [MonoTODO]
572                 protected override void OnRightToLeftChanged(EventArgs e)
573                 {
574                         throw new NotImplementedException ();
575                 }
576
577                 [MonoTODO]
578                 protected virtual void OnSelectionChanged(EventArgs e)
579                 {
580                         throw new NotImplementedException ();
581                 }
582
583                 [MonoTODO]
584                 protected override void OnSystemColorsChanged(EventArgs e)
585                 {
586                         throw new NotImplementedException ();
587                 }
588
589                 [MonoTODO]
590                 protected override void OnTextChanged(EventArgs e)
591                 {
592                         throw new NotImplementedException ();
593                 }
594
595                 [MonoTODO]
596                 protected virtual void OnVScroll(EventArgs e)
597                 {
598                         throw new NotImplementedException ();
599                 }
600
601                 [MonoTODO]
602                 protected override void WndProc(ref Message m)
603                 {
604                         throw new NotImplementedException ();
605                 }
606                 #endregion
607          }
608 }