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