bump product version to 5.0.4.1
[LibreOffice.git] / cui / source / inc / insdlg.hxx
blob9d08cc57bb7591217c05b610c7a44c504dc07617
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/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>
34 #include <comphelper/embeddedobjectcontainer.hxx>
36 class VclFrame;
38 class INetURLObject;
40 class InsertObjectDialog_Impl : public ModalDialog
42 protected:
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(vcl::Window * pParent, const OUString& rID,
48 const OUString& rUIXMLDescription,
49 const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage);
50 public:
51 com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObject()
52 { return m_xObj; }
53 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( OUString* pGraphicMediaType );
54 virtual bool IsCreateNew() const;
57 class SvInsertOleDlg : public InsertObjectDialog_Impl
59 VclPtr<RadioButton> m_pRbNewObject;
60 VclPtr<RadioButton> m_pRbObjectFromfile;
61 VclPtr<VclFrame> m_pObjectTypeFrame;
62 VclPtr<ListBox> m_pLbObjecttype;
63 VclPtr<VclFrame> m_pFileFrame;
64 VclPtr<Edit> m_pEdFilepath;
65 VclPtr<PushButton> m_pBtnFilepath;
66 VclPtr<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 *);
75 void SelectDefault();
76 ListBox& GetObjectTypes()
77 { return *m_pLbObjecttype; }
78 OUString GetFilePath() const
79 { return m_pEdFilepath->GetText(); }
80 bool IsLinked() const
81 { return m_pCbFilelink->IsChecked(); }
82 bool IsCreateNew() const SAL_OVERRIDE
83 { return m_pRbNewObject->IsChecked(); }
85 public:
86 SvInsertOleDlg( vcl::Window* pParent,
87 const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage,
88 const SvObjectServerList* pServers = NULL );
89 virtual ~SvInsertOleDlg();
90 virtual void dispose() SAL_OVERRIDE;
91 virtual short Execute() SAL_OVERRIDE;
93 /// get replacement for the iconified embedded object and the mediatype of the replacement
94 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( OUString* pGraphicMediaType ) SAL_OVERRIDE;
97 class SvInsertPlugInDialog : public InsertObjectDialog_Impl
99 private:
100 VclPtr<Edit> m_pEdFileurl;
101 VclPtr<PushButton> m_pBtnFileurl;
102 VclPtr<VclMultiLineEdit> m_pEdPluginsOptions;
103 INetURLObject* m_pURL;
104 OUString m_aCommands;
106 DECL_LINK(BrowseHdl, void *);
107 OUString GetPlugInFile() const { return m_pEdFileurl->GetText(); }
108 OUString GetPlugInOptions() const { return m_pEdPluginsOptions->GetText(); }
110 public:
111 SvInsertPlugInDialog(vcl::Window* pParent,
112 const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage);
113 virtual ~SvInsertPlugInDialog();
114 virtual void dispose() SAL_OVERRIDE;
115 virtual short Execute() SAL_OVERRIDE;
118 class SfxInsertFloatingFrameDialog : public InsertObjectDialog_Impl
120 private:
121 VclPtr<Edit> m_pEDName;
122 VclPtr<Edit> m_pEDURL;
123 VclPtr<PushButton> m_pBTOpen;
125 VclPtr<RadioButton> m_pRBScrollingOn;
126 VclPtr<RadioButton> m_pRBScrollingOff;
127 VclPtr<RadioButton> m_pRBScrollingAuto;
129 VclPtr<RadioButton> m_pRBFrameBorderOn;
130 VclPtr<RadioButton> m_pRBFrameBorderOff;
132 VclPtr<FixedText> m_pFTMarginWidth;
133 VclPtr<NumericField> m_pNMMarginWidth;
134 VclPtr<CheckBox> m_pCBMarginWidthDefault;
135 VclPtr<FixedText> m_pFTMarginHeight;
136 VclPtr<NumericField> m_pNMMarginHeight;
137 VclPtr<CheckBox> m_pCBMarginHeightDefault;
139 DECL_LINK(OpenHdl, PushButton* );
140 DECL_LINK(CheckHdl, CheckBox* );
142 void Init();
144 public:
145 SfxInsertFloatingFrameDialog(vcl::Window *pParent,
146 const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
147 SfxInsertFloatingFrameDialog( vcl::Window* pParent,
148 const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj );
149 virtual ~SfxInsertFloatingFrameDialog();
150 virtual void dispose() SAL_OVERRIDE;
151 virtual short Execute() SAL_OVERRIDE;
154 #endif // INCLUDED_CUI_SOURCE_INC_INSDLG_HXX
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */