added MouseWheel event support for Silverlight 3.0
[moon.git] / src / panel.h
blob3dfa490e71e27a9701c81ca5820996779bb80b43
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * panel.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_PANEL_H__
12 #define __MOON_PANEL_H__
14 #include <glib.h>
15 #include "frameworkelement.h"
17 /* @ContentProperty="Children" */
18 /* @Namespace=System.Windows.Controls */
19 class Panel : public FrameworkElement {
20 private:
22 // Contains the last element where the mouse entered
24 UIElement *mouse_over;
26 protected:
27 virtual ~Panel ();
29 virtual bool EmptyBackground ();
30 public:
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 */
37 Panel ();
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);
66 // Property Accessors
68 void SetBackground (Brush *background);
69 Brush *GetBackground ();
71 void SetChildren (UIElementCollection *children);
72 UIElementCollection *GetChildren ();
75 #endif /* __MOON_PANEL_H__ */