2009-10-09 Chris Toshok <toshok@ximian.com>
[moon.git] / src / style.h
blob889df3420ea1120a5af360da2b3a42612fb122a3
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * style.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_STYLE_H__
12 #define __MOON_STYLE_H__
14 #include <glib.h>
16 #include "dependencyobject.h"
17 #include "collection.h"
20 // Style
22 /* @ContentProperty="Setters" */
23 /* @Namespace=System.Windows */
24 class Style : public DependencyObject {
25 public:
26 /* @PropertyType=bool,DefaultValue=false,ManagedSetterAccess=Private,GenerateAccessors,ManagedFieldAccess=Internal */
27 const static int IsSealedProperty;
28 /* @PropertyType=SetterBaseCollection,AutoCreateValue,Access=Internal,ManagedFieldAccess=Private,ManagedAccess=Public,ManagedSetterAccess=Private,GenerateAccessors */
29 const static int SettersProperty;
30 /* @PropertyType=ManagedTypeInfo,ManagedPropertyType=System.Type,Access=Internal,ManagedAccess=Public,ManagedFieldAccess=Internal */
31 const static int TargetTypeProperty;
33 /* @GenerateCBinding,GeneratePInvoke */
34 Style ();
36 /* @GenerateCBinding,GeneratePInvoke */
37 void Seal ();
40 // Property Accessors
42 void SetSetters (SetterBaseCollection *setters);
43 SetterBaseCollection *GetSetters ();
45 void SetIsSealed (bool sealed);
46 bool GetIsSealed ();
48 protected:
49 virtual ~Style ();
53 // SetterBaseCollection
55 /* @Namespace=System.Windows */
56 class SetterBaseCollection : public DependencyObjectCollection {
57 public:
58 /* @GenerateCBinding,GeneratePInvoke */
59 SetterBaseCollection ();
61 /* @PropertyType=bool,DefaultValue=false,ManagedSetterAccess=Private,GenerateAccessors */
62 const static int IsSealedProperty;
64 virtual bool AddedToCollection (Value *value, MoonError *error);
65 virtual void RemovedFromCollection (Value *value);
67 virtual Type::Kind GetElementType () { return Type::SETTERBASE; }
69 void Seal ();
72 // Property Accessors
74 void SetIsSealed (bool sealed);
75 bool GetIsSealed ();
77 protected:
78 virtual ~SetterBaseCollection () { }
80 private:
81 bool ValidateSetter (Value *value, MoonError *error);
85 // SetterBase
87 /* @Namespace=System.Windows */
88 class SetterBase : public DependencyObject {
89 protected:
90 virtual ~SetterBase () { }
92 public:
93 /* @PropertyType=bool,DefaultValue=false,ManagedSetterAccess=Internal,GenerateAccessors */
94 const static int IsSealedProperty;
96 /* @GenerateCBinding,GeneratePInvoke,ManagedAccess=Internal */
97 SetterBase ();
99 void Seal ();
102 // Property Accessors
104 void SetAttached (bool attached);
105 bool GetAttached ();
107 void SetIsSealed (bool sealed);
108 bool GetIsSealed ();
110 private:
111 bool attached;
115 // Setter
117 /* @Namespace=System.Windows */
118 /* @ManagedDependencyProperties=Manual */
119 class Setter : public SetterBase {
120 protected:
121 virtual ~Setter ();
123 public:
124 /* @PropertyType=DependencyProperty,Validator=IsSetterSealedValidator */
125 const static int PropertyProperty;
126 /* @PropertyType=object,Validator=IsSetterSealedValidator */
127 const static int ValueProperty;
129 /* @PropertyType=object */
130 const static int ConvertedValueProperty;
132 /* @GenerateCBinding,GeneratePInvoke */
133 Setter ();
135 virtual bool PermitsMultipleParents () { return false; }
138 #endif /* __MOON_STYLE_H__ */