Esempio n. 1
0
        /// <summary>
        /// Creates a new Quickpanel Client handle.
        /// </summary>
        /// <param name="tzShell">The TizenShell instance.</param>
        /// <param name="win">The window to provide service of the quickpanel.</param>
        /// <param name="type">The type of quickpanel service.</param>
        /// <exception cref="Tizen.Applications.Exceptions.OutOfMemoryException">Thrown when the memory is not enough to allocate.</exception>
        /// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>
        /// <exception cref="ArgumentNullException">Thrown when a argument is null.</exception>
        /// <since_tizen> 8 </since_tizen>
        public QuickPanelClient(TizenShell tzShell, Window win, Types type)
        {
            int width = 0, height = 0;

            if (tzShell == null)
            {
                throw new ArgumentNullException((string)"tzShell");
            }
            if (tzShell.GetNativeHandle() == IntPtr.Zero)
            {
                throw new ArgumentException("tzShell is not initialized.");
            }
            if (win == null)
            {
                throw new ArgumentNullException((string)"win");
            }

            _tzsh         = tzShell;
            _tzshWin      = win.GetNativeId();
            _tzshQpClient = Interop.QuickPanelClient.CreateWithType(_tzsh.GetNativeHandle(), (IntPtr)_tzshWin, (int)type);
            if (_tzshQpClient == IntPtr.Zero)
            {
                int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult();
                _tzsh.ErrorCodeThrow(err);
            }

            Information.TryGetValue("http://tizen.org/feature/screen.width", out width);
            Information.TryGetValue("http://tizen.org/feature/screen.height", out height);
            if (width > height)
            {
                _screenOrientation = Window.WindowOrientation.Landscape;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new Tizen region object.
        /// </summary>
        /// <param name="tzShell">The TzShell instance.</param>
        /// <exception cref="Tizen.Applications.Exceptions.OutOfMemoryException">Thrown when the memory is not enough to allocate.</exception>
        /// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>
        /// <exception cref="ArgumentNullException">Thrown when a argument is null.</exception>
        public TizenRegion(TizenShell tzShell)
        {
            if (tzShell == null)
            {
                throw new ArgumentNullException(nameof(tzShell));
            }
            if (tzShell.GetNativeHandle() == IntPtr.Zero)
            {
                throw new ArgumentException("tzShell is not initialized.");
            }

            _tzsh   = tzShell;
            _region = Interop.TizenRegion.Create(_tzsh.GetNativeHandle());
            if (_region == IntPtr.Zero)
            {
                int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult();
                _tzsh.ErrorCodeThrow(err);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Creates a new Softkey Client handle.
        /// </summary>
        /// <param name="tzShell">The TizenShell instance.</param>
        /// <param name="win">The window to provide service of the quickpanel.</param>
        /// <privilege>http://tizen.org/privilege/windowsystem.admin</privilege>
        /// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>
        /// <exception cref="ArgumentNullException">Thrown when a argument is null.</exception>
        /// <exception cref="InvalidOperationException">Thrown when failed because of an invalid operation or no service.</exception>
        /// <exception cref="UnauthorizedAccessException">Thrown when the caller does not have privilege to use this method.</exception>
        /// <exception cref="NotSupportedException">Thrown when the feature is not supported.</exception>
        public SoftkeyClient(TizenShell tzShell, Window win)
        {
            if (tzShell == null)
            {
                throw new ArgumentNullException(nameof(tzShell));
            }
            if (tzShell.GetNativeHandle() == IntPtr.Zero)
            {
                throw new ArgumentException("tzShell is not initialized.");
            }
            if (win == null)
            {
                throw new ArgumentNullException(nameof(win));
            }

            _tzsh          = tzShell;
            _tzshWin       = win.GetNativeId();
            _softkeyClient = Interop.SoftkeyClient.Create(_tzsh.GetNativeHandle(), (IntPtr)_tzshWin);
            if (_softkeyClient == IntPtr.Zero)
            {
                int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult();
                _tzsh.ErrorCodeThrow(err);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Creates a new Quickpanel Service handle.
        /// </summary>
        /// <param name="tzShell">The TzShell instance.</param>
        /// <param name="win">The window to provide service of the quickpanel.</param>
        /// <param name="type">The type of quickpanel service.</param>
        /// <exception cref="Tizen.Applications.Exceptions.OutOfMemoryException">Thrown when the memory is not enough to allocate.</exception>
        /// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>
        /// <exception cref="ArgumentNullException">Thrown when a argument is null.</exception>
        public QuickPanelService(TizenShell tzShell, Window win, Types type)
        {
            if (tzShell == null)
            {
                throw new ArgumentNullException(nameof(tzShell));
            }
            if (tzShell.GetNativeHandle() == IntPtr.Zero)
            {
                throw new ArgumentException("tzShell is not initialized.");
            }
            if (win == null)
            {
                throw new ArgumentNullException(nameof(win));
            }

            _tzsh          = tzShell;
            _tzshWin       = win.GetNativeId();
            _tzshQpService = Interop.QuickPanelService.CreateWithType(_tzsh.GetNativeHandle(), (IntPtr)_tzshWin, (int)type);
            if (_tzshQpService == IntPtr.Zero)
            {
                int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult();
                _tzsh.ErrorCodeThrow(err);
            }
        }