2 * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 namespace Tizen.Applications.NotificationEventListener
21 internal static class NotificationReplyActionArgBinder
23 private const string LogTag = "Tizen.Applications.NotificationEventListener";
25 internal static void BindObject(NotificationEventArgs eventargs)
29 bool isExisted = false;
30 SafeAppControlHandle appcontrol = null;
32 NotificationEventArgs.ReplyActionArgs reply = new NotificationEventArgs.ReplyActionArgs();
33 NotificationEventArgs.ButtonActionArgs button = new NotificationEventArgs.ButtonActionArgs();
34 string replyKey = "__PARENT_INDEX__";
36 Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.TextInputButton, out text);
37 if (string.IsNullOrEmpty(text) == false)
40 button.ImagePath = text;
43 Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.InputButton, out text);
44 if (string.IsNullOrEmpty(text) == false)
50 Interop.NotificationEventListener.GetEventHandler(eventargs.Handle, (int)ClickEventType.InputButton, out appcontrol);
52 if (appcontrol != null && appcontrol.IsInvalid == false)
54 button.Action = new AppControl(appcontrol);
58 reply.Button = button;
60 Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.PlaceHolder, out text);
62 if (string.IsNullOrEmpty(text) == false)
65 reply.PlaceHolderText = text;
68 Interop.NotificationEventListener.GetPlaceHolderLength(eventargs.Handle, out max);
75 if (eventargs.Extender.TryGetValue(replyKey, out bundle))
77 if (bundle.Contains(replyKey))
80 if (bundle.TryGetItem(replyKey, out parentIndex))
84 reply.ParentIndex = (ButtonIndex)int.Parse(parentIndex);
89 Log.Error(LogTag, "unable to get ParentIndex " + ex.Message);
97 (eventargs.Style["Active"] as NotificationEventArgs.ActiveStyleArgs).Reply = reply;