1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sdfilter.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
33 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
37 #include <tools/debug.hxx>
38 #include <osl/module.hxx>
39 #include <sfx2/docfile.hxx>
40 #include <sfx2/viewfrm.hxx>
41 #include <sfx2/progress.hxx>
42 #include <svtools/itemset.hxx>
44 #include "../ui/inc/DrawDocShell.hxx"
45 #include "../ui/inc/strings.hrc"
47 #include "sdresid.hxx"
49 #include "drawdoc.hxx"
50 #include "sdfilter.hxx"
56 using namespace ::com::sun::star::uno
;
57 using namespace ::com::sun::star::task
;
58 using namespace ::com::sun::star::frame
;
64 SdFilter::SdFilter( SfxMedium
& rMedium
, ::sd::DrawDocShell
& rDocShell
, sal_Bool bShowProgress
)
65 : mxModel( rDocShell
.GetModel() )
67 , mrDocShell( rDocShell
)
68 , mrDocument( *rDocShell
.GetDoc() )
69 , mbIsDraw( rDocShell
.GetDocumentType() == DOCUMENT_TYPE_DRAW
)
70 , mbShowProgress( bShowProgress
)
74 // -----------------------------------------------------------------------------
80 // -----------------------------------------------------------------------------
82 ::rtl::OUString
SdFilter::ImplGetFullLibraryName( const ::rtl::OUString
& rLibraryName
) const
84 String
aTemp( ::rtl::OUString::createFromAscii( SVLIBRARY( "?" ) ) );
85 xub_StrLen nIndex
= aTemp
.Search( (sal_Unicode
)'?' );
86 aTemp
.Replace( nIndex
, 1, rLibraryName
);
87 ::rtl::OUString
aLibraryName( aTemp
);
91 // -----------------------------------------------------------------------------
93 extern "C" { static void SAL_CALL
thisModule() {} }
95 ::osl::Module
* SdFilter::OpenLibrary( const ::rtl::OUString
& rLibraryName
) const
97 std::auto_ptr
< osl::Module
> mod(new osl::Module
);
98 return mod
->loadRelative(&thisModule
, ImplGetFullLibraryName(rLibraryName
))
102 // -----------------------------------------------------------------------------
104 void SdFilter::CreateStatusIndicator()
106 // The status indicator must be retrieved from the provided medium arguments
107 const SfxUnoAnyItem
* pStatusBarItem
= static_cast<const SfxUnoAnyItem
*>(
108 mrMedium
.GetItemSet()->GetItem(SID_PROGRESS_STATUSBAR_CONTROL
) );
110 if ( pStatusBarItem
)
111 pStatusBarItem
->GetValue() >>= mxStatusIndicator
;
117 // Reference< XController > xController( mxModel->getCurrentController());
118 // if( xController.is())
120 // Reference< XFrame > xFrame( xController->getFrame());
123 // Reference< XStatusIndicatorFactory > xFactory( xFrame, UNO_QUERY );
124 // if( xFactory.is())
126 // mxStatusIndicator = xFactory->createStatusIndicator();
132 // catch( Exception& )