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 _SVX_INSDLG_HXX
20 #define _SVX_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/dialog.hxx>
28 #include <vcl/fixed.hxx>
29 #include <vcl/button.hxx>
30 #include <vcl/field.hxx>
31 #include <vcl/edit.hxx>
32 #include <vcl/lstbox.hxx>
33 #include <svtools/svmedit.hxx> // MultiLineEdit
34 #include <comphelper/embeddedobjectcontainer.hxx>
40 class InsertObjectDialog_Impl
: public ModalDialog
43 com::sun::star::uno::Reference
< com::sun::star::embed::XEmbeddedObject
> m_xObj
;
44 const com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
>& m_xStorage
;
45 comphelper::EmbeddedObjectContainer aCnt
;
47 InsertObjectDialog_Impl(Window
* pParent
, const OString
& rID
,
48 const OUString
& rUIXMLDescription
,
49 const com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
>& xStorage
);
51 com::sun::star::uno::Reference
< com::sun::star::embed::XEmbeddedObject
> GetObject()
53 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> GetIconIfIconified( ::rtl::OUString
* pGraphicMediaType
);
54 virtual sal_Bool
IsCreateNew() const;
57 class SvInsertOleDlg
: public InsertObjectDialog_Impl
59 RadioButton
* m_pRbNewObject
;
60 RadioButton
* m_pRbObjectFromfile
;
61 VclFrame
* m_pObjectTypeFrame
;
62 ListBox
* m_pLbObjecttype
;
63 VclFrame
* m_pFileFrame
;
65 PushButton
* m_pBtnFilepath
;
66 CheckBox
* m_pCbFilelink
;
67 const SvObjectServerList
* m_pServers
;
69 ::com::sun::star::uno::Sequence
< sal_Int8
> m_aIconMetaFile
;
70 OUString m_aIconMediaType
;
72 DECL_LINK(DoubleClickHdl
, void*);
73 DECL_LINK(BrowseHdl
, void *);
74 DECL_LINK(RadioHdl
, void *);
76 ListBox
& GetObjectTypes()
77 { return *m_pLbObjecttype
; }
78 OUString
GetFilePath() const
79 { return m_pEdFilepath
->GetText(); }
80 sal_Bool
IsLinked() const
81 { return m_pCbFilelink
->IsChecked(); }
82 sal_Bool
IsCreateNew() const
83 { return m_pRbNewObject
->IsChecked(); }
86 SvInsertOleDlg( Window
* pParent
,
87 const com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
>& xStorage
,
88 const SvObjectServerList
* pServers
= NULL
);
89 virtual short Execute();
91 /// get replacement for the iconified embedded object and the mediatype of the replacement
92 ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> GetIconIfIconified( ::rtl::OUString
* pGraphicMediaType
);
95 class SvInsertPlugInDialog
: public InsertObjectDialog_Impl
99 PushButton
* m_pBtnFileurl
;
100 VclMultiLineEdit
* m_pEdPluginsOptions
;
101 INetURLObject
* m_pURL
;
102 OUString m_aCommands
;
104 DECL_LINK(BrowseHdl
, void *);
105 OUString
GetPlugInFile() const { return m_pEdFileurl
->GetText(); }
106 OUString
GetPlugInOptions() const { return m_pEdPluginsOptions
->GetText(); }
109 SvInsertPlugInDialog(Window
* pParent
,
110 const com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
>& xStorage
);
111 ~SvInsertPlugInDialog();
112 virtual short Execute();
115 class SfxInsertFloatingFrameDialog
: public InsertObjectDialog_Impl
120 PushButton
* m_pBTOpen
;
122 RadioButton
* m_pRBScrollingOn
;
123 RadioButton
* m_pRBScrollingOff
;
124 RadioButton
* m_pRBScrollingAuto
;
126 RadioButton
* m_pRBFrameBorderOn
;
127 RadioButton
* m_pRBFrameBorderOff
;
129 FixedText
* m_pFTMarginWidth
;
130 NumericField
* m_pNMMarginWidth
;
131 CheckBox
* m_pCBMarginWidthDefault
;
132 FixedText
* m_pFTMarginHeight
;
133 NumericField
* m_pNMMarginHeight
;
134 CheckBox
* m_pCBMarginHeightDefault
;
136 DECL_STATIC_LINK(SfxInsertFloatingFrameDialog
, OpenHdl
, PushButton
* );
137 DECL_STATIC_LINK(SfxInsertFloatingFrameDialog
, CheckHdl
, CheckBox
* );
142 SfxInsertFloatingFrameDialog(Window
*pParent
,
143 const com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
>& xStorage
);
144 SfxInsertFloatingFrameDialog( Window
* pParent
,
145 const com::sun::star::uno::Reference
< com::sun::star::embed::XEmbeddedObject
>& xObj
);
146 virtual short Execute();
149 #endif // _SVX_INSDLG_HXX
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */