revert previous commit
[moon.git] / src / border.h
blob70cb4c91182861c83b6146e14b72c75205034ed9
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * border.h:
5 * Copyright 2007 Novell, Inc. (http://www.novell.com)
7 * See the LICENSE file included with the distribution for details.
8 *
9 */
11 #ifndef __MOON_BORDER_H__
12 #define __MOON_BORDER_H__
14 #include <glib.h>
16 #include "frameworkelement.h"
17 #include "cornerradius.h"
20 // Border
22 /* @ContentProperty="Child" */
23 /* @Namespace=System.Windows.Controls */
24 class Border : public FrameworkElement {
25 protected:
26 virtual ~Border () { };
28 public:
29 /* @PropertyType=Brush,GenerateAccessors */
30 const static int BackgroundProperty;
31 /* @PropertyType=Brush,GenerateAccessors */
32 const static int BorderBrushProperty;
33 /* @PropertyType=Thickness,DefaultValue=Thickness(0),GenerateAccessors,Validator=BorderThicknessValidator */
34 const static int BorderThicknessProperty;
35 /* @PropertyType=UIElement,GenerateAccessors,ManagedFieldAccess=Internal */
36 const static int ChildProperty;
37 /* @PropertyType=CornerRadius,GenerateAccessors,DefaultValue=CornerRadius(0),Validator=CornerRadiusValidator */
38 const static int CornerRadiusProperty;
39 /* @PropertyType=Thickness,DefaultValue=Thickness(0),GenerateAccessors,Validator=BorderThicknessValidator */
40 const static int PaddingProperty;
42 /* @GenerateCBinding,GeneratePInvoke */
43 Border ();
45 virtual bool IsLayoutContainer () { return true; }
46 virtual void OnPropertyChanged (PropertyChangedEventArgs *args, MoonError *error);
47 virtual void OnSubPropertyChanged (DependencyProperty *prop, DependencyObject *obj, PropertyChangedEventArgs *subobj_args);
49 virtual Size MeasureOverride (Size availableSize);
50 virtual Size ArrangeOverride (Size finalSize);
52 virtual void Render (cairo_t *cr, Region *region, bool path_only = false);
54 virtual bool InsideObject (cairo_t *cr, double x, double y);
55 virtual void HitTest (cairo_t *cr, Rect r, List *uielement_list);
56 virtual bool CanFindElement () { return GetBackground () || GetBorderBrush (); }
57 // property accessors
59 Brush *GetBackground ();
60 void SetBackground (Brush *value);
62 Brush *GetBorderBrush ();
63 void SetBorderBrush (Brush *value);
65 Thickness *GetBorderThickness ();
66 void SetBorderThickness (Thickness *value);
68 UIElement *GetChild ();
69 void SetChild (UIElement *value);
71 CornerRadius *GetCornerRadius ();
72 void SetCornerRadius (CornerRadius *value);
74 Thickness *GetPadding ();
75 void SetPadding (Thickness *value);
79 #endif /* __MOON_BORDER_H__ */