LibreOffice Module sw (master)  1
accpreview.cxx
Go to the documentation of this file.
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>
23 #include <strings.hrc>
24 #include "accpreview.hxx"
25 
26 const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleDocumentPageView";
27 
28 using ::com::sun::star::uno::RuntimeException;
29 using ::com::sun::star::uno::Sequence;
30 
31 SwAccessiblePreview::SwAccessiblePreview(std::shared_ptr<SwAccessibleMap> const& pMap)
33 {
34  SetName( GetResource( STR_ACCESS_PREVIEW_DOC_NAME ) );
35 }
36 
38 {
39 }
40 
42 {
43  return OUString( sImplementationName );
44 }
45 
46 sal_Bool SwAccessiblePreview::supportsService( const OUString& rServiceName )
47 {
48  return cppu::supportsService(this, rServiceName);
49 }
50 
52 {
53  return {"com.sun.star.text.AccessibleTextDocumentPageView",
55 }
56 
58 {
59  return css::uno::Sequence<sal_Int8>();
60 }
61 
63 {
64  return GetResource( STR_ACCESS_PREVIEW_DOC_NAME );
65 }
66 
68 {
69  return SwAccessibleDocumentBase::getAccessibleName() + " " + GetResource( STR_ACCESS_PREVIEW_DOC_SUFFIX );
70 }
71 
73 {
74  FireStateChangedEvent( css::accessibility::AccessibleStateType::FOCUSED, true );
75 }
76 
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const sal_Char sImplementationName[]
Definition: accpreview.cxx:26
virtual OUString SAL_CALL getImplementationName() override
Returns an identifier for the implementation of this object.
Definition: accpreview.cxx:41
static OUString GetResource(const char *pResId, const OUString *pArg1=nullptr, const OUString *pArg2=nullptr)
virtual void InvalidateFocus_() override
Definition: accpreview.cxx:72
const sal_Char sAccessibleServiceName[]
Definition: acccontext.hxx:43
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
Return whether the specified service is supported by this class.
Definition: accpreview.cxx:46
char sal_Char
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual ~SwAccessiblePreview() override
Definition: accpreview.cxx:37
void FireStateChangedEvent(sal_Int16 nState, bool bNewState)
Definition: acccontext.cxx:467
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: accpreview.cxx:57
unsigned char sal_Bool
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
Definition: accpreview.cxx:51
SwAccessiblePreview(std::shared_ptr< SwAccessibleMap > const &pMap)
Definition: accpreview.cxx:31
OUString SAL_CALL getAccessibleDescription() override
Definition: accpreview.cxx:62
virtual OUString SAL_CALL getAccessibleName() override
Definition: accdoc.cxx:200
OUString SAL_CALL getAccessibleName() override
Definition: accpreview.cxx:67
void SetName(const OUString &rName)
Definition: acccontext.hxx:99