2009-12-03 Jeffrey Stedfast <fejj@novell.com>
[moon.git] / src / template.h
blob4d37c09ee9cdf466858c039221f492f595c88b16
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * template.h:
5 * Copyright 2008 Novell, Inc. (http://www.novell.com)
7 * See the LICENSE file included with the distribution for details.
8 *
9 */
11 #ifndef __MOON_TEMPLATE_H__
12 #define __MOON_TEMPLATE_H__
14 #include <glib.h>
16 #include "xaml.h"
17 #include "dependencyobject.h"
18 #include "control.h"
20 class XamlContext;
23 // FrameworkTemplate
25 /* @Namespace=System.Windows */
26 class FrameworkTemplate : public DependencyObject {
27 public:
28 /* @GenerateCBinding,GeneratePInvoke,ManagedAccess=Protected */
29 FrameworkTemplate ();
31 /* @GenerateCBinding,GeneratePInvoke */
32 virtual DependencyObject *GetVisualTree (FrameworkElement *templateBindingSource = NULL);
34 void SetXamlBuffer (XamlContext *context, const char *buffer);
36 protected:
37 virtual ~FrameworkTemplate ();
39 char *xaml_buffer;
40 XamlContext *xaml_context;
44 // ControlTemplate
46 /* @Namespace=System.Windows.Controls */
47 class ControlTemplate : public FrameworkTemplate {
48 public:
49 /* @PropertyType=ManagedTypeInfo,ManagedPropertyType=System.Type,Access=Internal,ManagedAccessorAccess=Public,ManagedFieldAccess=Private */
50 const static int TargetTypeProperty;
52 /* @GenerateCBinding,GeneratePInvoke */
53 ControlTemplate ();
55 protected:
56 virtual ~ControlTemplate () {}
60 // DataTemplate
62 /* @Namespace=System.Windows */
63 class DataTemplate : public FrameworkTemplate {
64 public:
65 /* @GenerateCBinding,GeneratePInvoke */
66 DataTemplate ();
68 virtual DependencyObject *GetVisualTree (FrameworkElement *templateBindingSource);
69 protected:
70 virtual ~DataTemplate () {}
73 #endif /* __MOON_TEMPLATE_H__ */