small fix
[mono.git] / mcs / class / System.Design / System.Windows.Forms.Design / ComponentTray.cs
1 //
2 // System.Windows.Forms.Design.ComponentTray
3 //
4 // Authors:
5 //        Ivan N. Zlatev (contact i-nZ.net)
6 //
7 // (C) 2006-2007 Ivan N. Zlatev
8
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
17 //
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
20 //
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 //
29
30 // STUBS ONLY!!!
31 //
32 //
33
34 using System;
35 using System.ComponentModel;
36 using System.ComponentModel.Design;
37 using System.Windows.Forms;
38 using System.Drawing;
39 using System.Drawing.Design;
40 using System.Collections;
41
42 namespace System.Windows.Forms.Design
43 {
44         [DesignTimeVisible (false)]
45         [ToolboxItem (false)]
46         [ProvideProperty ("Location", typeof (IComponent))]
47         public class ComponentTray : ScrollableControl, IExtenderProvider
48         {
49
50                 private IServiceProvider _serviceProvider;
51                 private IDesigner _mainDesigner = null;
52                 private bool _showLargeIcons = false;
53                 private bool _autoArrange = false;
54
55                 public ComponentTray (IDesigner mainDesigner, IServiceProvider serviceProvider)
56                 {
57                         if (mainDesigner == null) {
58                                 throw new ArgumentNullException ("mainDesigner");
59                         }
60                         if (serviceProvider == null) {
61                                 throw new ArgumentNullException ("serviceProvider");
62                         }
63
64                         _mainDesigner = mainDesigner;
65                         _serviceProvider = serviceProvider;
66                 }
67
68                 public bool AutoArrange {
69                         get { return _autoArrange; }
70                         set { _autoArrange = value; }
71                 }
72
73                 [MonoTODO]
74                 public int ComponentCount {
75                         get { return 0; }
76                 }
77
78                 public bool ShowLargeIcons {
79                         get { return _showLargeIcons; }
80                         set { _showLargeIcons = value; }
81                 }
82
83
84                 [MonoTODO]
85                 public virtual void AddComponent (IComponent component)
86                 {
87                 }
88
89                 protected virtual bool CanCreateComponentFromTool (ToolboxItem tool)
90                 {
91                         return true;
92                 }
93
94                 protected virtual bool CanDisplayComponent (IComponent component)
95                 {
96                         return false;
97                 }
98
99                 [MonoTODO]
100                 public void CreateComponentFromTool (ToolboxItem tool)
101                 {
102                 }
103
104                 [MonoTODO]
105                 protected void DisplayError (Exception e)
106                 {
107                 }
108
109                 protected override void Dispose (bool disposing)
110                 {
111                 }
112
113 #if NET_2_0
114                 [Browsable (false)]
115                 [Category ("Layout")]
116                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
117                 [DesignOnly (true)]
118                 [Localizable (false)]
119 #endif
120                 [MonoTODO]
121                 public Point GetLocation (IComponent receiver)
122                 {
123                         return new Point (0,0);
124                 }
125
126                 [MonoTODO]
127                 public void SetLocation (IComponent receiver, Point location)
128                 {
129                 }
130
131 #if NET_2_0
132                 [MonoTODO]
133                 public IComponent GetNextComponent (IComponent component, bool forward)
134                 {
135                         throw new NotImplementedException ();
136                 }
137
138                 [Browsable (false)]
139                 [Category ("Layout")]
140                 [DesignOnly (true)]
141                 [Localizable (false)]
142                 [MonoTODO]
143                 public Point GetTrayLocation (IComponent receiver)
144                 {
145                         throw new NotImplementedException ();
146                 }
147
148                 [MonoTODO]
149                 public bool IsTrayComponent (IComponent comp)
150                 {
151                         throw new NotImplementedException ();
152                 }
153
154                 [MonoTODO]
155                 public void SetTrayLocation (IComponent receiver, Point location)
156                 {
157                         throw new NotImplementedException ();
158                 }
159
160                 [MonoTODO]
161                 protected override void OnMouseDoubleClick (MouseEventArgs e)
162                 {
163                 }
164 #else
165                 [MonoTODO]
166                 protected override void OnDoubleClick (EventArgs e)
167                 {
168                 }
169 #endif
170
171                 [MonoTODO]
172                 protected override void OnDragDrop (DragEventArgs de)
173                 {
174                 }
175
176                 [MonoTODO]
177                 protected override void OnDragEnter (DragEventArgs de)
178                 {
179                 }
180
181                 [MonoTODO]
182                 protected override void OnDragLeave (EventArgs e)
183                 {
184                 }
185
186                 [MonoTODO]
187                 protected override void OnDragOver (DragEventArgs de)
188                 {
189                 }
190
191                 [MonoTODO]
192                 protected override void OnGiveFeedback (GiveFeedbackEventArgs gfevent)
193                 {
194                 }
195
196                 [MonoTODO]
197                 protected override void OnLayout (LayoutEventArgs levent)
198                 {
199                 }
200
201                 [MonoTODO]
202                 protected virtual void OnLostCapture ()
203                 {
204                 }
205
206                 [MonoTODO]
207                 protected override void OnMouseDown (MouseEventArgs e)
208                 {
209                 }
210
211                 [MonoTODO]
212                 protected override void OnMouseMove (MouseEventArgs e)
213                 {
214                 }
215
216                 [MonoTODO]
217                 protected override void OnMouseUp (MouseEventArgs e)
218                 {
219                 }
220
221                 [MonoTODO]
222                 protected override void OnPaint (PaintEventArgs pe)
223                 {
224                 }
225
226                 [MonoTODO]
227                 protected virtual void OnSetCursor ()
228                 {
229                 }
230
231                 [MonoTODO]
232                 public virtual void RemoveComponent (IComponent component)
233                 {
234                 }
235
236                 [MonoTODO]
237                 protected override void WndProc (ref Message m)
238                 {
239                         base.WndProc (ref m);
240                 }
241
242                 bool IExtenderProvider.CanExtend (object component)
243                 {
244                         return false;
245                 }
246
247                 protected override object GetService (Type service)
248                 {
249                         if (_serviceProvider != null) {
250                                 return _serviceProvider.GetService (service);
251                         }
252                         return null;
253                 }
254
255         }
256 }