**** Merged from MCS ****
[mono-project.git] / mcs / class / System.Windows.Forms / System.Windows.Forms / DataGridColumnStyle.cs
blob2b2f696d22fbd7aa424a893f836a53c90985439e
1 //
2 // System.Windows.Forms.DataGridColumnStyle
3 //
4 // Author:
5 // stubbed out by Jaak Simm (jaaksimm@firm.ee)
6 // Dennis Hayes (dennish@Raytek.com)
7 //
8 // (C) Ximian, Inc., 2002
9 //
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.
32 using System.ComponentModel;
33 using System.Drawing;
34 using System.Collections;
36 namespace System.Windows.Forms {
38 /// <summary>
39 /// Specifies the appearance and text formatting and behavior of a System.Windows.Forms.DataGrid control column. This class is abstract.
40 /// </summary>
42 [MonoTODO]
43 public abstract class DataGridColumnStyle : Component, IDataGridColumnStyleEditingNotificationService {
45 #region Fields
46 HorizontalAlignment alignment;
47 DataGridTableStyle dataGridTableStyle;
48 int fontHeight;
49 string headerText;
50 string mappingName;
51 string nullText;
52 PropertyDescriptor propertyDescriptor;
53 bool readOnly;
54 int width;
55 #endregion
57 #region Constructors
58 [MonoTODO]
59 public DataGridColumnStyle() {
60 alignment=HorizontalAlignment.Left;
61 dataGridTableStyle=null;
62 fontHeight=-1;
63 headerText="";
64 readOnly=false;
67 [MonoTODO]
68 public DataGridColumnStyle(PropertyDescriptor prop) : this() {
69 propertyDescriptor=prop;
71 #endregion
73 #region Properties
74 public virtual HorizontalAlignment Alignment {
75 get { return alignment; }
76 set { alignment=value; }
79 public virtual DataGridTableStyle DataGridTableStyle {
80 get { return dataGridTableStyle; }
83 protected int FontHeight {
84 get { return fontHeight; }
87 // This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
88 [MonoTODO] public AccessibleObject HeaderAccessibleObject {
89 get{
90 throw new NotImplementedException ();
94 public virtual string HeaderText {
95 get { return headerText; }
96 set { headerText=value; }
99 public string MappingName {
100 get { return mappingName; }
101 set { mappingName=value; }
104 public virtual string NullText {
105 get { return nullText; }
106 set { nullText=value; }
109 public virtual PropertyDescriptor PropertyDescriptor {
110 get { return propertyDescriptor; }
111 set { propertyDescriptor=value; }
114 public virtual bool ReadOnly {
115 get { return readOnly; }
116 set { readOnly=value; }
119 public virtual int Width {
120 get { return width; }
121 set { width=value; }
123 #endregion
125 #region Methods
126 protected internal abstract void Abort(int rowNum);
128 [MonoTODO]
129 protected void BeginUpdate() {
130 //FIXME:
133 [MonoTODO]
134 protected void CheckValidDataSource(CurrencyManager value) {
135 //FIXME:
138 [MonoTODO]
139 protected internal virtual void ColumnStartedEditing(Control editingControl) {
140 //FIXME:
143 protected internal abstract bool Commit(CurrencyManager dataSource,int rowNum);
146 [MonoTODO]
147 protected internal virtual void ConcedeFocus() {
148 //FIXME:
151 //This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
152 [MonoTODO]
153 protected virtual AccessibleObject CreateHeaderAccessibleObject(){
154 throw new NotImplementedException ();
158 [MonoTODO]
159 protected internal virtual void Edit(CurrencyManager source) {
160 //FIXME:
163 [MonoTODO]
164 protected internal virtual void Edit(CurrencyManager source, int rowNum) {
165 //FIXME:
168 [MonoTODO]
169 protected internal abstract void Edit(CurrencyManager source, int rowNum, Rectangle bounds,
170 bool readOnly, string instantText, bool cellIsVisible);
172 [MonoTODO]
173 protected void EndUpdate() {
174 //FIXME:
177 [MonoTODO]
178 protected internal virtual void EnterNullValue() {
179 //FIXME:
182 [MonoTODO]
183 protected internal virtual object GetColumnValueAtRow(CurrencyManager source,int rowNum) {
184 throw new NotImplementedException ();
187 protected internal abstract int GetMinimumHeight();
189 protected internal abstract int GetPreferredHeight(Graphics g,object value);
191 protected internal abstract Size GetPreferredSize(Graphics g,object value);
194 * This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
196 [MonoTODO]
197 void IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing(Control editingControl) {
198 //FIXME:
201 [MonoTODO]
202 protected virtual void Invalidate() {
203 //FIXME:
206 protected internal abstract void Paint(Graphics g,Rectangle bounds,CurrencyManager source,int rowNum);
208 protected internal abstract void Paint(Graphics g,Rectangle bounds,CurrencyManager source,int rowNum,bool alignToRight);
210 [MonoTODO]
211 protected internal virtual void Paint(Graphics g, Rectangle bounds, CurrencyManager source,
212 int rowNum, Brush backBrush, Brush foreBrush, bool alignToRight) {
213 //FIXME:
216 [MonoTODO]
217 public void ResetHeaderText() {
218 //FIXME:
221 [MonoTODO]
222 protected internal virtual void SetColumnValueAtRow(CurrencyManager source,int rowNum,object value) {
223 //FIXME:
226 [MonoTODO]
227 protected virtual void SetDataGrid(DataGrid value) {
228 //FIXME:
231 [MonoTODO]
232 protected virtual void SetDataGridInColumn(DataGrid value) {
233 //FIXME:
236 [MonoTODO]
237 protected internal virtual void UpdateUI(CurrencyManager source,int rowNum,string instantText) {
238 //FIXME:
240 #endregion
242 #region Events
244 public event EventHandler AlignmentChanged;
246 // This member supports the .NET Framework infrastructure and is not intended to be used directly from your code
247 public event EventHandler FontChanged;
250 public event EventHandler HeaderTextChanged;
251 public event EventHandler MappingNameChanged;
252 public event EventHandler NullTextChanged;
253 public event EventHandler PropertyDescriptorChanged;
254 public event EventHandler ReadOnlyChanged;
255 public event EventHandler WidthChanged;
256 #endregion
258 /// sub-classes:
259 /// This type supports the .NET Framework infrastructure and is not intended to be used directly from your code.
261 protected class CompModSwitches{
263 protected class DataGridColumnHeaderAccessibleObject : AccessibleObject{