* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System.Drawing / System.Drawing / SystemFonts.cs
1 //
2 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining
5 // a copy of this software and associated documentation files (the
6 // "Software"), to deal in the Software without restriction, including
7 // without limitation the rights to use, copy, modify, merge, publish,
8 // distribute, sublicense, and/or sell copies of the Software, and to
9 // permit persons to whom the Software is furnished to do so, subject to
10 // the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be
13 // included in all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 //
23 // Authors:
24 //
25 //   Jordi Mas i Hernandez <jordimash@gmail.com>
26 //
27 //
28
29 #if NET_2_0
30
31 using System;
32 using System.Runtime.Serialization;
33 using System.Runtime.InteropServices;
34 using System.ComponentModel;
35
36 namespace System.Drawing
37 {
38         public sealed class SystemFonts\r
39         {
40                 private static Font caption = null;
41                 private static Font defaultfnt = null;\r
42                 private static Font dialog = null;\r
43                 private static Font icon = null;\r
44                 private static Font menu = null;\r
45                 private static Font message = null;\r
46                 private static Font smallcaption = null;\r
47                 private static Font status = null;
48                 \r
49                 static SystemFonts ()
50                 {
51
52                 }
53 \r
54                 private SystemFonts()
55                 {
56
57                 }\r
58 \r
59                 public static Font GetFontByName (string name)
60                 {
61                         if (name == "CaptionFont")
62                                 return CaptionFont;
63
64                         if (name == "DefaultFont")
65                                 return DefaultFont;
66
67                         if (name == "DialogFont")
68                                 return DialogFont;      
69
70                         if (name == "IconTitleFont")
71                                 return IconTitleFont;
72
73                         if (name == "MenuFont")
74                                 return MenuFont;
75
76                         if (name == "MessageBoxFont")
77                                 return MessageBoxFont;
78
79                         if (name == "SmallCaptionFont")
80                                 return SmallCaptionFont;
81
82                         if (name == "StatusFont")
83                                 return StatusFont;                      
84                         
85                         return null;
86                 }
87 \r
88                 public static Font CaptionFont { 
89                         get {
90                                 if (caption == null) {
91                                         caption = new Font ("Microsoft Sans Serif", 11);
92                                         caption.SysFontName = "CaptionFont";
93                                 }
94                                 return caption;
95                         }                       
96                 }
97 \r
98                 public static Font DefaultFont  { 
99                         get {
100                                 if (defaultfnt == null) {
101                                         defaultfnt = new Font ("Microsoft Sans Serif", 8.25f);
102                                         defaultfnt.SysFontName = "DefaultFont";
103                                 }
104                                 return defaultfnt;
105                         }                       
106                 }
107 \r
108                 public static Font DialogFont  { 
109                         get {
110                                 if (dialog == null) {
111                                         dialog = new Font ("Tahoma", 8);
112                                         dialog.SysFontName = "DialogFont";
113                                 }
114                                 return dialog;
115                         }                       
116                 }
117 \r
118                 public static Font IconTitleFont  { 
119                         get {
120                                 if (icon == null) {
121                                         icon = new Font ("Microsoft Sans Serif", 11);   
122                                         icon.SysFontName = "IconTitleFont";
123                                 }
124                                 return icon;
125                         }                       
126                 }
127 \r
128                 public static Font MenuFont  { 
129                         get {
130                                 if (menu == null) {
131                                         menu = new Font ("Microsoft Sans Serif", 11);
132                                         menu.SysFontName = "MenuFont";
133                                 }
134                                 return menu;
135                         }                       
136                 }
137 \r
138                 public static Font MessageBoxFont  { 
139                         get {
140                                 if (message == null) {
141                                         message = new Font ("Microsoft Sans Serif", 11);
142                                         message.SysFontName = "MessageBoxFont";
143                                 }
144                                 return message;
145                         }                       
146                 }
147 \r
148                 public static Font SmallCaptionFont  { 
149                         get {
150                                 if (smallcaption == null) {
151                                         smallcaption = new Font ("Microsoft Sans Serif", 11);
152                                         smallcaption.SysFontName = "SmallCaptionFont";
153                                 }
154                                 return smallcaption;
155                         }                       
156                 }
157
158                 public static Font StatusFont  { 
159                         get {
160                                 if (status == null) {
161                                         status = new Font ("Microsoft Sans Serif", 11);
162                                         status.SysFontName = "StatusFont";
163                                 }
164                                 return status;
165                         }                       
166                 }             \r
167         }
168 }
169
170 #endif