1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
24 #include <osl/module.hxx>
25 #include <sfx2/docfile.hxx>
26 #include <sfx2/viewfrm.hxx>
27 #include <sfx2/progress.hxx>
28 #include <svl/itemset.hxx>
30 #include "../ui/inc/DrawDocShell.hxx"
31 #include "../ui/inc/strings.hrc"
33 #include "sdresid.hxx"
35 #include "drawdoc.hxx"
36 #include "sdfilter.hxx"
40 using namespace ::com::sun::star::uno
;
41 using namespace ::com::sun::star::task
;
42 using namespace ::com::sun::star::frame
;
46 SdFilter::SdFilter( SfxMedium
& rMedium
, ::sd::DrawDocShell
& rDocShell
, bool bShowProgress
)
47 : mxModel( rDocShell
.GetModel() )
49 , mrDocShell( rDocShell
)
50 , mrDocument( *rDocShell
.GetDoc() )
51 , mbIsDraw( rDocShell
.GetDocumentType() == DOCUMENT_TYPE_DRAW
)
52 , mbShowProgress( bShowProgress
)
60 OUString
SdFilter::ImplGetFullLibraryName( const OUString
& rLibraryName
)
62 OUString
aTemp(SVLIBRARY("?"));
63 return aTemp
.replaceFirst( "?", rLibraryName
);
66 #ifndef DISABLE_DYNLOADING
67 extern "C" { static void SAL_CALL
thisModule() {} }
69 ::osl::Module
* SdFilter::OpenLibrary( const OUString
& rLibraryName
)
71 std::unique_ptr
< osl::Module
> mod(new osl::Module
);
72 return mod
->loadRelative(&thisModule
, ImplGetFullLibraryName(rLibraryName
),
73 SAL_LOADMODULE_GLOBAL
| SAL_LOADMODULE_LAZY
)
79 void SdFilter::CreateStatusIndicator()
81 // The status indicator must be retrieved from the provided medium arguments
82 const SfxUnoAnyItem
* pStatusBarItem
= static_cast<const SfxUnoAnyItem
*>(
83 mrMedium
.GetItemSet()->GetItem(SID_PROGRESS_STATUSBAR_CONTROL
) );
86 pStatusBarItem
->GetValue() >>= mxStatusIndicator
;
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */