コード例 #1
0
ファイル: QuickPanelClient.cs プロジェクト: xerrni/TizenFX
        /// <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;
            }
        }
コード例 #2
0
ファイル: TizenRegion.cs プロジェクト: yunmiha/TizenFX
        /// <inheritdoc/>
        protected virtual void Dispose(DisposeTypes type)
        {
            int res;

            if (!disposed)
            {
                if (_region != IntPtr.Zero)
                {
                    res = Interop.TizenRegion.Destroy(_region);
                    try
                    {
                        _tzsh.ErrorCodeThrow(res);
                    }
                    catch (ArgumentException)
                    {
                        throw new MemberAccessException("TizenRegion is a corrupted");
                    }
                    _region = IntPtr.Zero;
                }
                disposed = true;
            }
        }
コード例 #3
0
ファイル: QuickPanelClient.cs プロジェクト: xerrni/TizenFX
        /// <inheritdoc/>
        protected virtual void Dispose(DisposeTypes type)
        {
            int res;

            if (!disposed)
            {
                if (_tzshQpClient != IntPtr.Zero)
                {
                    res = Interop.QuickPanelClient.Destroy(_tzshQpClient);
                    try
                    {
                        _tzsh.ErrorCodeThrow(res);
                    }
                    catch (ArgumentException e)
                    {
                        throw new MemberAccessException("QuickPanelClient is a corrupted");
                    }
                    _tzshQpClient = IntPtr.Zero;
                }
                disposed = true;
            }
        }
コード例 #4
0
ファイル: TizenRegion.cs プロジェクト: yunmiha/TizenFX
        /// <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);
            }
        }
コード例 #5
0
        /// <inheritdoc/>
        protected virtual void Dispose(DisposeTypes disposing)
        {
            int res;

            if (!disposed)
            {
                if (_tzshQpService != IntPtr.Zero)
                {
                    res = Interop.QuickPanelService.Destroy(_tzshQpService);
                    try
                    {
                        _tzsh.ErrorCodeThrow(res);
                    }
                    catch (ArgumentException)
                    {
                        throw new MemberAccessException("QuickPanelService is a corrupted");
                    }
                    _tzshQpService = IntPtr.Zero;
                }
                disposed = true;
            }
        }
コード例 #6
0
ファイル: SoftkeyClient.cs プロジェクト: yunmiha/TizenFX
        /// <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);
            }
        }
コード例 #7
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);
            }
        }
コード例 #8
0
ファイル: SoftkeyClient.cs プロジェクト: yunmiha/TizenFX
        /// <summary>
        /// Requests to show the softkey service window.
        /// </summary>
        /// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>
        /// <exception cref="NotSupportedException">Thrown when the feature is not supported.</exception>
        /// <exception cref="InvalidOperationException">Thrown when failed because of an invalid operation or no service.</exception>
        public void Show()
        {
            int res = Interop.SoftkeyClient.Show(_softkeyClient);

            _tzsh.ErrorCodeThrow(res);
        }
コード例 #9
0
ファイル: SoftkeyService.cs プロジェクト: yunmiha/TizenFX
        /// <summary>
        /// Requests to show the softkey service window.
        /// </summary>
        /// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>
        public void Show()
        {
            int res = Interop.SoftkeyService.Show(_softkeyService);

            _tzsh.ErrorCodeThrow(res);
        }