2009-12-03 Jeffrey Stedfast <fejj@novell.com>
[moon.git] / src / popup.h
blob5186ee2f662614fc7c66bbc6c4d0e8e9d1cfe8bd
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 /* @CallInitialize */
22 class Popup : public FrameworkElement {
23 public:
24 /* @PropertyType=UIElement,GenerateAccessors,Validator=ContentControlContentValidator */
25 const static int ChildProperty;
26 /* @PropertyType=double,GenerateAccessors,DefaultValue=0.0 */
27 const static int HorizontalOffsetProperty;
28 /* @PropertyType=bool,GenerateAccessors,DefaultValue=false */
29 const static int IsOpenProperty;
30 /* @PropertyType=double,GenerateAccessors,DefaultValue=0.0 */
31 const static int VerticalOffsetProperty;
33 /* @GenerateCBinding,GeneratePInvoke */
34 Popup ();
35 virtual void Dispose ();
38 // Property Accessors
40 void SetChild (UIElement *element);
41 UIElement *GetChild ();
43 void SetHorizontalOffset (double offset);
44 double GetHorizontalOffset ();
46 void SetIsOpen (bool open);
47 bool GetIsOpen ();
49 void SetVerticalOffset (double offset);
50 double GetVerticalOffset ();
52 virtual void HitTest (cairo_t *cr, Point p, List *uielement_list);
53 virtual void OnPropertyChanged (PropertyChangedEventArgs *args, MoonError *error);
55 const static int OpenedEvent;
56 const static int ClosedEvent;
57 private:
58 EVENTHANDLER (Popup, ShuttingDown, Deployment, EventArgs);
59 void Hide (UIElement *child);
60 void Show (UIElement *child);
61 void PropagateIsEnabledState (UIElement *child, bool enabled_parent);
62 bool shutting_down;
63 bool visible;
67 #endif /* __POPUP_H__ */