in plugin/:
[moon.git] / src / popup.h
blobfc39156ebbdc5fbd5bedd9f11e8a8a0fcd1b76bc
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 bool shutting_down;
63 bool visible;
67 #endif /* __POPUP_H__ */