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_CUI_SOURCE_INC_INSDLG_HXX
20 #define INCLUDED_CUI_SOURCE_INC_INSDLG_HXX
22 #include <com/sun/star/uno/Reference.h>
23 #include <com/sun/star/embed/XEmbeddedObject.hpp>
24 #include <com/sun/star/embed/XStorage.hpp>
26 #include <svtools/insdlg.hxx>
27 #include <vcl/weld.hxx>
28 #include <comphelper/embeddedobjectcontainer.hxx>
32 class InsertObjectDialog_Impl
: public weld::GenericDialogController
35 css::uno::Reference
< css::embed::XEmbeddedObject
> m_xObj
;
36 const css::uno::Reference
< css::embed::XStorage
> m_xStorage
;
37 comphelper::EmbeddedObjectContainer aCnt
;
39 InsertObjectDialog_Impl(weld::Window
* pParent
,
40 const OUString
& rUIXMLDescription
, const OString
& rID
,
41 const css::uno::Reference
< css::embed::XStorage
>& xStorage
);
43 const css::uno::Reference
<css::embed::XEmbeddedObject
>& GetObject() { return m_xObj
; }
44 virtual css::uno::Reference
<css::io::XInputStream
> GetIconIfIconified(OUString
* pGraphicMediaType
);
45 void SetHelpId(const OString
& rHelpId
) { m_xDialog
->set_help_id(rHelpId
); }
46 virtual bool IsCreateNew() const;
49 class SvInsertOleDlg
: public InsertObjectDialog_Impl
51 const SvObjectServerList
* m_pServers
;
53 css::uno::Sequence
< sal_Int8
> m_aIconMetaFile
;
54 OUString m_aIconMediaType
;
56 std::unique_ptr
<weld::RadioButton
> m_xRbNewObject
;
57 std::unique_ptr
<weld::RadioButton
> m_xRbObjectFromfile
;
58 std::unique_ptr
<weld::Frame
> m_xObjectTypeFrame
;
59 std::unique_ptr
<weld::TreeView
> m_xLbObjecttype
;
60 std::unique_ptr
<weld::Frame
> m_xFileFrame
;
61 std::unique_ptr
<weld::Entry
> m_xEdFilepath
;
62 std::unique_ptr
<weld::Button
> m_xBtnFilepath
;
63 std::unique_ptr
<weld::CheckButton
> m_xCbFilelink
;
64 std::unique_ptr
<weld::CheckButton
> m_xCbAsIcon
;
66 DECL_LINK(DoubleClickHdl
, weld::TreeView
&, void);
67 DECL_LINK(BrowseHdl
, weld::Button
&, void);
68 DECL_LINK(RadioHdl
, weld::Button
&, void);
69 bool IsCreateNew() const override
{ return m_xRbNewObject
->get_active(); }
72 SvInsertOleDlg(weld::Window
* pParent
,
73 const css::uno::Reference
< css::embed::XStorage
>& xStorage
,
74 const SvObjectServerList
* pServers
);
75 virtual short run() override
;
77 /// get replacement for the iconified embedded object and the mediatype of the replacement
78 css::uno::Reference
< css::io::XInputStream
> GetIconIfIconified( OUString
* pGraphicMediaType
) override
;
81 class SfxInsertFloatingFrameDialog
: public InsertObjectDialog_Impl
84 std::unique_ptr
<weld::Entry
> m_xEDName
;
85 std::unique_ptr
<weld::Entry
> m_xEDURL
;
86 std::unique_ptr
<weld::Button
> m_xBTOpen
;
88 std::unique_ptr
<weld::RadioButton
> m_xRBScrollingOn
;
89 std::unique_ptr
<weld::RadioButton
> m_xRBScrollingOff
;
90 std::unique_ptr
<weld::RadioButton
> m_xRBScrollingAuto
;
92 std::unique_ptr
<weld::RadioButton
> m_xRBFrameBorderOn
;
93 std::unique_ptr
<weld::RadioButton
> m_xRBFrameBorderOff
;
95 std::unique_ptr
<weld::Label
> m_xFTMarginWidth
;
96 std::unique_ptr
<weld::SpinButton
> m_xNMMarginWidth
;
97 std::unique_ptr
<weld::CheckButton
> m_xCBMarginWidthDefault
;
98 std::unique_ptr
<weld::Label
> m_xFTMarginHeight
;
99 std::unique_ptr
<weld::SpinButton
> m_xNMMarginHeight
;
100 std::unique_ptr
<weld::CheckButton
> m_xCBMarginHeightDefault
;
102 DECL_LINK(OpenHdl
, weld::Button
&, void);
103 DECL_LINK(CheckHdl
, weld::Button
&, void);
108 SfxInsertFloatingFrameDialog(weld::Window
*pParent
,
109 const css::uno::Reference
<css::embed::XStorage
>& xStorage
);
110 SfxInsertFloatingFrameDialog(weld::Window
* pParent
,
111 const css::uno::Reference
<css::embed::XEmbeddedObject
>& xObj
);
112 virtual short run() override
;
115 #endif // INCLUDED_CUI_SOURCE_INC_INSDLG_HXX
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */