summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpius.lee <pius.lee@samsung.com>2017-03-24 20:13:51 +0900
committerpius.lee <pius.lee@samsung.com>2017-05-10 15:08:47 +0900
commit2d53b498a74b0ad1cb243fea7157c9450dde5e4d (patch)
treeb877e3c090bfb7fd24b326a4795be17443487e41
parentb449cfb1b97fc9d0d3835be6e05445aca7b4c14d (diff)
downloadelm-sharp-2d53b498a74b0ad1cb243fea7157c9450dde5e4d.tar.gz
elm-sharp-2d53b498a74b0ad1cb243fea7157c9450dde5e4d.tar.bz2
elm-sharp-2d53b498a74b0ad1cb243fea7157c9450dde5e4d.zip
Now Widget inherit the AccessibleObject. AccessibleObject is implement of the IAccessibleObject. AccessibleUtil inherit the EvasObject. AccessibleUtil for Say static method. AccessibleRelation can be use for relationship between AccessibleObjects And another enums used in Accessible API. Change-Id: Ied3dbeb326ac80a9dfe94d3ffa2926c88c460141 Signed-off-by: pius.lee <pius.lee@samsung.com>
-rwxr-xr-xElmSharp.Test/ElmSharp.Test.csproj5
-rw-r--r--ElmSharp.Test/TC/AccessibilityRelationTest.cs254
-rw-r--r--ElmSharp.Test/TC/AccessibilityRoleTest.cs56
-rw-r--r--ElmSharp.Test/TC/AccessibilityTest.cs286
-rw-r--r--ElmSharp.Test/TC/Log.cs60
-rw-r--r--ElmSharp/ElmSharp.csproj10
-rw-r--r--ElmSharp/ElmSharp/AccessRole.cs126
-rw-r--r--ElmSharp/ElmSharp/AccessibleObject.cs183
-rw-r--r--ElmSharp/ElmSharp/AccessibleRelation.cs188
-rw-r--r--ElmSharp/ElmSharp/AccessibleUtil.cs71
-rw-r--r--ElmSharp/ElmSharp/IAccessibleObject.cs34
-rw-r--r--ElmSharp/ElmSharp/ItemObjectExtension.cs33
-rw-r--r--ElmSharp/ElmSharp/ReadingInfoType.cs30
-rwxr-xr-xElmSharp/ElmSharp/Widget.cs3
-rw-r--r--ElmSharp/Interop/Interop.Elementary.Accessibility.cs249
-rw-r--r--packaging/elm-sharp.spec2
16 files changed, 1586 insertions, 4 deletions
diff --git a/ElmSharp.Test/ElmSharp.Test.csproj b/ElmSharp.Test/ElmSharp.Test.csproj
index 0333f12..ed2ba74 100755
--- a/ElmSharp.Test/ElmSharp.Test.csproj
+++ b/ElmSharp.Test/ElmSharp.Test.csproj
@@ -40,11 +40,14 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="TC\AccessibilityRelationTest.cs" />
+ <Compile Include="TC\AccessibilityTest.cs" />
<Compile Include="TC\BackgroundTest1.cs" />
<Compile Include="TC\BackgroundTest2.cs" />
<Compile Include="TC\BackgroundTest3.cs" />
<Compile Include="TC\GenListTest10.cs" />
<Compile Include="TC\LabelTest4.cs" />
+ <Compile Include="TC\Log.cs" />
<Compile Include="TC\MultibuttonEntryTest1.cs" />
<Compile Include="TC\DateTimeSelectorTest2.cs" />
<Compile Include="TC\EntryTest2.cs" />
@@ -201,4 +204,4 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
-</Project> \ No newline at end of file
+</Project>
diff --git a/ElmSharp.Test/TC/AccessibilityRelationTest.cs b/ElmSharp.Test/TC/AccessibilityRelationTest.cs
new file mode 100644
index 0000000..53ccf2c
--- /dev/null
+++ b/ElmSharp.Test/TC/AccessibilityRelationTest.cs
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Linq;
+using ElmSharp;
+using ElmSharp.Accessible;
+
+namespace ElmSharp.Test
+{
+ class AccessibilityRelationTest : TestCaseBase
+ {
+ public override string TestName => "AccessibilityRelationTest";
+ public override string TestDescription => "Accessibility Relation API test";
+
+ public override void Run(Window win)
+ {
+ Conformant conformant = new Conformant(win);
+ conformant.Show();
+
+ Box box = new Box(win);
+ box.Show();
+ conformant.SetContent(box);
+
+ Button button1 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "LabelledBy" };
+ Label label1 = new Label(win) { Text = "LabelFor" };
+
+ button1.Show();
+ label1.Show();
+
+ box.PackEnd(button1);
+ box.PackEnd(label1);
+
+ ((IAccessibleObject)button1).AppendRelation(new LabelledBy() { Target = label1 });
+ ((IAccessibleObject)label1).AppendRelation(new LabelFor() { Target = button1 });
+
+ button1.Clicked += (s, e) =>
+ {
+ ((IAccessibleObject)button1).RemoveRelation(new LabelledBy() { Target = label1 });
+ ((IAccessibleObject)label1).RemoveRelation(new LabelFor() { Target = button1 });
+ };
+
+ Label label8 = new Label(win) { WeightX = 1, AlignmentX = -1, Text = "ControlledBy" };
+ Button button3 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "ControllerFor" };
+
+ label8.Show();
+ button3.Show();
+
+ box.PackEnd(label8);
+ box.PackEnd(button3);
+
+ ((IAccessibleObject)label8).AppendRelation(new ControlledBy() { Target = button3 });
+ ((IAccessibleObject)button3).AppendRelation(new ControllerFor() { Target = label8 });
+
+ button3.Clicked += (s, e) =>
+ {
+ ((IAccessibleObject)label8).RemoveRelation(new ControlledBy() { Target = button3 });
+ ((IAccessibleObject)button3).RemoveRelation(new ControllerFor() { Target = label8 });
+ };
+
+ Box box2 = new Box(win) { WeightX = 1, AlignmentX = -1};
+ Label label2 = new Label(win) { Text = "Group" };
+ Button button4 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "Member" };
+
+ box2.Show();
+ label2.Show();
+ button4.Show();
+
+ ((IAccessibleObject)label2).AppendRelation(new LabelFor() { Target = box2 });
+ ((IAccessibleObject)label2).AppendRelation(new MemberOf() { Target = box2 });
+ ((IAccessibleObject)box2).AppendRelation(new LabelledBy() { Target = label2 });
+ ((IAccessibleObject)button4).AppendRelation(new MemberOf() { Target = box2 });
+
+ box2.PackEnd(label2);
+ box2.PackEnd(button4);
+ box.PackEnd(box2);
+
+ button4.Clicked += (s, e) =>
+ {
+ ((IAccessibleObject)label2).RemoveRelation(new LabelFor() { Target = box2 });
+ ((IAccessibleObject)label2).RemoveRelation(new MemberOf() { Target = box2 });
+ ((IAccessibleObject)box2).RemoveRelation(new LabelledBy() { Target = label2 });
+ ((IAccessibleObject)button4).RemoveRelation(new MemberOf() { Target = box2 });
+ };
+
+ Button button6 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "Xbutton" };
+ Label label3 = new Label(win) { Text = "Tooltip of Xbutton" };
+
+ button6.Show();
+ label3.Show();
+
+ ((IAccessibleObject)label3).AppendRelation(new TooltipFor() { Target = button6 });
+
+ box.PackEnd(button6);
+ box.PackEnd(label3);
+
+ button6.Clicked += (s, e) =>
+ {
+ ((IAccessibleObject)label3).RemoveRelation(new TooltipFor() { Target = button6 });
+ };
+
+ Box box3 = new Box(win) { WeightX = 1, AlignmentX = -1};
+ Label label4 = new Label(win) { Text = "Child of inner box" };
+ Button button7 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "child of inner box" };
+
+ box3.Show();
+ label4.Show();
+ button7.Show();
+
+ ((IAccessibleObject)box3).AppendRelation(new ParentOf() { Target = label4 });
+ ((IAccessibleObject)box3).AppendRelation(new ParentOf() { Target = button7 });
+ ((IAccessibleObject)label4).AppendRelation(new ChildOf() { Target = box3 });
+ ((IAccessibleObject)button7).AppendRelation(new ChildOf() { Target = box3 });
+
+ box3.PackEnd(label4);
+ box3.PackEnd(button7);
+ box.PackEnd(box3);
+
+ button7.Clicked += (s, e) =>
+ {
+ ((IAccessibleObject)box3).RemoveRelation(new ParentOf() { Target = label4 });
+ ((IAccessibleObject)box3).RemoveRelation(new ParentOf() { Target = button7 });
+ ((IAccessibleObject)label4).RemoveRelation(new ChildOf() { Target = box3 });
+ ((IAccessibleObject)button7).RemoveRelation(new ChildOf() { Target = box3 });
+ };
+
+ Label label6 = new Label(win) { Text = "Extended" };
+ Button button12 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "Not Extended" };
+
+ label6.Show();
+ button12.Show();
+
+ ((IAccessibleObject)label6).AppendRelation(new Extended() { Target = button12 });
+
+ box.PackEnd(button12);
+ box.PackEnd(label6);
+
+ button12.Clicked += (s, e) =>
+ {
+ ((IAccessibleObject)label6).RemoveRelation(new Extended() { Target = button12 });
+ };
+
+ Button button8 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "FlowsTo" };
+ Button button9 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "FlowsFrom" };
+
+ button8.Show();
+ button9.Show();
+
+ ((IAccessibleObject)button8).AppendRelation(new FlowsTo() { Target = button9 });
+ ((IAccessibleObject)button9).AppendRelation(new FlowsFrom() { Target = button8 });
+
+ box.PackEnd(button8);
+ box.PackEnd(button9);
+
+ button8.Clicked += (s, e) =>
+ {
+ ((IAccessibleObject)button8).RemoveRelation(new FlowsTo() { Target = button9 });
+ };
+
+ button9.Clicked += (s, e) =>
+ {
+ ((IAccessibleObject)button9).RemoveRelation(new FlowsFrom() { Target = button8 });
+ };
+
+ Button button10 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "EmbeddedBy" };
+
+ button10.Show();
+
+ ((IAccessibleObject)button10).AppendRelation(new EmbeddedBy() { Target = box });
+ ((IAccessibleObject)box).AppendRelation(new Embeds() { Target = button10 });
+
+ box.PackEnd(button10);
+
+ button10.Clicked += (s, e) =>
+ {
+ ((IAccessibleObject)button10).RemoveRelation(new EmbeddedBy() { Target = box });
+ ((IAccessibleObject)box).RemoveRelation(new Embeds() { Target = button10 });
+ };
+
+ Button button11 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "popup" };
+
+ button11.Show();
+
+ Popup popup = new Popup(win)
+ {
+ Orientation = PopupOrientation.Top,
+ Timeout = 5
+ };
+ popup.Append("Popup!!");
+
+ ((IAccessibleObject)popup).AppendRelation(new PopupFor() { Target = button11 });
+ ((IAccessibleObject)popup).AppendRelation(new SubwindowOf() { Target = box });
+ ((IAccessibleObject)box).AppendRelation(new ParentWindowOf() { Target = popup });
+
+ popup.OutsideClicked += (s, e) =>
+ {
+ popup.Hide();
+ };
+
+
+ button11.Clicked += (s, e) =>
+ {
+ popup.Show();
+ };
+
+ box.PackEnd(button11);
+
+ Button button13 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "Remove Popup Relation"};
+
+ button13.Show();
+
+ box.PackEnd(button13);
+
+ button13.Clicked += (s, e) =>
+ {
+ ((IAccessibleObject)popup).RemoveRelation(new PopupFor() { Target = button11 });
+ ((IAccessibleObject)popup).RemoveRelation(new SubwindowOf() { Target = box });
+ ((IAccessibleObject)box).RemoveRelation(new ParentWindowOf() { Target = popup });
+ };
+
+ Label label7 = new Label(win) { WeightX = 1, AlignmentX = -1,
+ Text = "This is Test for Accessibility Relation Append Test"};
+ label7.Show();
+
+ ((IAccessibleObject)label7).AppendRelation(new DescriptionFor() { Target = box });
+ ((IAccessibleObject)box).AppendRelation(new DescribedBy() { Target = label7 });
+
+ box.PackEnd(label7);
+
+ Button button14 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "Remove Description Relation"};
+ button14.Show();
+ box.PackEnd(button14);
+
+ button14.Clicked += (s, e) =>
+ {
+ ((IAccessibleObject)label7).RemoveRelation(new DescriptionFor() { Target = box });
+ ((IAccessibleObject)box).RemoveRelation(new DescribedBy() { Target = label7 });
+ };
+ }
+ }
+}
diff --git a/ElmSharp.Test/TC/AccessibilityRoleTest.cs b/ElmSharp.Test/TC/AccessibilityRoleTest.cs
new file mode 100644
index 0000000..aeccbb6
--- /dev/null
+++ b/ElmSharp.Test/TC/AccessibilityRoleTest.cs
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Linq;
+using ElmSharp;
+using ElmSharp.Accessible;
+
+namespace ElmSharp.Test
+{
+ class AccessibilityRoleTest : TestCaseBase
+ {
+ public override string TestName => "AccessibilityRoleTest";
+ public override string TestDescription => "Accessibility Role API test";
+
+ public override void Run(Window win)
+ {
+ Conformant conformant = new Conformant(win);
+ conformant.Show();
+
+ Box box = new Box(win);
+ box.Show();
+
+ // AcceleratorLabel
+ Label acceleratorLabel = new Label(win)
+ {
+ Text = "AcceleratorLabel"
+ };
+
+ Label alertLabel = new Label(win)
+ {
+ Text = "Alert";
+ };
+
+ Label Animation = new Label(win)
+ {
+ };
+
+ conformant.SetContent(conformant);
+ }
+ }
+}
+
diff --git a/ElmSharp.Test/TC/AccessibilityTest.cs b/ElmSharp.Test/TC/AccessibilityTest.cs
new file mode 100644
index 0000000..3072f1b
--- /dev/null
+++ b/ElmSharp.Test/TC/AccessibilityTest.cs
@@ -0,0 +1,286 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Linq;
+using ElmSharp;
+using ElmSharp.Accessible;
+
+namespace ElmSharp.Test
+{
+ class AccessibilityTest : TestCaseBase
+ {
+ public override string TestName => "AccessibilityTest";
+ public override string TestDescription => "Accessibility API test";
+
+ int sequence = 0;
+ Naviframe navi;
+
+ Array accessRoleValues;
+
+ public override void Run(Window window)
+ {
+ accessRoleValues = Enum.GetValues(typeof(AccessRole));
+
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+
+ navi = new Naviframe(window)
+ {
+ PreserveContentOnPop = true,
+ DefaultBackButtonEnabled = true
+ };
+
+ navi.Push(CreatePage(window, "Main page"), "first page");
+ navi.Show();
+ conformant.SetContent(navi);
+ }
+
+ static string StatusStr(ReadingStatus status)
+ {
+ if (status == ReadingStatus.Unknown)
+ {
+ return "Unknown";
+ }
+ else if (status == ReadingStatus.Cancelled)
+ {
+ return "Cancelled";
+ }
+ else if (status == ReadingStatus.Stoppped)
+ {
+ return "Stopped";
+ }
+ else if (status == ReadingStatus.Skipped)
+ {
+ return "Skipped";
+ }
+ else
+ {
+ return "invalid";
+ }
+ }
+
+ Widget CreatePage(Window win, string pageName)
+ {
+ Box box = new Box(win);
+ ((IAccessibleObject)box).Name = pageName;
+
+ box.Show();
+
+ Button abutton = new Button(win)
+ {
+ Text = "Accessibility-normal",
+ WeightX = 1,
+ AlignmentX = -1
+ };
+ ((IAccessibleObject)abutton).TranslationDomain = "kr";
+ ((IAccessibleObject)abutton).Name = "Accessibility";
+ ((IAccessibleObject)abutton).Description = "Description for Accessibility";
+
+ Label abutton_label = new Label(win)
+ {
+ WeightX = 1,
+ AlignmentX = -1
+ };
+ abutton_label.Text =
+ "domain : " + ((IAccessibleObject)abutton).TranslationDomain +
+ ", name : " + ((IAccessibleObject)abutton).Name +
+ ", desc : " + ((IAccessibleObject)abutton).Description;
+
+ Button bbutton = new Button(win)
+ {
+ Text = "Accessibility-provider",
+ WeightX = 1,
+ AlignmentX = -1
+ };
+ ((IAccessibleObject)bbutton).NameProvider = (obj) => "Name-provider";
+ ((IAccessibleObject)bbutton).DescriptionProvider = (obj) => "Description-provider";
+
+ Label bbutton_label = new Label(win)
+ {
+ WeightX = 1,
+ AlignmentX = -1
+ };
+ bbutton_label.Text =
+ "name : " + ((IAccessibleObject)bbutton).Name +
+ ", desc : " + ((IAccessibleObject)bbutton).Description;
+
+ Button cbutton = new Button(win)
+ {
+ Text = "Readingtype,CanHighlight",
+ WeightX = 1,
+ AlignmentX = -1
+ };
+ ((IAccessibleObject)cbutton).ReadingInfoType =
+ ReadingInfoType.Name | ReadingInfoType.Role | ReadingInfoType.Description;
+ ((IAccessibleObject)cbutton).Name = "FooFoo";
+ ((IAccessibleObject)cbutton).Role = AccessRole.Text;
+ ((IAccessibleObject)cbutton).Description = "FooFooButton";
+ Label name_onoff_label = new Label(win)
+ {
+ Text = "ReadingInfoType.Name : " +
+ ((((IAccessibleObject)cbutton).ReadingInfoType & ReadingInfoType.Name) != 0 ? "on" : "off"),
+ WeightX = 1,
+ AlignmentX = -1
+ };
+ Label role_onoff_label = new Label(win)
+ {
+ Text = "ReadingInfoType.Role : " +
+ ((((IAccessibleObject)cbutton).ReadingInfoType & ReadingInfoType.Role) != 0 ? "on" : "off"),
+ WeightX = 1,
+ AlignmentX = -1
+ };
+ Label description_onoff_label = new Label(win)
+ {
+ Text = "ReadingInfoType.Description : " +
+ ((((IAccessibleObject)cbutton).ReadingInfoType & ReadingInfoType.Description) != 0 ? "on" : "off"),
+ WeightX = 1,
+ AlignmentX = -1
+ };
+ Label state_onoff_label = new Label(win)
+ {
+ Text = "ReadingInfoType.State : " +
+ ((((IAccessibleObject)cbutton).ReadingInfoType & ReadingInfoType.State) != 0 ? "on" : "off"),
+ WeightX = 1,
+ AlignmentX = -1
+ };
+
+ Button saybutton = new Button(win)
+ {
+ Text = "HHGG with false",
+ WeightX = 1,
+ AlignmentX = -1
+ };
+
+ Button saybutton2 = new Button(win)
+ {
+ Text = "HHGG with true",
+ WeightX = 1,
+ AlignmentX = -1
+ };
+
+ int labelIndex = 0;
+ Button roleButton = new Button(win)
+ {
+ WeightX = 1,
+ AlignmentX = -1
+ };
+
+ roleButton.Clicked += (s, e) =>
+ {
+ if (labelIndex >= accessRoleValues.Length)
+ {
+ labelIndex = 0;
+ }
+
+ IAccessibleObject obj = roleButton as IAccessibleObject;
+ AccessRole role = (AccessRole) accessRoleValues.GetValue(labelIndex);
+ obj.Role = role;
+ roleButton.Text = Enum.GetName(typeof(AccessRole), obj.Role);
+
+ labelIndex++;
+ };
+
+ Label label = new Label(win)
+ {
+ Text = string.Format("{0} Apple", sequence++),
+ WeightX = 1,
+ AlignmentX = -1
+ };
+ ((IAccessibleObject)label).Name = "Apple";
+
+ Button push = new Button(win)
+ {
+ Text = "Push",
+ WeightX = 1,
+ AlignmentX = -1
+ };
+ ((IAccessibleObject)push).Name = "PushButton";
+
+ Button pop = new Button(win)
+ {
+ Text = "pop",
+ WeightX = 1,
+ AlignmentX = -1,
+ };
+ ((IAccessibleObject)pop).Name = "PopButton";
+
+ abutton.Show();
+ abutton_label.Show();
+ bbutton.Show();
+ bbutton_label.Show();
+ cbutton.Show();
+ name_onoff_label.Show();
+ role_onoff_label.Show();
+ description_onoff_label.Show();
+ state_onoff_label.Show();
+ saybutton.Show();
+ saybutton2.Show();
+ roleButton.Show();
+ label.Show();
+ push.Show();
+ pop.Show();
+
+ push.Clicked += (s, e) =>
+ {
+ NaviItem item = navi.Push(CreatePage(win, string.Format("Apple {0}", sequence -1)), string.Format("Page {0}", sequence -1));
+ };
+
+ Label statusLog = new Label(win)
+ {
+ WeightX = 1,
+ AlignmentX = -1
+ };
+ statusLog.Show();
+
+ saybutton.Clicked += (s, e) =>
+ {
+ AccessibleUtil.Say("The Hitchhiker's Guide to the Galaxy", false)
+ .ContinueWith(status => { statusLog.Text = StatusStr(status.Result); });
+ };
+ saybutton2.Clicked += (s, e) =>
+ {
+ AccessibleUtil.Say("The Hitchhiker's Guide to the Galaxy", true)
+ .ContinueWith(status => { statusLog.Text = StatusStr(status.Result); });
+ };
+
+ pop.Clicked += (s, e) =>
+ {
+ var item = navi.NavigationStack.LastOrDefault();
+ navi.Pop();
+ };
+
+ box.PackEnd(abutton);
+ box.PackEnd(abutton_label);
+ box.PackEnd(bbutton);
+ box.PackEnd(bbutton_label);
+ box.PackEnd(cbutton);
+ box.PackEnd(name_onoff_label);
+ box.PackEnd(role_onoff_label);
+ box.PackEnd(description_onoff_label);
+ box.PackEnd(state_onoff_label);
+ box.PackEnd(saybutton);
+ box.PackEnd(saybutton2);
+ box.PackEnd(roleButton);
+ box.PackEnd(label);
+ box.PackEnd(push);
+ box.PackEnd(pop);
+ box.PackEnd(statusLog);
+
+ return box;
+ }
+ }
+}
diff --git a/ElmSharp.Test/TC/Log.cs b/ElmSharp.Test/TC/Log.cs
new file mode 100644
index 0000000..37313aa
--- /dev/null
+++ b/ElmSharp.Test/TC/Log.cs
@@ -0,0 +1,60 @@
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+namespace ElmSharp.Test
+{
+ internal static class Log
+ {
+ const string Library = "libdlog.so.0";
+ const string TAG = "ElmSharp.Test";
+
+ public static void Debug(string message,
+ [CallerFilePath] string file = "",
+ [CallerMemberName] string func = "",
+ [CallerLineNumber] int line = 0)
+ {
+ Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line);
+ }
+
+ public static void Info(string message,
+ [CallerFilePath] string file = "",
+ [CallerMemberName] string func = "",
+ [CallerLineNumber] int line = 0)
+ {
+ Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line);
+ }
+
+ public static void Error(string message,
+ [CallerFilePath] string file = "",
+ [CallerMemberName] string func = "",
+ [CallerLineNumber] int line = 0)
+ {
+ Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line);
+ }
+
+ internal enum LogPriority
+ {
+ DLOG_UNKNOWN = 0,
+ DLOG_DEFAULT,
+ DLOG_VERBOSE,
+ DLOG_DEBUG,
+ DLOG_INFO,
+ DLOG_WARN,
+ DLOG_ERROR,
+ DLOG_FATAL,
+ DLOG_SILENT,
+ DLOG_PRIO_MAX,
+ }
+
+ private static void Print(LogPriority priority, string tag, string message, string file, string func, int line)
+ {
+ FileInfo finfo = new FileInfo(file);
+ Print(priority, tag, "%s: %s(%d) > %s", finfo.Name, func, line, message);
+ }
+
+ [DllImportAttribute(Library, EntryPoint = "dlog_print")]
+ internal static extern int Print(LogPriority prio, string tag, string fmt, string file, string func, int line, string msg);
+ }
+}
diff --git a/ElmSharp/ElmSharp.csproj b/ElmSharp/ElmSharp.csproj
index eca6288..8a90bfb 100644
--- a/ElmSharp/ElmSharp.csproj
+++ b/ElmSharp/ElmSharp.csproj
@@ -44,6 +44,14 @@
<AssemblyOriginatorKeyFile>ElmSharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
+ <Compile Include="ElmSharp\AccessRole.cs" />
+ <Compile Include="ElmSharp\AccessibleObject.cs" />
+ <Compile Include="ElmSharp\AccessibleRelation.cs" />
+ <Compile Include="ElmSharp\AccessibleUtil.cs" />
+ <Compile Include="ElmSharp\IAccessibleObject.cs" />
+ <Compile Include="ElmSharp\ItemObjectExtension.cs" />
+ <Compile Include="ElmSharp\ReadingInfoType.cs" />
+ <Compile Include="Interop\Interop.Elementary.Accessibility.cs" />
<Compile Include="ElmSharp\Background.cs" />
<Compile Include="ElmSharp\Box.cs" />
<Compile Include="ElmSharp\Button.cs" />
@@ -187,4 +195,4 @@
<_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>
<AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
</PropertyGroup>
-</Project>
+</Project> \ No newline at end of file
diff --git a/ElmSharp/ElmSharp/AccessRole.cs b/ElmSharp/ElmSharp/AccessRole.cs
new file mode 100644
index 0000000..3ff8e35
--- /dev/null
+++ b/ElmSharp/ElmSharp/AccessRole.cs
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+namespace ElmSharp.Accessible
+{
+ public enum AccessRole
+ {
+ Invalid,
+ AcceleratorLabel,
+ Alert,
+ Animation,
+ Arrow,
+ Calendar,
+ Canvas,
+ CheckBox,
+ CheckMenuItem,
+ ColorChooser,
+ ColumnHeader,
+ ComboBox,
+ DateEditor,
+ DesktopIcon,
+ DesktopFrame,
+ Dial,
+ Dialog,
+ DirectoryPane,
+ DrawingArea,
+ FileChooser,
+ Filler,
+ FocusTraversable,
+ FontChooser,
+ Frame,
+ GlassPane,
+ HtmlContainer,
+ Icon,
+ Image,
+ InternalFrame,
+ Label,
+ LayeredPane,
+ List,
+ ListItem,
+ Menu,
+ MenuBar,
+ MenuItem,
+ OptionPane,
+ PageTab,
+ PageTabList,
+ Panel,
+ PasswordText,
+ PopupMenu,
+ ProgressBar,
+ PushButton,
+ RadioButton,
+ RadioMenuItem,
+ RootPane,
+ RowHeader,
+ ScrollBar,
+ ScrollPane,
+ Separator,
+ Slider,
+ SpinButton,
+ SplitPane,
+ StatusBar,
+ Table,
+ TableCell,
+ TableColumnHeader,
+ TableRowHeader,
+ TearoffMenuItem,
+ Terminal,
+ Text,
+ ToggleButton,
+ ToolBar,
+ ToolTip,
+ Tree,
+ TreeTable,
+ Unknown,
+ Viewport,
+ Window,
+ Extended,
+ Header,
+ Footer,
+ Paragraph,
+ Ruler,
+ Application,
+ Autocomplete,
+ Editbar,
+ Embedded,
+ Entry,
+ Chart,
+ Caption,
+ DocumentFrame,
+ Heading,
+ Page,
+ Section,
+ RedundantObject,
+ Form,
+ Link,
+ InputMethodWindow,
+ TableRow,
+ TreeItem,
+ DocumentSpreadsheet,
+ DocumentPresentation,
+ DocumentText,
+ DocumentWeb,
+ DocumentEmail,
+ Comment,
+ ListBox,
+ Grouping,
+ ImageMap,
+ Notification,
+ InfoBar
+ }
+}
diff --git a/ElmSharp/ElmSharp/AccessibleObject.cs b/ElmSharp/ElmSharp/AccessibleObject.cs
new file mode 100644
index 0000000..02ede3b
--- /dev/null
+++ b/ElmSharp/ElmSharp/AccessibleObject.cs
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace ElmSharp.Accessible
+{
+
+ public delegate string AccessibleInfoProvider (AccessibleObject obj);
+
+ public abstract class AccessibleObject : EvasObject, IAccessibleObject
+ {
+
+ AccessibleInfoProvider _nameProvider;
+ AccessibleInfoProvider _descriptionProvider;
+
+ Interop.Elementary.Elm_Atspi_Reading_Info_Cb _nameProviderInternal;
+ Interop.Elementary.Elm_Atspi_Reading_Info_Cb _descriptionProviderInternal;
+
+ ReadingInfoType IAccessibleObject.ReadingInfoType
+ {
+ get
+ {
+ return (ReadingInfoType)Interop.Elementary.elm_atspi_accessible_reading_info_type_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_atspi_accessible_reading_info_type_set(Handle,
+ (Interop.Elementary.Elm_Accessible_Reading_Info_Type)value);
+ }
+ }
+ AccessRole IAccessibleObject.Role
+ {
+ get
+ {
+ return (AccessRole)Interop.Elementary.elm_atspi_accessible_role_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_atspi_accessible_role_set(Handle,
+ (Interop.Elementary.Elm_Atspi_Role)value);
+ }
+ }
+ bool IAccessibleObject.CanHighlight
+ {
+ get
+ {
+ return Interop.Elementary.elm_atspi_accessible_can_highlight_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_atspi_accessible_can_highlight_set(Handle, value);
+ }
+ }
+ string IAccessibleObject.TranslationDomain
+ {
+ get
+ {
+ return Interop.Elementary.elm_atspi_accessible_translation_domain_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_atspi_accessible_translation_domain_set(Handle, value);
+ }
+ }
+ string IAccessibleObject.Name
+ {
+ get
+ {
+ return Interop.Elementary.elm_atspi_accessible_name_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_atspi_accessible_name_set(Handle, value);
+ }
+ }
+ string IAccessibleObject.Description
+ {
+ get
+ {
+ return Interop.Elementary.elm_atspi_accessible_description_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_atspi_accessible_description_set(Handle, value);
+ }
+ }
+
+ AccessibleInfoProvider IAccessibleObject.NameProvider
+ {
+ get
+ {
+ return _nameProvider;
+ }
+
+ set
+ {
+ if (_nameProviderInternal == null)
+ {
+ _nameProviderInternal = (data, obj) => _nameProvider(this);
+ }
+ if (value == null)
+ {
+ _nameProvider = null;
+ Interop.Elementary.elm_atspi_accessible_name_cb_set(Handle, null, IntPtr.Zero);
+ }
+ else
+ {
+ _nameProvider = new AccessibleInfoProvider(value);
+ Interop.Elementary.elm_atspi_accessible_name_cb_set(Handle, _nameProviderInternal, IntPtr.Zero);
+ }
+ }
+ }
+ AccessibleInfoProvider IAccessibleObject.DescriptionProvider
+ {
+ get
+ {
+ return _descriptionProvider;
+ }
+
+ set
+ {
+ if (_descriptionProviderInternal == null)
+ {
+ _descriptionProviderInternal = (data, obj) => _descriptionProvider(this);
+ }
+ if (value == null)
+ {
+ _descriptionProvider = null;
+ Interop.Elementary.elm_atspi_accessible_description_cb_set(Handle, null, IntPtr.Zero);
+ }
+ else
+ {
+ _descriptionProvider = new AccessibleInfoProvider(value);
+ Interop.Elementary.elm_atspi_accessible_description_cb_set(Handle, _descriptionProviderInternal, IntPtr.Zero);
+ }
+ }
+ }
+
+ public AccessibleObject(EvasObject parent) : base(parent)
+ {
+ }
+
+ public AccessibleObject() : base()
+ {
+ }
+
+ void IAccessibleObject.AppendRelation(IAccessibleRelation relation)
+ {
+ if (relation.Target == null) throw new ArgumentException("Target of Accessibility relation can not be null");
+ Interop.Elementary.elm_atspi_accessible_relationship_append(Handle, relation.Type, relation.Target.Handle);
+ }
+
+ void IAccessibleObject.RemoveRelation(IAccessibleRelation relation)
+ {
+ if (relation.Target == null) throw new ArgumentException("Target of Accessibility relation can not be null");
+ Interop.Elementary.elm_atspi_accessible_relationship_remove(Handle, relation.Type, relation.Target.Handle);
+ }
+
+ public void Highlight()
+ {
+ Interop.Elementary.elm_atspi_component_highlight_grab(Handle);
+ }
+
+ public void Unhighlight()
+ {
+ Interop.Elementary.elm_atspi_component_highlight_clear(Handle);
+ }
+ }
+}
diff --git a/ElmSharp/ElmSharp/AccessibleRelation.cs b/ElmSharp/ElmSharp/AccessibleRelation.cs
new file mode 100644
index 0000000..b909778
--- /dev/null
+++ b/ElmSharp/ElmSharp/AccessibleRelation.cs
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+namespace ElmSharp.Accessible
+{
+ public interface IAccessibleRelation
+ {
+
+ AccessibleObject Target { get; set; }
+ int Type { get; }
+ }
+
+ public class LabelledBy : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_LABELLED_BY; }
+ }
+ }
+
+ public class LabelFor : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_LABEL_FOR; }
+ }
+ }
+
+ public class ControllerFor : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_CONTROLLER_FOR; }
+ }
+ }
+
+ public class ControlledBy : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_CONTROLLED_BY; }
+ }
+ }
+
+ public class MemberOf : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_MEMBER_OF; }
+ }
+ }
+
+ public class TooltipFor : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_TOOLTIP_FOR; }
+ }
+ }
+
+ public class ChildOf : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_NODE_CHILD_OF; }
+ }
+ }
+
+ public class ParentOf : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_NODE_PARENT_OF; }
+ }
+ }
+
+ public class Extended : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_EXTENDED; }
+ }
+ }
+
+ public class FlowsTo : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_FLOWS_TO; }
+ }
+ }
+
+ public class FlowsFrom : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_FLOWS_FROM; }
+ }
+ }
+
+ public class SubwindowOf : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_SUBWINDOW_OF; }
+ }
+ }
+
+ public class Embeds : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_EMBEDS; }
+ }
+ }
+
+ public class EmbeddedBy : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_EMBEDDED_BY; }
+ }
+ }
+
+ public class PopupFor : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_POPUP_FOR; }
+ }
+ }
+
+ public class ParentWindowOf : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_PARENT_WINDOW_OF; }
+ }
+ }
+
+ public class DescriptionFor : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_DESCRIPTION_FOR; }
+ }
+ }
+
+ public class DescribedBy : IAccessibleRelation
+ {
+ public AccessibleObject Target { get; set; }
+ public int Type
+ {
+ get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_DESCRIBED_BY; }
+ }
+ }
+}
diff --git a/ElmSharp/ElmSharp/AccessibleUtil.cs b/ElmSharp/ElmSharp/AccessibleUtil.cs
new file mode 100644
index 0000000..174a81b
--- /dev/null
+++ b/ElmSharp/ElmSharp/AccessibleUtil.cs
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Accessible
+{
+ public enum ReadingStatus
+ {
+ Unknown,
+ Cancelled,
+ Stoppped,
+ Skipped
+ }
+
+ public static class AccessibleUtil
+ {
+
+ static void AtspiSignalCallback(IntPtr data, string say_signal)
+ {
+ GCHandle gch = GCHandle.FromIntPtr(data);
+ TaskCompletionSource<ReadingStatus> tcs = (TaskCompletionSource<ReadingStatus>) gch.Target;
+ if (say_signal.Equals("ReadingCancelled"))
+ {
+ tcs.SetResult(ReadingStatus.Cancelled);
+ }
+ else if (say_signal.Equals("ReadingStopped"))
+ {
+ tcs.SetResult(ReadingStatus.Stoppped);
+ }
+ else if (say_signal.Equals("ReadingSkipped"))
+ {
+ tcs.SetResult(ReadingStatus.Skipped);
+ }
+ else
+ {
+ tcs.SetException(new InvalidOperationException("unknown signal : " + say_signal));
+ }
+
+ gch.Free();
+ }
+
+ /*
+ * ReadingCancelled is never appear if discardable is true.
+ * ReadingStoppped is appear on end of normal operation.
+ * I don't know when the ReadingSkipped is appeared.
+ */
+ public static Task<ReadingStatus> Say(string text, bool discardable)
+ {
+ var tcs = new TaskCompletionSource<ReadingStatus>();
+ GCHandle gch = GCHandle.Alloc(tcs);
+ Interop.Elementary.elm_atspi_bridge_utils_say(text, discardable, AtspiSignalCallback, GCHandle.ToIntPtr(gch));
+ return tcs.Task;
+ }
+ }
+}
diff --git a/ElmSharp/ElmSharp/IAccessibleObject.cs b/ElmSharp/ElmSharp/IAccessibleObject.cs
new file mode 100644
index 0000000..bf633b1
--- /dev/null
+++ b/ElmSharp/ElmSharp/IAccessibleObject.cs
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace ElmSharp.Accessible
+{
+ public interface IAccessibleObject
+ {
+ ReadingInfoType ReadingInfoType { get; set; }
+ AccessRole Role { get; set; }
+ bool CanHighlight { get; set; }
+ string TranslationDomain { get; set; }
+ string Name { get; set; }
+ string Description { get; set; }
+ AccessibleInfoProvider NameProvider { get; set; }
+ AccessibleInfoProvider DescriptionProvider { get; set; }
+ void AppendRelation(IAccessibleRelation relation);
+ void RemoveRelation(IAccessibleRelation relation);
+ void Highlight();
+ void Unhighlight();
+ }
+}
diff --git a/ElmSharp/ElmSharp/ItemObjectExtension.cs b/ElmSharp/ElmSharp/ItemObjectExtension.cs
new file mode 100644
index 0000000..420c048
--- /dev/null
+++ b/ElmSharp/ElmSharp/ItemObjectExtension.cs
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace ElmSharp
+{
+ public static class ItemObjectExtension
+ {
+ public static void GrabHighlight(this ItemObject obj)
+ {
+ Interop.Elementary.elm_atspi_component_highlight_grab(obj.Handle);
+ }
+
+ public static void ClearHighlight(this ItemObject obj)
+ {
+ Interop.Elementary.elm_atspi_component_highlight_clear(obj.Handle);
+ }
+ }
+}
diff --git a/ElmSharp/ElmSharp/ReadingInfoType.cs b/ElmSharp/ElmSharp/ReadingInfoType.cs
new file mode 100644
index 0000000..846a063
--- /dev/null
+++ b/ElmSharp/ElmSharp/ReadingInfoType.cs
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace ElmSharp.Accessible
+{
+ [Flags]
+ public enum ReadingInfoType
+ {
+ None = 0,
+ Name = 0x1,
+ Role = 0x2,
+ Description = 0x4,
+ State = 0x8
+ }
+}
diff --git a/ElmSharp/ElmSharp/Widget.cs b/ElmSharp/ElmSharp/Widget.cs
index f963191..ccd9ef4 100755
--- a/ElmSharp/ElmSharp/Widget.cs
+++ b/ElmSharp/ElmSharp/Widget.cs
@@ -16,6 +16,7 @@
using System;
using System.Collections.Generic;
+using ElmSharp.Accessible;
namespace ElmSharp
{
@@ -54,7 +55,7 @@ namespace ElmSharp
/// The Widget is abstract class, it is the parent of other widgets.
/// Inherits from <see cref="EvasObject"/>.
/// </summary>
- public abstract class Widget : EvasObject
+ public abstract class Widget : AccessibleObject
{
Dictionary<string, EvasObject> _partContents = new Dictionary<string, EvasObject>();
diff --git a/ElmSharp/Interop/Interop.Elementary.Accessibility.cs b/ElmSharp/Interop/Interop.Elementary.Accessibility.cs
new file mode 100644
index 0000000..fc3bc6b
--- /dev/null
+++ b/ElmSharp/Interop/Interop.Elementary.Accessibility.cs
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ internal enum Elm_Atspi_Relation_Type
+ {
+ ELM_ATSPI_RELATION_NULL,
+ ELM_ATSPI_RELATION_LABEL_FOR,
+ ELM_ATSPI_RELATION_LABELLED_BY,
+ ELM_ATSPI_RELATION_CONTROLLER_FOR,
+ ELM_ATSPI_RELATION_CONTROLLED_BY,
+ ELM_ATSPI_RELATION_MEMBER_OF,
+ ELM_ATSPI_RELATION_TOOLTIP_FOR,
+ ELM_ATSPI_RELATION_NODE_CHILD_OF,
+ ELM_ATSPI_RELATION_NODE_PARENT_OF,
+ ELM_ATSPI_RELATION_EXTENDED,
+ ELM_ATSPI_RELATION_FLOWS_TO,
+ ELM_ATSPI_RELATION_FLOWS_FROM,
+ ELM_ATSPI_RELATION_SUBWINDOW_OF,
+ ELM_ATSPI_RELATION_EMBEDS,
+ ELM_ATSPI_RELATION_EMBEDDED_BY,
+ ELM_ATSPI_RELATION_POPUP_FOR,
+ ELM_ATSPI_RELATION_PARENT_WINDOW_OF,
+ ELM_ATSPI_RELATION_DESCRIPTION_FOR,
+ ELM_ATSPI_RELATION_DESCRIBED_BY,
+ ELM_ATSPI_RELATION_LAST_DEFINED,
+ }
+
+ internal enum Elm_Atspi_Role
+ {
+ ELM_ATSPI_ROLE_INVALID,
+ ELM_ATSPI_ROLE_ACCELERATOR_LABEL,
+ ELM_ATSPI_ROLE_ALERT,
+ ELM_ATSPI_ROLE_ANIMATION,
+ ELM_ATSPI_ROLE_ARROW,
+ ELM_ATSPI_ROLE_CALENDAR,
+ ELM_ATSPI_ROLE_CANVAS,
+ ELM_ATSPI_ROLE_CHECK_BOX,
+ ELM_ATSPI_ROLE_CHECK_MENU_ITEM,
+ ELM_ATSPI_ROLE_COLOR_CHOOSER,
+ ELM_ATSPI_ROLE_COLUMN_HEADER,
+ ELM_ATSPI_ROLE_COMBO_BOX,
+ ELM_ATSPI_ROLE_DATE_EDITOR,
+ ELM_ATSPI_ROLE_DESKTOP_ICON,
+ ELM_ATSPI_ROLE_DESKTOP_FRAME,
+ ELM_ATSPI_ROLE_DIAL,
+ ELM_ATSPI_ROLE_DIALOG,
+ ELM_ATSPI_ROLE_DIRECTORY_PANE,
+ ELM_ATSPI_ROLE_DRAWING_AREA,
+ ELM_ATSPI_ROLE_FILE_CHOOSER,
+ ELM_ATSPI_ROLE_FILLER,
+ ELM_ATSPI_ROLE_FOCUS_TRAVERSABLE,
+ ELM_ATSPI_ROLE_FONT_CHOOSER,
+ ELM_ATSPI_ROLE_FRAME,
+ ELM_ATSPI_ROLE_GLASS_PANE,
+ ELM_ATSPI_ROLE_HTML_CONTAINER,
+ ELM_ATSPI_ROLE_ICON,
+ ELM_ATSPI_ROLE_IMAGE,
+ ELM_ATSPI_ROLE_INTERNAL_FRAME,
+ ELM_ATSPI_ROLE_LABEL,
+ ELM_ATSPI_ROLE_LAYERED_PANE,
+ ELM_ATSPI_ROLE_LIST,
+ ELM_ATSPI_ROLE_LIST_ITEM,
+ ELM_ATSPI_ROLE_MENU,
+ ELM_ATSPI_ROLE_MENU_BAR,
+ ELM_ATSPI_ROLE_MENU_ITEM,
+ ELM_ATSPI_ROLE_OPTION_PANE,
+ ELM_ATSPI_ROLE_PAGE_TAB,
+ ELM_ATSPI_ROLE_PAGE_TAB_LIST,
+ ELM_ATSPI_ROLE_PANEL,
+ ELM_ATSPI_ROLE_PASSWORD_TEXT,
+ ELM_ATSPI_ROLE_POPUP_MENU,
+ ELM_ATSPI_ROLE_PROGRESS_BAR,
+ ELM_ATSPI_ROLE_PUSH_BUTTON,
+ ELM_ATSPI_ROLE_RADIO_BUTTON,
+ ELM_ATSPI_ROLE_RADIO_MENU_ITEM,
+ ELM_ATSPI_ROLE_ROOT_PANE,
+ ELM_ATSPI_ROLE_ROW_HEADER,
+ ELM_ATSPI_ROLE_SCROLL_BAR,
+ ELM_ATSPI_ROLE_SCROLL_PANE,
+ ELM_ATSPI_ROLE_SEPARATOR,
+ ELM_ATSPI_ROLE_SLIDER,
+ ELM_ATSPI_ROLE_SPIN_BUTTON,
+ ELM_ATSPI_ROLE_SPLIT_PANE,
+ ELM_ATSPI_ROLE_STATUS_BAR,
+ ELM_ATSPI_ROLE_TABLE,
+ ELM_ATSPI_ROLE_TABLE_CELL,
+ ELM_ATSPI_ROLE_TABLE_COLUMN_HEADER,
+ ELM_ATSPI_ROLE_TABLE_ROW_HEADER,
+ ELM_ATSPI_ROLE_TEAROFF_MENU_ITEM,
+ ELM_ATSPI_ROLE_TERMINAL,
+ ELM_ATSPI_ROLE_TEXT,
+ ELM_ATSPI_ROLE_TOGGLE_BUTTON,
+ ELM_ATSPI_ROLE_TOOL_BAR,
+ ELM_ATSPI_ROLE_TOOL_TIP,
+ ELM_ATSPI_ROLE_TREE,
+ ELM_ATSPI_ROLE_TREE_TABLE,
+ ELM_ATSPI_ROLE_UNKNOWN,
+ ELM_ATSPI_ROLE_VIEWPORT,
+ ELM_ATSPI_ROLE_WINDOW,
+ ELM_ATSPI_ROLE_EXTENDED,
+ ELM_ATSPI_ROLE_HEADER,
+ ELM_ATSPI_ROLE_FOOTER,
+ ELM_ATSPI_ROLE_PARAGRAPH,
+ ELM_ATSPI_ROLE_RULER,
+ ELM_ATSPI_ROLE_APPLICATION,
+ ELM_ATSPI_ROLE_AUTOCOMPLETE,
+ ELM_ATSPI_ROLE_EDITBAR,
+ ELM_ATSPI_ROLE_EMBEDDED,
+ ELM_ATSPI_ROLE_ENTRY,
+ ELM_ATSPI_ROLE_CHART,
+ ELM_ATSPI_ROLE_CAPTION,
+ ELM_ATSPI_ROLE_DOCUMENT_FRAME,
+ ELM_ATSPI_ROLE_HEADING,
+ ELM_ATSPI_ROLE_PAGE,
+ ELM_ATSPI_ROLE_SECTION,
+ ELM_ATSPI_ROLE_REDUNDANT_OBJECT,
+ ELM_ATSPI_ROLE_FORM,
+ ELM_ATSPI_ROLE_LINK,
+ ELM_ATSPI_ROLE_INPUT_METHOD_WINDOW,
+ ELM_ATSPI_ROLE_TABLE_ROW,
+ ELM_ATSPI_ROLE_TREE_ITEM,
+ ELM_ATSPI_ROLE_DOCUMENT_SPREADSHEET,
+ ELM_ATSPI_ROLE_DOCUMENT_PRESENTATION,
+ ELM_ATSPI_ROLE_DOCUMENT_TEXT,
+ ELM_ATSPI_ROLE_DOCUMENT_WEB,
+ ELM_ATSPI_ROLE_DOCUMENT_EMAIL,
+ ELM_ATSPI_ROLE_COMMENT,
+ ELM_ATSPI_ROLE_LIST_BOX,
+ ELM_ATSPI_ROLE_GROUPING,
+ ELM_ATSPI_ROLE_IMAGE_MAP,
+ ELM_ATSPI_ROLE_NOTIFICATION,
+ ELM_ATSPI_ROLE_INFO_BAR
+ }
+
+ [Flags]
+ internal enum Elm_Accessible_Reading_Info_Type
+ {
+ ELM_ACCESSIBLE_READING_INFO_TYPE_NAME = 0x1,
+ ELM_ACCESSIBLE_READING_INFO_TYPE_ROLE = 0x2,
+ ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION = 0x4,
+ ELM_ACCESSIBLE_READING_INFO_TYPE_STATE = 0x8
+ }
+
+ internal delegate void Elm_Atspi_Say_Signal_Cb(IntPtr data, string say_signal);
+ internal delegate string Elm_Atspi_Reading_Info_Cb(IntPtr data, IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool elm_atspi_accessible_relationship_append(IntPtr obj, Elm_Atspi_Relation_Type type, IntPtr relationObj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_atspi_accessible_relationship_remove(IntPtr obj, Elm_Atspi_Relation_Type type, IntPtr relationObj);
+
+ [DllImport(Libraries.Elementary)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool elm_atspi_accessible_relationship_append(IntPtr obj, int type, IntPtr relationObj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_atspi_accessible_relationship_remove(IntPtr obj, int type, IntPtr relationObj);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_atspi_accessible_translation_domain_get")]
+ internal static extern IntPtr _elm_atspi_accessible_translation_domain_get(IntPtr obj);
+
+ internal static string elm_atspi_accessible_translation_domain_get(IntPtr obj)
+ {
+ var str = _elm_atspi_accessible_translation_domain_get(obj);
+ return Marshal.PtrToStringAnsi(str);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_atspi_accessible_translation_domain_set(IntPtr obj, string domain);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_atspi_accessible_name_set(IntPtr obj, string name);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_atspi_accessible_name_get")]
+ internal static extern IntPtr _elm_atspi_accessible_name_get(IntPtr obj);
+
+ internal static string elm_atspi_accessible_name_get(IntPtr obj)
+ {
+ var str = _elm_atspi_accessible_name_get(obj);
+ return Marshal.PtrToStringAnsi(str);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_atspi_accessible_name_cb_set(IntPtr obj, Elm_Atspi_Reading_Info_Cb name_cb, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern Elm_Atspi_Role elm_atspi_accessible_role_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_atspi_accessible_role_set(IntPtr obj, Elm_Atspi_Role role);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_atspi_accessible_description_set(IntPtr obj, string description);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_atspi_accessible_description_get")]
+ internal static extern IntPtr _elm_atspi_accessible_description_get(IntPtr obj);
+ internal static string elm_atspi_accessible_description_get(IntPtr obj)
+ {
+ var str = _elm_atspi_accessible_description_get(obj);
+ return Marshal.PtrToStringAnsi(str);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_atspi_accessible_description_cb_set(IntPtr obj, Elm_Atspi_Reading_Info_Cb description_cb, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_atspi_accessible_reading_info_type_set(IntPtr obj, Elm_Accessible_Reading_Info_Type reading_info);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_atspi_accessible_reading_info_type_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_atspi_accessible_can_highlight_set(IntPtr obj, bool can_highlight);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_atspi_accessible_can_highlight_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_atspi_component_highlight_grab(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_atspi_component_highlight_clear(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_atspi_bridge_utils_say(string text, bool discardable, Elm_Atspi_Say_Signal_Cb func, IntPtr data);
+ }
+}
diff --git a/packaging/elm-sharp.spec b/packaging/elm-sharp.spec
index 0ab7405..f415c9c 100644
--- a/packaging/elm-sharp.spec
+++ b/packaging/elm-sharp.spec
@@ -1,4 +1,4 @@
-%define DEV_VERSION beta-021
+%define DEV_VERSION beta-022
Name: elm-sharp
Summary: C# Binding for Elementary