2009-11-12 Jeffrey Stedfast <fejj@novell.com>
[moon.git] / src / popup.h
blob44e881e95123b06dd1dfb852ca704349a4644613
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * popup.h:
5 * Copyright 2009 Novell, Inc. (http://www.novell.com)
7 * See the LICENSE file included with the distribution for details.
8 *
9 */
11 #ifndef __POPUP_H__
12 #define __POPUP_H__
14 #include <glib.h>
16 #include "panel.h"
19 /* @ContentProperty="Child" */
20 /*@Namespace=System.Windows.Controls.Primitives*/
21 class Popup : public FrameworkElement {
22 public:
23 /* @PropertyType=UIElement,GenerateAccessors,Validator=ContentControlContentValidator */
24 const static int ChildProperty;
25 /* @PropertyType=double,GenerateAccessors,DefaultValue=0.0 */
26 const static int HorizontalOffsetProperty;
27 /* @PropertyType=bool,GenerateAccessors,DefaultValue=false */
28 const static int IsOpenProperty;
29 /* @PropertyType=double,GenerateAccessors,DefaultValue=0.0 */
30 const static int VerticalOffsetProperty;
32 /* @GenerateCBinding,GeneratePInvoke */
33 Popup ();
34 virtual void Dispose ();
37 // Property Accessors
39 void SetChild (UIElement *element);
40 UIElement *GetChild ();
42 void SetHorizontalOffset (double offset);
43 double GetHorizontalOffset ();
45 void SetIsOpen (bool open);
46 bool GetIsOpen ();
48 virtual void SetSurface (Surface *s);
50 void SetVerticalOffset (double offset);
51 double GetVerticalOffset ();
53 virtual void HitTest (cairo_t *cr, Point p, List *uielement_list);
54 virtual void OnPropertyChanged (PropertyChangedEventArgs *args, MoonError *error);
56 const static int OpenedEvent;
57 const static int ClosedEvent;
58 private:
59 EVENTHANDLER (Popup, ShuttingDown, Deployment, EventArgs);
60 void Hide (UIElement *child);
61 void Show (UIElement *child);
62 void PropagateIsEnabledState (UIElement *child, bool enabled_parent);
63 bool shutting_down;
64 bool visible;
68 #endif /* __POPUP_H__ */