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 OUString& 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 : class SvInsertOleDlg : public InsertObjectDialog_Impl
58 : {
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;
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 ~SvInsertOleDlg();
90 : virtual void dispose() SAL_OVERRIDE;
91 : virtual short Execute() SAL_OVERRIDE;
92 :
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;
95 : };
96 :
97 : class SvInsertPlugInDialog : public InsertObjectDialog_Impl
98 : {
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;
105 :
106 : DECL_LINK(BrowseHdl, void *);
107 0 : OUString GetPlugInFile() const { return m_pEdFileurl->GetText(); }
108 0 : OUString GetPlugInOptions() const { return m_pEdPluginsOptions->GetText(); }
109 :
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;
116 : };
117 :
118 : class SfxInsertFloatingFrameDialog : public InsertObjectDialog_Impl
119 : {
120 : private:
121 : VclPtr<Edit> m_pEDName;
122 : VclPtr<Edit> m_pEDURL;
123 : VclPtr<PushButton> m_pBTOpen;
124 :
125 : VclPtr<RadioButton> m_pRBScrollingOn;
126 : VclPtr<RadioButton> m_pRBScrollingOff;
127 : VclPtr<RadioButton> m_pRBScrollingAuto;
128 :
129 : VclPtr<RadioButton> m_pRBFrameBorderOn;
130 : VclPtr<RadioButton> m_pRBFrameBorderOff;
131 :
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;
138 :
139 : DECL_LINK(OpenHdl, PushButton* );
140 : DECL_LINK(CheckHdl, CheckBox* );
141 :
142 : void Init();
143 :
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;
152 : };
153 :
154 : #endif // INCLUDED_CUI_SOURCE_INC_INSDLG_HXX
155 :
156 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|