Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_CUI_SOURCE_INC_INSDLG_HXX
20 : #define INCLUDED_CUI_SOURCE_INC_INSDLG_HXX
21 :
22 : #include <com/sun/star/uno/Reference.h>
23 : #include <com/sun/star/embed/XEmbeddedObject.hpp>
24 : #include <com/sun/star/embed/XStorage.hpp>
25 :
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>
35 :
36 : class VclFrame;
37 :
38 : class INetURLObject;
39 :
40 0 : class InsertObjectDialog_Impl : public ModalDialog
41 : {
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;
46 :
47 : InsertObjectDialog_Impl(vcl::Window * pParent, const OString& rID,
48 : const OUString& rUIXMLDescription,
49 : const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage);
50 : public:
51 0 : com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObject()
52 0 : { return m_xObj; }
53 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( OUString* pGraphicMediaType );
54 : virtual bool IsCreateNew() const;
55 : };
56 :
57 0 : class SvInsertOleDlg : public InsertObjectDialog_Impl
58 : {
59 : RadioButton* m_pRbNewObject;
60 : RadioButton* m_pRbObjectFromfile;
61 : VclFrame* m_pObjectTypeFrame;
62 : ListBox* m_pLbObjecttype;
63 : VclFrame* m_pFileFrame;
64 : Edit* m_pEdFilepath;
65 : PushButton* m_pBtnFilepath;
66 : CheckBox* m_pCbFilelink;
67 : const SvObjectServerList* m_pServers;
68 :
69 : ::com::sun::star::uno::Sequence< sal_Int8 > m_aIconMetaFile;
70 : OUString m_aIconMediaType;
71 :
72 : DECL_LINK(DoubleClickHdl, void*);
73 : DECL_LINK(BrowseHdl, void *);
74 : DECL_LINK(RadioHdl, void *);
75 : void SelectDefault();
76 0 : ListBox& GetObjectTypes()
77 0 : { return *m_pLbObjecttype; }
78 0 : OUString GetFilePath() const
79 0 : { return m_pEdFilepath->GetText(); }
80 0 : bool IsLinked() const
81 0 : { return m_pCbFilelink->IsChecked(); }
82 0 : bool IsCreateNew() const SAL_OVERRIDE
83 0 : { return m_pRbNewObject->IsChecked(); }
84 :
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 short Execute() SAL_OVERRIDE;
90 :
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( OUString* pGraphicMediaType ) SAL_OVERRIDE;
93 : };
94 :
95 : class SvInsertPlugInDialog : public InsertObjectDialog_Impl
96 : {
97 : private:
98 : Edit* m_pEdFileurl;
99 : PushButton* m_pBtnFileurl;
100 : VclMultiLineEdit* m_pEdPluginsOptions;
101 : INetURLObject* m_pURL;
102 : OUString m_aCommands;
103 :
104 : DECL_LINK(BrowseHdl, void *);
105 0 : OUString GetPlugInFile() const { return m_pEdFileurl->GetText(); }
106 0 : OUString GetPlugInOptions() const { return m_pEdPluginsOptions->GetText(); }
107 :
108 : public:
109 : SvInsertPlugInDialog(vcl::Window* pParent,
110 : const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage);
111 : virtual ~SvInsertPlugInDialog();
112 : virtual short Execute() SAL_OVERRIDE;
113 : };
114 :
115 0 : class SfxInsertFloatingFrameDialog : public InsertObjectDialog_Impl
116 : {
117 : private:
118 : Edit* m_pEDName;
119 : Edit* m_pEDURL;
120 : PushButton* m_pBTOpen;
121 :
122 : RadioButton* m_pRBScrollingOn;
123 : RadioButton* m_pRBScrollingOff;
124 : RadioButton* m_pRBScrollingAuto;
125 :
126 : RadioButton* m_pRBFrameBorderOn;
127 : RadioButton* m_pRBFrameBorderOff;
128 :
129 : FixedText* m_pFTMarginWidth;
130 : NumericField* m_pNMMarginWidth;
131 : CheckBox* m_pCBMarginWidthDefault;
132 : FixedText* m_pFTMarginHeight;
133 : NumericField* m_pNMMarginHeight;
134 : CheckBox* m_pCBMarginHeightDefault;
135 :
136 : DECL_STATIC_LINK(SfxInsertFloatingFrameDialog, OpenHdl, PushButton* );
137 : DECL_STATIC_LINK(SfxInsertFloatingFrameDialog, CheckHdl, CheckBox* );
138 :
139 : void Init();
140 :
141 : public:
142 : SfxInsertFloatingFrameDialog(vcl::Window *pParent,
143 : const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
144 : SfxInsertFloatingFrameDialog( vcl::Window* pParent,
145 : const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj );
146 : virtual short Execute() SAL_OVERRIDE;
147 : };
148 :
149 : #endif // INCLUDED_CUI_SOURCE_INC_INSDLG_HXX
150 :
151 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|