1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5 * Copyright 2007 Novell, Inc. (http://www.novell.com)
7 * See the LICENSE file included with the distribution for details.
11 #ifndef __MOON_PANEL_H__
12 #define __MOON_PANEL_H__
15 #include "frameworkelement.h"
17 /* @ContentProperty="Children" */
18 /* @Namespace=System.Windows.Controls */
19 class Panel
: public FrameworkElement
{
22 // Contains the last element where the mouse entered
24 UIElement
*mouse_over
;
29 virtual bool EmptyBackground ();
31 /* @PropertyType=Brush,GenerateAccessors */
32 const static int BackgroundProperty
;
33 /* @PropertyType=UIElementCollection,AutoCreateValue,ManagedFieldAccess=Internal,ManagedSetterAccess=Internal,GenerateAccessors */
34 const static int ChildrenProperty
;
36 /* @GenerateCBinding,GeneratePInvoke,ManagedAccess=Protected */
39 virtual void OnLoaded ();
41 virtual void ComputeBounds ();
42 virtual Size
MeasureOverride (Size availableSize
);
44 virtual Rect
GetCoverageBounds ();
45 virtual void Render (cairo_t
*cr
, Region
*region
, bool path_only
= false);
47 virtual bool InsideObject (cairo_t
*cr
, double x
, double y
);
49 virtual bool CanFindElement () { return GetBackground () != NULL
; }
51 virtual bool IsLayoutContainer () { return true; }
52 virtual bool IsContainer () { return true; }
54 virtual void ShiftPosition (Point p
);
56 virtual void OnPropertyChanged (PropertyChangedEventArgs
*args
, MoonError
*error
);
57 virtual void OnSubPropertyChanged (DependencyProperty
*prop
, DependencyObject
*obj
, PropertyChangedEventArgs
*subobj_args
);
59 virtual void OnCollectionChanged (Collection
*col
, CollectionChangedEventArgs
*args
);
60 virtual void OnCollectionItemChanged (Collection
*col
, DependencyObject
*obj
, PropertyChangedEventArgs
*args
);
62 virtual void ElementAdded (UIElement
*item
);
63 virtual void ElementRemoved (UIElement
*item
);
68 void SetBackground (Brush
*background
);
69 Brush
*GetBackground ();
71 void SetChildren (UIElementCollection
*children
);
72 UIElementCollection
*GetChildren ();
75 #endif /* __MOON_PANEL_H__ */