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 :
21 : #include <vcl/svapp.hxx>
22 : #include <comphelper/servicehelper.hxx>
23 : #include "access.hrc"
24 : #include <accpreview.hxx>
25 :
26 : const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextDocumentPageView";
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 : using ::rtl::OUString;
33 :
34 : //
35 : // SwAccessiblePreview
36 : //
37 :
38 0 : SwAccessiblePreview::SwAccessiblePreview( SwAccessibleMap *pMp ) :
39 0 : SwAccessibleDocumentBase( pMp )
40 : {
41 0 : SetName( GetResource( STR_ACCESS_DOC_NAME ) );
42 0 : }
43 :
44 0 : SwAccessiblePreview::~SwAccessiblePreview()
45 : {
46 0 : }
47 :
48 0 : OUString SwAccessiblePreview::getImplementationName( )
49 : throw( RuntimeException )
50 : {
51 0 : return OUString( RTL_CONSTASCII_USTRINGPARAM( sImplementationName ) );
52 : }
53 :
54 0 : sal_Bool SwAccessiblePreview::supportsService( const OUString& rServiceName )
55 : throw( RuntimeException )
56 : {
57 0 : return rServiceName == sServiceName || rServiceName == sAccessibleServiceName;
58 : }
59 :
60 0 : Sequence<OUString> SwAccessiblePreview::getSupportedServiceNames( )
61 : throw( RuntimeException )
62 : {
63 0 : Sequence<OUString> aSeq( 2 );
64 0 : aSeq[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( sServiceName ) );
65 0 : aSeq[1] = OUString( RTL_CONSTASCII_USTRINGPARAM( sAccessibleServiceName ) );
66 0 : return aSeq;
67 : }
68 :
69 : namespace
70 : {
71 : class theSwAccessiblePreviewImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessiblePreviewImplementationId > {};
72 : }
73 :
74 0 : Sequence< sal_Int8 > SAL_CALL SwAccessiblePreview::getImplementationId()
75 : throw(RuntimeException)
76 : {
77 0 : return theSwAccessiblePreviewImplementationId::get().getSeq();
78 : }
79 :
80 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|