2009-10-20 Chris Toshok <toshok@ximian.com>
[moon.git] / src / contentcontrol.h
blob68b84c8dbd6f9a5110e27b0b294275243eeeeef7
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * contentcontrol.h:
5 * Copyright 2007-2009 Novell, Inc. (http://www.novell.com)
7 * See the LICENSE file included with the distribution for details.
8 *
9 */
11 #ifndef __CONTENT_CONTROL_H__
12 #define __CONTENT_CONTROL_H__
14 #include <glib.h>
15 #include "control.h"
18 /* @Namespace=None */
19 class ContentChangedEventArgs : public EventArgs {
20 Value *old_content;
21 Value *new_content;
23 protected:
24 virtual ~ContentChangedEventArgs ();
26 public:
27 ContentChangedEventArgs (Value *old_content, Value *new_content);
29 /* @GenerateCBinding,GeneratePInvoke */
30 Value *GetOldContent ();
32 /* @GenerateCBinding,GeneratePInvoke */
33 Value *GetNewContent ();
37 /* @ContentProperty="Content" */
38 /* @Namespace=System.Windows.Controls */
39 /* @CallInitialize */
40 class ContentControl : public Control {
41 protected:
42 virtual ~ContentControl ();
44 public:
45 /* @PropertyType=object,Validator=ContentControlContentValidator */
46 const static int ContentProperty;
47 /* @PropertyType=DataTemplate,GenerateAccessors */
48 const static int ContentTemplateProperty;
50 /* @GenerateCBinding,GeneratePInvoke */
51 ContentControl ();
53 virtual bool ApplyTemplate ();
55 virtual void OnPropertyChanged (PropertyChangedEventArgs *args, MoonError *error);
58 // Property Accessors
60 void SetContentTemplate (DataTemplate *t);
61 DataTemplate *GetContentTemplate ();
63 /* @GenerateCBinding,GeneratePInvoke */
64 void SetContentSetsParent (bool value) { content_sets_parent = value; }
65 /* @GenerateCBinding,GeneratePInvoke */
66 bool GetContentSetsParent () { return content_sets_parent; }
69 // Events
71 /* @GenerateManagedEvent=false */
72 const static int ContentChangedEvent;
74 private:
75 bool content_sets_parent;
78 #endif /* __CONTENT_CONTROL_H__ */