/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you 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 . */ #ifndef INCLUDED_STARMATH_SOURCE_ACCESSIBILITY_HXX #define INCLUDED_STARMATH_SOURCE_ACCESSIBILITY_HXX #include #include #include #include #include #include #include #include #include #include #include #include #include #include class SmDocShell; namespace accessibility { class AccessibleTextHelper; } // classes and helper-classes used for accessibility in the graphic-window typedef cppu::WeakImplHelper < css::lang::XServiceInfo, css::accessibility::XAccessible, css::accessibility::XAccessibleComponent, css::accessibility::XAccessibleContext, css::accessibility::XAccessibleText, css::accessibility::XAccessibleEventBroadcaster > SmGraphicAccessibleBaseClass; class SmGraphicAccessible final : public SmGraphicAccessibleBaseClass { OUString aAccName; /// client id in the AccessibleEventNotifier queue sal_uInt32 nClientId; VclPtr pWin; SmGraphicAccessible( const SmGraphicAccessible & ) = delete; SmGraphicAccessible & operator = ( const SmGraphicAccessible & ) = delete; SmDocShell * GetDoc_Impl(); OUString GetAccessibleText_Impl(); public: explicit SmGraphicAccessible( SmGraphicWindow *pGraphicWin ); virtual ~SmGraphicAccessible() override; void ClearWin(); // to be called when view is destroyed void LaunchEvent( const sal_Int16 nAccessibleEventId, const css::uno::Any &rOldVal, const css::uno::Any &rNewVal); // XAccessible virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override; // XAccessibleComponent virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; virtual css::awt::Rectangle SAL_CALL getBounds( ) override; virtual css::awt::Point SAL_CALL getLocation( ) override; virtual css::awt::Point SAL_CALL getLocationOnScreen( ) override; virtual css::awt::Size SAL_CALL getSize( ) override; virtual void SAL_CALL grabFocus( ) override; virtual sal_Int32 SAL_CALL getForeground( ) override; virtual sal_Int32 SAL_CALL getBackground( ) override; // XAccessibleContext virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; virtual OUString SAL_CALL getAccessibleName( ) override; virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override; virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) override; virtual css::lang::Locale SAL_CALL getLocale( ) override; // XAccessibleEventBroadcaster virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; virtual void SAL_CALL removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; // XAccessibleText virtual sal_Int32 SAL_CALL getCaretPosition( ) override; virtual sal_Bool SAL_CALL setCaretPosition ( sal_Int32 nIndex ) override; virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) override; virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) override; virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) override; virtual sal_Int32 SAL_CALL getCharacterCount( ) override; virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override; virtual OUString SAL_CALL getSelectedText( ) override; virtual sal_Int32 SAL_CALL getSelectionStart( ) override; virtual sal_Int32 SAL_CALL getSelectionEnd( ) override; virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; virtual OUString SAL_CALL getText( ) override; virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; }; // classes and helper-classes used for accessibility in the command-window class SmEditAccessible; class SmEditSource; class EditView; class SvxFieldItem; class SmViewForwarder : public SvxViewForwarder { SmEditAccessible & rEditAcc; SmViewForwarder( const SmViewForwarder & ) = delete; SmViewForwarder & operator = ( const SmViewForwarder & ) = delete; public: explicit SmViewForwarder( SmEditAccessible &rAcc ); virtual ~SmViewForwarder() override; virtual bool IsValid() const override; virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override; virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override; }; class SmTextForwarder : /* analog to SvxEditEngineForwarder */ public SvxTextForwarder { SmEditAccessible & rEditAcc; SmEditSource & rEditSource; DECL_LINK( NotifyHdl, EENotify&, void ); SmTextForwarder( const SmTextForwarder & ) = delete; SmTextForwarder & operator = ( const SmTextForwarder & ) = delete; public: SmTextForwarder( SmEditAccessible& rAcc, SmEditSource & rSource ); virtual ~SmTextForwarder() override; virtual sal_Int32 GetParagraphCount() const override; virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const override; virtual OUString GetText( const ESelection& rSel ) const override; virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All ) const override; virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const override; virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) override; virtual void RemoveAttribs( const ESelection& rSelection ) override; virtual void GetPortions( sal_Int32 nPara, std::vector& rList ) const override; virtual SfxItemState GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const override; virtual SfxItemState GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const override; virtual void QuickInsertText( const OUString& rText, const ESelection& rSel ) override; virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) override; virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ) override; virtual void QuickInsertLineBreak( const ESelection& rSel ) override; virtual SfxItemPool* GetPool() const override; virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, std::optional& rpTxtColor, std::optional& rpFldColor ) override; virtual void FieldClicked(const SvxFieldItem&) override; virtual bool IsValid() const override; virtual LanguageType GetLanguage( sal_Int32, sal_Int32 ) const override; virtual sal_Int32 GetFieldCount( sal_Int32 nPara ) const override; virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const override; virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const override; virtual tools::Rectangle GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const override; virtual tools::Rectangle GetParaBounds( sal_Int32 nPara ) const override; virtual MapMode GetMapMode() const override; virtual OutputDevice* GetRefDevice() const override; virtual bool GetIndexAtPoint( const Point&, sal_Int32& nPara, sal_Int32& nIndex ) const override; virtual bool GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const override; virtual bool GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell = false ) const override; virtual sal_Int32 GetLineCount( sal_Int32 nPara ) const override; virtual sal_Int32 GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const override; virtual void GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const override; virtual sal_Int32 GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nLine ) const override; virtual bool Delete( const ESelection& ) override; virtual bool InsertText( const OUString&, const ESelection& ) override; virtual bool QuickFormatDoc( bool bFull = false ) override; virtual sal_Int16 GetDepth( sal_Int32 nPara ) const override; virtual bool SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth ) override; virtual const SfxItemSet* GetEmptyItemSetPtr() override; // implementation functions for XParagraphAppend and XTextPortionAppend virtual void AppendParagraph() override; virtual sal_Int32 AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet ) override; virtual void CopyText(const SvxTextForwarder& rSource) override; }; class SmEditViewForwarder : /* analog to SvxEditEngineViewForwarder */ public SvxEditViewForwarder { SmEditAccessible& rEditAcc; SmEditViewForwarder( const SmEditViewForwarder & ) = delete; SmEditViewForwarder & operator = ( const SmEditViewForwarder & ) = delete; public: explicit SmEditViewForwarder( SmEditAccessible& rAcc ); virtual ~SmEditViewForwarder() override; virtual bool IsValid() const override; virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override; virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override; virtual bool GetSelection( ESelection& rSelection ) const override; virtual bool SetSelection( const ESelection& rSelection ) override; virtual bool Copy() override; virtual bool Cut() override; virtual bool Paste() override; }; class SmEditSource : public SvxEditSource { SfxBroadcaster aBroadCaster; SmViewForwarder aViewFwd; SmTextForwarder aTextFwd; SmEditViewForwarder aEditViewFwd; SmEditAccessible& rEditAcc; SmEditSource( const SmEditSource &rSrc ); SmEditSource & operator = ( const SmEditSource & ) = delete; public: SmEditSource( SmEditAccessible &rAcc ); virtual ~SmEditSource() override; virtual std::unique_ptr Clone() const override; virtual SvxTextForwarder* GetTextForwarder() override; virtual SvxViewForwarder* GetViewForwarder() override; virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate = false ) override; virtual void UpdateData() override; virtual SfxBroadcaster& GetBroadcaster() const override; }; typedef cppu::WeakImplHelper < css::lang::XServiceInfo, css::accessibility::XAccessible, css::accessibility::XAccessibleComponent, css::accessibility::XAccessibleContext, css::accessibility::XAccessibleEventBroadcaster > SmEditAccessibleBaseClass; class SmEditAccessible : public SmEditAccessibleBaseClass { OUString aAccName; std::unique_ptr<::accessibility::AccessibleTextHelper> pTextHelper; VclPtr pWin; SmEditAccessible( const SmEditAccessible & ) = delete; SmEditAccessible & operator = ( const SmEditAccessible & ) = delete; public: explicit SmEditAccessible( SmEditWindow *pEditWin ); virtual ~SmEditAccessible() override; ::accessibility::AccessibleTextHelper * GetTextHelper(); void Init(); void ClearWin(); // to be called when view is destroyed //! access EditEngine and EditView via the functions in the respective window //! pointers may be 0 (e.g. during reload) EditEngine * GetEditEngine() { return pWin ? pWin->GetEditEngine() : nullptr; } EditView * GetEditView() { return pWin ? pWin->GetEditView() : nullptr; } // XAccessible virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override; // XAccessibleComponent virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; virtual css::awt::Rectangle SAL_CALL getBounds( ) override; virtual css::awt::Point SAL_CALL getLocation( ) override; virtual css::awt::Point SAL_CALL getLocationOnScreen( ) override; virtual css::awt::Size SAL_CALL getSize( ) override; virtual void SAL_CALL grabFocus( ) override; virtual sal_Int32 SAL_CALL getForeground( ) override; virtual sal_Int32 SAL_CALL getBackground( ) override; // XAccessibleContext virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; virtual OUString SAL_CALL getAccessibleName( ) override; virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override; virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) override; virtual css::lang::Locale SAL_CALL getLocale( ) override; // XAccessibleEventBroadcaster virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; virtual void SAL_CALL removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -db-range'>feature/gsoc-calc-enhanced-db-range LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-08-12Updated coreChristian Lohmaier
Project: translations 060c2dd2f850e919e2f0087e49a25a28bb4cf6f9 update translations and force-fix errors using pocheck (based on 5-0 templates) Change-Id: Ia5f050e72d6aa24ae5ec73898e7c05ca2d4103cb
2015-07-08Updated coreEike Rathke
Project: translations 5fbe7f221f27df62d1156763f03baa90322c366b interim typo fix NETTORABEITSTAGE -> NETTOARBEITSTAGE Misspelled spreadsheet function names are most ugly.. Change-Id: I73a1f611e66a1484d2a728d3339eff5a6cd852ac
2015-05-19Updated coreChristian Lohmaier
Project: translations f7efc4ecf69cba536cd0391d4673e31226b1fe86 update translations for 5.0.0 beta1 and force-fix errors using pocheck Change-Id: I295e6d2e6b47a06165cdf8900e2775b7157af809
2015-05-18Updated coreAndras Timar
Project: translations 625f07e0dc9a40453c54c4dc8ebfbc6062f54f86 Updated Slovenian translation Change-Id: I33160966ee0c7cf6fd0b62c4633766299b4ec906
2015-05-14Updated coreAndras Timar
Project: translations abb27fb966ac2c3f9c8cf3549c2975f399174eb0 Updated Slovenian translation Change-Id: Id86bda321f4318a193b99ef174848ed8b7425550
2015-04-24Updated coreAndras Timar
Project: translations 7ab806a3d2c000acdf58c5b23f7dfa14ad12ef66 Updated Slovenian translation Change-Id: I3032abdb0871bf785816591e3f8318501e79edaa
2015-04-19Updated coreChristian Lohmaier
Project: translations 9741c39649c0c54cd79b9949d28eca364c087b61 update translations for 5.0.0 Alpha1 and force-fix errors using pocheck Change-Id: I68916e7c0a7af9c3caeba4e86c19e1e9e71d9465
2015-04-16Updated coreAndras Timar
Project: translations 8514f4f02022d70c8221eb2f2b47a7f18de1475e Updated Slovenian translation Change-Id: I7cd4ad4cbab7189893ef2d4321443362af7dea21
2015-03-19Updated coreAndras Timar
Project: translations 6a11450be8a19648f3f76d7b9a098a9ef7c4d76e
2015-01-29Updated coreCaolán McNamara
Project: translations add7a7e0967a3fc04666ba061d81d1ba9b326554
2015-01-25Updated coreAndras Timar
Project: translations b88d2877688f4d01d3f054a4fd0246b2159136c3
2015-01-25Updated coreAndras Timar
Project: translations 8c4fea354d3d98a6cb8da4f9ddb87e072bdc21e6
2014-11-22Updated coreAndras Timar
Project: translations 78a223e7931ed04859cfe0c8bd834c4956e50e0b
2014-11-22Updated coreAndras Timar
Project: translations a1da2c880cef1ad5289ed78dc345e8c3ef94fb28
2014-11-20Updated coreChristian Lohmaier
Project: translations 587e99affea726021dc41da2cc5a21a4b961249b
2014-11-18Updated coreAndras Timar
Project: translations 6453172eac4a30a37224db66ddd76c13f614959d
2014-11-17Updated coreAndras Timar
Project: translations 154fe50e9789ad67a6eadaa5d4290372720afe2f
2014-11-06Updated coreChristian Lohmaier
Project: translations 7a93a556c365806ff1306e70f970feaf1bd7581f
2014-10-29Updated coreAndras Timar
Project: translations 6464f1a0e1abc7b0db94aa161885aa08f3a06fe5
2014-10-19Updated coreChristian Lohmaier
Project: translations 4e45711904895e392a4b95433f3996e9c6625871
2014-10-17Updated coreChristian Lohmaier
Project: translations 781673fea7346b0d148bf85984826c0556fdf1b9
2014-08-28Updated coreLionel Elie Mamane
Project: translations d9ae641365f094cc1898d7f614dc8a72a1c6b914
2014-08-28Updated coreLionel Elie Mamane
Project: translations 1a15415c3fe875ee4193fbdbcbd0ebde3b13b482
2014-07-16Updated coreAndras Timar
Project: translations 1b5734b51f56352171d54cf8ac0a05015b23983f
2014-05-26Avoid possible memory leaks in case of exceptionsTakeshi Abe
Change-Id: I185e957da57f4da7dbd2b95496bcd5349fc7d039
2014-05-22Updated coreAndras Timar
Project: translations b31a57455b1bf9dcffd2cee0a4c79c4f6425dd6c
2014-05-21Updated coreChristian Lohmaier
Project: translations b1ee9c9e1542b856cfe2412c6dffeeb5a353810a
2014-05-18Updated coreAndras Timar
Project: translations eb6ea5dcf7183a496e02d21024fc05b141c5c65e
2014-04-20Updated coreChristian Lohmaier
Project: translations e3821ba029d6e69b786157d13984ca5af908bb31
2014-02-18Revert "experimentally enable using depcache for full build speedup"Miklos Vajna
This reverts commit 46fa7ac866ee392ed72cfc670f062a8c318d2d92, just the submodule part.
2014-02-18experimentally enable using depcache for full build speedupBjoern Michaelsen
Change-Id: I6c186ba7ca27166a272327bcfe6a94c391c3514f