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 .
19 #ifndef INCLUDED_FPICKER_SOURCE_OFFICE_OFFICEFOLDERPICKER_HXX
20 #define INCLUDED_FPICKER_SOURCE_OFFICE_OFFICEFOLDERPICKER_HXX
22 #include <cppuhelper/implbase.hxx>
23 #include <com/sun/star/ui/dialogs/XFolderPicker2.hpp>
24 #include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
27 #include <com/sun/star/lang/DisposedException.hpp>
28 #include <com/sun/star/uno/XComponentContext.hpp>
29 #include "commonpicker.hxx"
34 cppu::ImplInheritanceHelper
<
35 svt::OCommonPicker
, css::ui::dialogs::XFolderPicker2
,
36 css::ui::dialogs::XAsynchronousExecutableDialog
,
37 css::lang::XServiceInfo
>
40 class SvtFolderPicker
: public SvtFolderPicker_Base
43 OUString m_aDescription
;
45 css::uno::Reference
< css::ui::dialogs::XDialogClosedListener
>
48 void prepareExecute( );
49 DECL_LINK( DialogClosedHdl
, Dialog
&, void );
53 virtual ~SvtFolderPicker() override
;
56 // XFolderPicker2 functions
59 virtual void SAL_CALL
setDisplayDirectory( const OUString
& aDirectory
) throw( css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) override
;
60 virtual OUString SAL_CALL
getDisplayDirectory() throw( css::uno::RuntimeException
, std::exception
) override
;
61 virtual OUString SAL_CALL
getDirectory() throw( css::uno::RuntimeException
, std::exception
) override
;
62 virtual void SAL_CALL
setDescription( const OUString
& aDescription
) throw ( css::uno::RuntimeException
, std::exception
) override
;
64 virtual void SAL_CALL
cancel()
65 throw (css::uno::RuntimeException
, std::exception
) override
;
68 // XExecutableDialog functions
70 virtual void SAL_CALL
setTitle( const OUString
& _rTitle
) throw (css::uno::RuntimeException
, std::exception
) override
;
71 virtual sal_Int16 SAL_CALL
execute( ) throw (css::uno::RuntimeException
, std::exception
) override
;
74 // XAsynchronousExecutableDialog functions
76 virtual void SAL_CALL
setDialogTitle( const OUString
& _rTitle
) throw (css::uno::RuntimeException
, std::exception
) override
;
77 virtual void SAL_CALL
startExecuteModal( const css::uno::Reference
< css::ui::dialogs::XDialogClosedListener
>& xListener
) throw (css::uno::RuntimeException
, std::exception
) override
;
80 // XServiceInfo functions
84 virtual OUString SAL_CALL
getImplementationName() throw( css::uno::RuntimeException
, std::exception
) override
;
85 virtual sal_Bool SAL_CALL
supportsService( const OUString
& sServiceName
) throw( css::uno::RuntimeException
, std::exception
) override
;
86 virtual css::uno::Sequence
< OUString
> SAL_CALL
87 getSupportedServiceNames() throw( css::uno::RuntimeException
, std::exception
) override
;
89 /* Helper for XServiceInfo */
90 static css::uno::Sequence
< OUString
> impl_getStaticSupportedServiceNames();
91 static OUString
impl_getStaticImplementationName();
93 /* Helper for registry */
94 static css::uno::Reference
< css::uno::XInterface
> SAL_CALL
impl_createInstance (
95 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
)
96 throw( css::uno::Exception
);
100 // OCommonPicker overridables
102 virtual VclPtr
<SvtFileDialog_Base
> implCreateDialog( vcl::Window
* _pParent
) override
;
103 virtual sal_Int16
implExecutePicker( ) override
;
106 #endif // INCLUDED_FPICKER_SOURCE_OFFICE_OFFICEFOLDERPICKER_HXX
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */