Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <vcl/svapp.hxx>
21 : #include <com/sun/star/accessibility/AccessibleStateType.hpp>
22 : #include <comphelper/servicehelper.hxx>
23 : #include <cppuhelper/supportsservice.hxx>
24 : #include "access.hrc"
25 : #include <accpreview.hxx>
26 :
27 : const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleDocumentPageView";
28 :
29 : using ::com::sun::star::lang::IndexOutOfBoundsException;
30 : using ::com::sun::star::uno::RuntimeException;
31 : using ::com::sun::star::uno::Sequence;
32 :
33 0 : SwAccessiblePreview::SwAccessiblePreview( SwAccessibleMap *pMp ) :
34 0 : SwAccessibleDocumentBase( pMp )
35 : {
36 0 : SetName( GetResource( STR_ACCESS_PREVIEW_DOC_NAME ) );
37 0 : }
38 :
39 0 : SwAccessiblePreview::~SwAccessiblePreview()
40 : {
41 0 : }
42 :
43 0 : OUString SwAccessiblePreview::getImplementationName( )
44 : throw( RuntimeException, std::exception )
45 : {
46 0 : return OUString( sImplementationName );
47 : }
48 :
49 0 : sal_Bool SwAccessiblePreview::supportsService( const OUString& rServiceName )
50 : throw( RuntimeException, std::exception )
51 : {
52 0 : return cppu::supportsService(this, rServiceName);
53 : }
54 :
55 0 : Sequence<OUString> SwAccessiblePreview::getSupportedServiceNames( )
56 : throw( RuntimeException, std::exception )
57 : {
58 0 : Sequence<OUString> aSeq( 2 );
59 0 : aSeq[0] = "com.sun.star.text.AccessibleTextDocumentPageView";
60 0 : aSeq[1] = OUString( sAccessibleServiceName );
61 0 : return aSeq;
62 : }
63 :
64 0 : Sequence< sal_Int8 > SAL_CALL SwAccessiblePreview::getImplementationId()
65 : throw(RuntimeException, std::exception)
66 : {
67 0 : return css::uno::Sequence<sal_Int8>();
68 : }
69 :
70 0 : OUString SAL_CALL SwAccessiblePreview::getAccessibleDescription (void) throw (com::sun::star::uno::RuntimeException, std::exception)
71 : {
72 0 : return GetResource( STR_ACCESS_PREVIEW_DOC_NAME );
73 : }
74 :
75 0 : OUString SAL_CALL SwAccessiblePreview::getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException, std::exception)
76 : {
77 0 : OUString sLclName = SwAccessibleDocumentBase::getAccessibleName();
78 0 : sLclName += " ";
79 0 : sLclName += GetResource( STR_ACCESS_PREVIEW_DOC_SUFFIX );
80 0 : return sLclName;
81 : }
82 :
83 0 : void SwAccessiblePreview::_InvalidateFocus()
84 : {
85 0 : FireStateChangedEvent( ::com::sun::star::accessibility::AccessibleStateType::FOCUSED, true );
86 270 : }
87 :
88 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|