3 namespace Tizen.Applications.AttachPanel
5 public partial class AttachPanel
7 private const string LogTag = "Tizen.Applications.AttachPanel";
9 private static IntPtr _attachPanel;
11 private static event EventHandler<StateEventArgs> _eventEventHandler;
12 private static event EventHandler<ResultEventArgs> _resultEventHandler;
14 private static Interop.AttachPanel.AttachPanelEventCallback SetEventListener;
15 private static Interop.AttachPanel.AttachPanelResultCallback SetResultListener;
17 public AttachPanel(IntPtr conformant)
19 _attachPanel = new IntPtr();
20 Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.CreateAttachPanel(conformant, ref _attachPanel);
23 if (_eventEventHandler == null)
25 StateEventListenStart();
28 if (_resultEventHandler == null)
30 ResultEventListenStart();
36 if (_attachPanel != IntPtr.Zero)
38 Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.DestroyAttachPanel(_attachPanel);
40 _attachPanel = IntPtr.Zero;
49 Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.GetState(_attachPanel, out state);
59 Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.GetVisibility(_attachPanel, out visible);
65 public void AddCategory(ContentCategory category, Bundle extraData)
67 IntPtr bundle = IntPtr.Zero;
68 if (extraData != null)
70 bundle = extraData.SafeBundleHandle.DangerousGetHandle();
72 Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.AddCategory(_attachPanel, (int)category, bundle);
76 public void RemoveCategory(ContentCategory category)
78 Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.RemoveCategory(_attachPanel, (int)category);
82 public void SetExtraData(ContentCategory category, Bundle extraData)
84 IntPtr bundle = IntPtr.Zero;
85 if (extraData != null)
87 bundle = extraData.SafeBundleHandle.DangerousGetHandle();
89 Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.SetExtraData(_attachPanel, (int)category, bundle);
95 Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Show(_attachPanel);
99 public void Show(bool animation)
103 Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Show(_attachPanel);
108 Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.ShowWithoutAnimation(_attachPanel);
115 Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Hide(_attachPanel);
119 public void Hide(bool animation)
123 Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Hide(_attachPanel);
128 Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.HideWithoutAnimation(_attachPanel);
133 public event EventHandler<StateEventArgs> EventChanged
137 if (_eventEventHandler == null)
139 StateEventListenStart();
141 _eventEventHandler += value;
145 _eventEventHandler -= value;
146 if (_eventEventHandler == null)
148 StateEventListenStop();
153 public event EventHandler<ResultEventArgs> ResultCallback
157 if (_resultEventHandler == null)
159 ResultEventListenStart();
161 _resultEventHandler += value;
165 _resultEventHandler -= value;
166 if (_resultEventHandler == null)
168 ResultEventListenStop();