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 :
33 : // SwAccessiblePreview
34 :
35 0 : SwAccessiblePreview::SwAccessiblePreview( SwAccessibleMap *pMp ) :
36 0 : SwAccessibleDocumentBase( pMp )
37 : {
38 0 : SetName( GetResource( STR_ACCESS_DOC_NAME ) );
39 0 : }
40 :
41 0 : SwAccessiblePreview::~SwAccessiblePreview()
42 : {
43 0 : }
44 :
45 0 : OUString SwAccessiblePreview::getImplementationName( )
46 : throw( RuntimeException )
47 : {
48 0 : return OUString( sImplementationName );
49 : }
50 :
51 0 : sal_Bool SwAccessiblePreview::supportsService( const OUString& rServiceName )
52 : throw( RuntimeException )
53 : {
54 0 : return rServiceName == sServiceName || rServiceName == sAccessibleServiceName;
55 : }
56 :
57 0 : Sequence<OUString> SwAccessiblePreview::getSupportedServiceNames( )
58 : throw( RuntimeException )
59 : {
60 0 : Sequence<OUString> aSeq( 2 );
61 0 : aSeq[0] = OUString( sServiceName );
62 0 : aSeq[1] = OUString( sAccessibleServiceName );
63 0 : return aSeq;
64 : }
65 :
66 : namespace
67 : {
68 : class theSwAccessiblePreviewImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessiblePreviewImplementationId > {};
69 : }
70 :
71 0 : Sequence< sal_Int8 > SAL_CALL SwAccessiblePreview::getImplementationId()
72 : throw(RuntimeException)
73 : {
74 0 : return theSwAccessiblePreviewImplementationId::get().getSeq();
75 99 : }
76 :
77 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|