1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5 * Copyright 2008 Novell, Inc. (http://www.novell.com)
7 * See the LICENSE file included with the distribution for details.
11 #ifndef __MOON_GRID_H__
12 #define __MOON_GRID_H__
18 /* @Namespace=System.Windows */
26 type
= GridUnitTypeAuto
;
29 GridLength (double v
, GridUnitType t
)
36 /* @Namespace=System.Windows.Controls */
37 class ColumnDefinition
: public DependencyObject
{
39 virtual ~ColumnDefinition ();
42 /* @PropertyType=double,DefaultValue=INFINITY,GenerateAccessors */
43 const static int MaxWidthProperty
;
44 /* @PropertyType=double,DefaultValue=0.0,GenerateAccessors */
45 const static int MinWidthProperty
;
46 /* @PropertyType=GridLength,DefaultValue=GridLength (1.0\, GridUnitTypeStar),GenerateAccessors */
47 const static int WidthProperty
;
48 /* @PropertyType=double,DefaultValue=0.0,GenerateAccessors,ManagedSetterAccess=Private,ManagedFieldAccess=Private */
49 const static int ActualWidthProperty
;
51 /* @GenerateCBinding,GeneratePInvoke */
55 double GetActualWidth ();
56 void SetActualWidth (double value
);
59 void SetMaxWidth (double value
);
62 void SetMinWidth (double value
);
64 GridLength
* GetWidth();
65 void SetWidth (GridLength
*value
);
68 /* @Namespace=System.Windows.Controls */
69 class RowDefinition
: public DependencyObject
{
71 virtual ~RowDefinition ();
74 /* @PropertyType=GridLength,DefaultValue=GridLength (1.0\, GridUnitTypeStar),GenerateAccessors */
75 const static int HeightProperty
;
76 /* @PropertyType=double,DefaultValue=INFINITY,GenerateAccessors */
77 const static int MaxHeightProperty
;
78 /* @PropertyType=double,DefaultValue=0.0,GenerateAccessors */
79 const static int MinHeightProperty
;
80 /* @PropertyType=double,DefaultValue=0.0,GenerateAccessors,ManagedSetterAccess=Private,ManagedFieldAccess=Private */
81 const static int ActualHeightProperty
;
83 /* @GenerateCBinding,GeneratePInvoke */
87 double GetActualHeight ();
88 void SetActualHeight (double value
);
90 double GetMaxHeight();
91 void SetMaxHeight (double value
);
93 double GetMinHeight();
94 void SetMinHeight (double value
);
96 GridLength
* GetHeight();
97 void SetHeight (GridLength
*value
);
100 /* @Namespace=System.Windows.Controls */
101 class ColumnDefinitionCollection
: public DependencyObjectCollection
{
103 virtual ~ColumnDefinitionCollection ();
105 virtual bool AddedToCollection (Value
*value
, MoonError
*error
);
108 /* @GenerateCBinding,GeneratePInvoke,ManagedAccess=Internal */
109 ColumnDefinitionCollection ();
111 virtual Type::Kind
GetElementType () { return Type::COLUMNDEFINITION
; }
115 /* @Namespace=System.Windows.Controls */
116 class RowDefinitionCollection
: public DependencyObjectCollection
{
118 virtual ~RowDefinitionCollection ();
120 virtual bool AddedToCollection (Value
*value
, MoonError
*error
);
123 /* @GenerateCBinding,GeneratePInvoke,ManagedAccess=Internal */
124 RowDefinitionCollection ();
126 virtual Type::Kind
GetElementType () { return Type::ROWDEFINITION
; }
130 /* @Namespace=System.Windows.Controls */
131 class Grid
: public Panel
{
136 virtual void PostRender (cairo_t
*cr
, Region
*region
, bool front_to_back
);
139 /* @PropertyType=gint32,DefaultValue=0,Attached,GenerateAccessors,Validator=PositiveIntValidator */
140 const static int ColumnProperty
;
141 /* @PropertyType=ColumnDefinitionCollection,AutoCreateValue,ManagedFieldAccess=Internal,ManagedSetterAccess=Internal,GenerateAccessors */
142 const static int ColumnDefinitionsProperty
;
143 /* @PropertyType=gint32,DefaultValue=1,Attached,GenerateAccessors,Validator=IntGreaterThanZeroValidator */
144 const static int ColumnSpanProperty
;
145 /* @PropertyType=gint32,DefaultValue=0,Attached,GenerateAccessors,Validator=PositiveIntValidator */
146 const static int RowProperty
;
147 /* @PropertyType=RowDefinitionCollection,AutoCreateValue,ManagedFieldAccess=Internal,ManagedSetterAccess=Internal,GenerateAccessors */
148 const static int RowDefinitionsProperty
;
149 /* @PropertyType=gint32,DefaultValue=1,Attached,GenerateAccessors,Validator=IntGreaterThanZeroValidator */
150 const static int RowSpanProperty
;
153 * NOTE: The ShowGridLines property defaults to false but appears
154 * to be uninitialized before InitializeComponents is called
155 * causing the current moon-unit test to fail.
157 /* @PropertyType=bool,DefaultValue=false,GenerateAccessors */
158 const static int ShowGridLinesProperty
;
160 /* @GenerateCBinding,GeneratePInvoke */
163 virtual void OnPropertyChanged (PropertyChangedEventArgs
*args
, MoonError
*error
);
164 virtual void OnCollectionChanged (Collection
*col
, CollectionChangedEventArgs
*args
);
165 virtual void OnCollectionItemChanged (Collection
*col
, DependencyObject
*obj
, PropertyChangedEventArgs
*args
);
166 virtual void ComputeBounds ();
168 virtual Size
MeasureOverride (Size availableSize
);
169 virtual Size
ArrangeOverride (Size finalSize
);
171 // property accessors
172 ColumnDefinitionCollection
*GetColumnDefinitions ();
173 void SetColumnDefinitions (ColumnDefinitionCollection
* value
);
175 static gint32
GetColumn (DependencyObject
*obj
);
176 static void SetColumn (DependencyObject
*obj
, gint32 value
);
178 static gint32
GetColumnSpan (DependencyObject
*obj
);
179 static void SetColumnSpan (DependencyObject
*obj
, gint32 value
);
181 RowDefinitionCollection
*GetRowDefinitions ();
182 void SetRowDefinitions (RowDefinitionCollection
* value
);
184 static gint32
GetRow (DependencyObject
*obj
);
185 static void SetRow (DependencyObject
*obj
, gint32 value
);
187 static gint32
GetRowSpan (DependencyObject
*obj
);
188 static void SetRowSpan (DependencyObject
*obj
, gint32 value
);
190 bool GetShowGridLines ();
191 void SetShowGridLines (bool value
);
194 #endif /* __MOON_PANEL_H__ */