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