diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-11-27 11:35:17 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-11-27 11:35:24 +0100 |
commit | 0ee2cddfbd9cc710371048df560e397d6881d69b (patch) | |
tree | d4bee1f9214a3f12c98debb45750f042fa6061f0 /svtools | |
parent | 758abf0130d5bc38507c31c2eb5d414a4a27b53b (diff) |
Properly encapsulate svt::TextWindowPeer
Change-Id: Iffa67c345a03852ad7872031b4c5a87e223ffcad
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/edit/textwindowpeer.cxx | 64 |
1 files changed, 44 insertions, 20 deletions
diff --git a/svtools/source/edit/textwindowpeer.cxx b/svtools/source/edit/textwindowpeer.cxx index 11fa8c9eb38c..6e0a8b7d0aca 100644 --- a/svtools/source/edit/textwindowpeer.cxx +++ b/svtools/source/edit/textwindowpeer.cxx @@ -17,31 +17,55 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> +#include <svtaccessiblefactory.hxx> + +#include <boost/noncopyable.hpp> +#include <com/sun/star/accessibility/XAccessibleContext.hpp> +#include <com/sun/star/awt/XWindowPeer.hpp> +#include <com/sun/star/uno/Reference.hxx> +#include <sal/types.h> #include <svtools/textwindowpeer.hxx> +#include <toolkit/awt/vclxwindow.hxx> +#include <vcl/texteng.hxx> #include <vcl/textview.hxx> -#include "svtaccessiblefactory.hxx" -namespace svt +namespace { + +class TextWindowPeer: public VCLXWindow, private boost::noncopyable { +public: + explicit TextWindowPeer(TextView & view); + + virtual ~TextWindowPeer() {} + +private: + virtual css::uno::Reference<css::accessibility::XAccessibleContext> + CreateAccessibleContext(); + + TextEngine & m_rEngine; + TextView & m_rView; + svt::AccessibleFactoryAccess m_aFactoryAccess; +}; + +TextWindowPeer::TextWindowPeer(TextView & view): + m_rEngine(*view.GetTextEngine()), m_rView(view) +{ + SetWindow(view.GetWindow()); +} + +css::uno::Reference<css::accessibility::XAccessibleContext> +TextWindowPeer::CreateAccessibleContext() { + return m_aFactoryAccess.getFactory().createAccessibleTextWindowContext( + this, m_rEngine, m_rView); +} + +} + +css::uno::Reference<css::awt::XWindowPeer> svt::createTextWindowPeer( + TextView & view) { - TextWindowPeer::TextWindowPeer(::TextView & rView): - m_rEngine(*rView.GetTextEngine()), m_rView(rView) - { - SetWindow(rView.GetWindow()); - m_pFactoryAccess.reset( new AccessibleFactoryAccess ); - } - - // virtual - TextWindowPeer::~TextWindowPeer() - { - } - - css::uno::Reference< css::accessibility::XAccessibleContext > TextWindowPeer::CreateAccessibleContext() - { - return m_pFactoryAccess->getFactory().createAccessibleTextWindowContext( - this, m_rEngine, m_rView - ); - } + return new TextWindowPeer(view); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |