1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* contentcontrol.cpp:
*
* Copyright 2007 Novell, Inc. (http://www.novell.com)
*
* See the LICENSE file included with the distribution for details.
*
*/
#include <config.h>
#include "contentcontrol.h"
void
ContentControl::SetContent (DependencyObject *content)
{
SetValue (ContentControl::ContentProperty, Value (content));
}
DependencyObject *
ContentControl::GetContent ()
{
Value *value = GetValue (ContentControl::ContentProperty);
return value ? value->AsDependencyObject () : NULL;
}
#if 0
void
ContentControl::SetContentTemplate (DataTemplate *t)
{
SetValue (ContentControl::ContentTemplateProperty, Value (t));
}
DataTemplate *
ContentControl::GetContentTemplate ()
{
Value *value = GetValue (ContentControl::ContentTemplateProperty);
return value ? value->AsDataTemplate () : NULL;
}
#endif
void
ContentControl::SetIsEnabled (bool value)
{
SetValue (ContentControl::IsEnabledProperty, Value (value));
}
bool
ContentControl::GetIsEnabled ()
{
return GetValue (ContentControl::IsEnabledProperty)->AsBool ();
}
void
ContentControl::SetTextAlignment (TextAlignment alignment)
{
SetValue (ContentControl::TextAlignmentProperty, Value (alignment));
}
TextAlignment
ContentControl::GetTextAlignment ()
{
return (TextAlignment) GetValue (ContentControl::TextAlignmentProperty)->AsInt32 ();
}
void
ContentControl::SetTextDecorations (TextDecorations decorations)
{
SetValue (ContentControl::TextDecorationsProperty, Value (decorations));
}
TextDecorations
ContentControl::GetTextDecorations ()
{
return (TextDecorations) GetValue (ContentControl::TextDecorationsProperty)->AsInt32 ();
}
void
ContentControl::SetTextWrapping (TextWrapping wrapping)
{
SetValue (ContentControl::TextWrappingProperty, Value (wrapping));
}
TextWrapping
ContentControl::GetTextWrapping ()
{
return (TextWrapping) GetValue (ContentControl::TextWrappingProperty)->AsInt32 ();
}
|