LibreOffice Module cui (master) 1
insdlg.cxx
Go to the documentation of this file.
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
20#include <com/sun/star/beans/XPropertySet.hpp>
21#include <com/sun/star/beans/PropertyValue.hpp>
22#include <com/sun/star/embed/EmbedStates.hpp>
23#include <com/sun/star/embed/XInsertObjectDialog.hpp>
24#include <com/sun/star/embed/MSOLEObjectSystemCreator.hpp>
25#include <com/sun/star/task/InteractionHandler.hpp>
26#include <com/sun/star/ucb/CommandAbortedException.hpp>
27#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
28#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
29#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
30#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
33
34#include <insdlg.hxx>
35#include <dialmgr.hxx>
36#include <osl/diagnose.h>
37#include <svtools/imagemgr.hxx>
38#include <svtools/strings.hrc>
39#include <svtools/svtresid.hxx>
40
41#include <tools/urlobj.hxx>
42#include <tools/debug.hxx>
43#include <tools/stream.hxx>
45#include <utility>
46#include <vcl/image.hxx>
47#include <vcl/weld.hxx>
48#include <vcl/svapp.hxx>
51#include <sfx2/frmdescr.hxx>
52#include <sfx2/viewsh.hxx>
54#include <sfx2/viewfrm.hxx>
55
56#include <strings.hrc>
57
58using namespace ::com::sun::star;
59using namespace ::com::sun::star::lang;
60using namespace ::com::sun::star::uno;
61using namespace ::com::sun::star::container;
62using namespace ::com::sun::star::ui::dialogs;
63
65{
66 return false;
67}
68
70{
72}
73
75 const OUString& rUIXMLDescription, const OString& rID,
76 css::uno::Reference < css::embed::XStorage > xStorage)
77 : GenericDialogController(pParent, rUIXMLDescription, rID)
78 , m_xStorage(std::move( xStorage ))
79 , aCnt( m_xStorage )
80{
81}
82
84{
85 m_xDialog->response(RET_OK);
86 return true;
87}
88
90{
91 sfx2::FileDialogHelper aHelper(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, m_xDialog.get());
93 const Reference< XFilePicker3 >& xFilePicker = aHelper.GetFilePicker();
94
95 // add filter
96 try
97 {
98 xFilePicker->appendFilter(CuiResId(RID_CUISTR_FILTER_ALL), "*.*");
99 }
100 catch( const IllegalArgumentException& )
101 {
102 TOOLS_WARN_EXCEPTION("cui.dialogs", "caught IllegalArgumentException when registering filter" );
103 }
104
105 if( xFilePicker->execute() == ExecutableDialogResults::OK )
106 {
107 Sequence< OUString > aPathSeq( xFilePicker->getSelectedFiles() );
108 INetURLObject aObj( aPathSeq[0] );
109 m_xEdFilepath->set_text(aObj.PathToFileName());
110 }
111}
112
113IMPL_LINK(SvInsertOleDlg, RadioHdl, weld::Toggleable&, rButton, void)
114{
115 if (!rButton.get_active())
116 return;
117
118 if (m_xRbNewObject->get_active())
119 {
120 m_xObjectTypeFrame->show();
121 m_xFileFrame->hide();
122 }
123 else
124 {
125 m_xFileFrame->show();
126 m_xObjectTypeFrame->hide();
127 }
128}
129
130SvInsertOleDlg::SvInsertOleDlg(weld::Window* pParent, const Reference<embed::XStorage>& xStorage,
131 const SvObjectServerList* pServers)
132 : InsertObjectDialog_Impl( pParent, "cui/ui/insertoleobject.ui", "InsertOLEObjectDialog", xStorage)
133 , m_pServers( pServers )
134 , m_xRbNewObject(m_xBuilder->weld_radio_button("createnew"))
135 , m_xRbObjectFromfile(m_xBuilder->weld_radio_button("createfromfile"))
136 , m_xObjectTypeFrame(m_xBuilder->weld_frame("objecttypeframe"))
137 , m_xLbObjecttype(m_xBuilder->weld_tree_view("types"))
138 , m_xFileFrame(m_xBuilder->weld_frame("fileframe"))
139 , m_xEdFilepath(m_xBuilder->weld_entry("urled"))
140 , m_xBtnFilepath(m_xBuilder->weld_button("urlbtn"))
141 , m_xCbFilelink(m_xBuilder->weld_check_button("linktofile"))
142 , m_xCbAsIcon(m_xBuilder->weld_check_button("asicon"))
143{
144 m_xLbObjecttype->set_size_request(m_xLbObjecttype->get_approximate_digit_width() * 32,
145 m_xLbObjecttype->get_height_rows(6));
146 m_xLbObjecttype->connect_row_activated(LINK(this, SvInsertOleDlg, DoubleClickHdl));
147 m_xBtnFilepath->connect_clicked(LINK( this, SvInsertOleDlg, BrowseHdl));
148 Link<weld::Toggleable&,void> aLink( LINK( this, SvInsertOleDlg, RadioHdl ) );
149 m_xRbNewObject->connect_toggled( aLink );
150 m_xRbObjectFromfile->connect_toggled( aLink );
151 m_xRbNewObject->set_active(true);
152}
153
155{
156 short nRet = RET_OK;
157 SvObjectServerList aObjS;
158 if ( !m_pServers )
159 {
160 // if no list was provided, take the complete one
161 aObjS.FillInsertObjects();
162 m_pServers = &aObjS;
163 }
164
165 // fill listbox and select default
166 m_xLbObjecttype->freeze();
167 for ( size_t i = 0; i < m_pServers->Count(); i++ )
168 m_xLbObjecttype->append_text((*m_pServers)[i].GetHumanName());
169 m_xLbObjecttype->thaw();
170 m_xLbObjecttype->select(0);
171
172 DBG_ASSERT( m_xStorage.is(), "No storage!");
173 if ( m_xStorage.is() && ( nRet = InsertObjectDialog_Impl::run() ) == RET_OK )
174 {
175 OUString aFileName;
176 OUString aName;
177 bool bCreateNew = IsCreateNew();
178 if ( bCreateNew )
179 {
180 // create and insert new embedded object
181 OUString aServerName = m_xLbObjecttype->get_selected_text();
182 const SvObjectServer* pS = m_pServers->Get( aServerName );
183 if ( pS )
184 {
185 if( pS->GetClassName() == SvGlobalName( SO3_OUT_CLASSID ) )
186 {
187 try
188 {
190 embed::MSOLEObjectSystemCreator::create( ::comphelper::getProcessComponentContext() ),
191 uno::UNO_QUERY );
192
193 if ( xDialogCreator.is() )
194 {
196
198 OUString aProgressText;
200 if (pFrame)
201 {
202 // Have a current frame, create a matching progressbar, but don't start it yet.
204 = pFrame->GetFrame().GetFrameInterface();
206 xFrame, uno::UNO_QUERY);
207 if (xProgressFactory.is())
208 {
209 xProgress = xProgressFactory->createStatusIndicator();
210 if (xProgress)
211 {
212 aProgressText = CuiResId(RID_CUISTR_OLE_INSERT);
213 }
214 }
215 }
216
217 const embed::InsertedObjectInfo aNewInf = xDialogCreator->createInstanceByDialog(
219 aName,
220 {comphelper::makePropertyValue("StatusIndicator", xProgress),
221 comphelper::makePropertyValue("StatusIndicatorText", aProgressText)} );
222
223 OSL_ENSURE( aNewInf.Object.is(), "The object must be created or an exception must be thrown!" );
224 m_xObj = aNewInf.Object;
225 for ( const auto& opt : aNewInf.Options )
226 if ( opt.Name == "Icon" )
227 {
228 opt.Value >>= m_aIconMetaFile;
229 }
230 else if ( opt.Name == "IconFormat" )
231 {
232 datatransfer::DataFlavor aFlavor;
233 if ( opt.Value >>= aFlavor )
234 m_aIconMediaType = aFlavor.MimeType;
235 }
236
237 }
238 }
239 catch( ucb::CommandAbortedException& )
240 {
241 // the user has pressed cancel
242 }
243 catch( uno::Exception& )
244 {
245 // TODO: Error handling
246 }
247 }
248 else
249 {
250 // create object with desired ClassId
251 m_xObj = aCnt.CreateEmbeddedObject( pS->GetClassName().GetByteSequence(), aName );
252 }
253
254 if ( !m_xObj.is() )
255 {
256 if( !aFileName.isEmpty() ) // from OLE Dialog
257 {
258 // object couldn't be created from file
259 // global Resource from svtools (former so3 resource)
260 OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE_FROM_FILE));
261 aErr = aErr.replaceFirst( "%", aFileName );
262
263 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(),
264 VclMessageType::Warning, VclButtonsType::Ok, aErr));
265 xBox->run();
266 }
267 else
268 {
269 // object couldn't be created
270 // global Resource from svtools (former so3 resource)
271 OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE));
272 aErr = aErr.replaceFirst( "%", aServerName );
273
274 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(),
275 VclMessageType::Warning, VclButtonsType::Ok, aErr));
276 xBox->run();
277 }
278 }
279 }
280 }
281 else
282 {
283 aFileName = m_xEdFilepath->get_text();
285 aURL.SetSmartProtocol( INetProtocol::File );
286 aURL.SetSmartURL( aFileName );
287 aFileName = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE );
288 bool bLink = m_xCbFilelink->get_active();
289
290 if ( !aFileName.isEmpty() )
291 {
292 uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
294 task::InteractionHandler::createWithParent(xContext, nullptr) );
295
296 // create MediaDescriptor for file to create object from
298 comphelper::makePropertyValue("URL", aFileName),
299 comphelper::makePropertyValue("InteractionHandler", xInteraction)
300 };
301
302 // create object from media descriptor
303
306 if (pFrame)
307 {
308 // Have a current frame, create visual indication that insert is in progress.
310 uno::Reference<task::XStatusIndicatorFactory> xProgressFactory(xFrame, uno::UNO_QUERY);
311 if (xProgressFactory.is())
312 {
313 xProgress = xProgressFactory->createStatusIndicator();
314 if (xProgress)
315 {
316 OUString aOleInsert(CuiResId(RID_CUISTR_OLE_INSERT));
317 xProgress->start(aOleInsert, 100);
318 }
319 }
320 }
321
322 if ( bLink )
323 m_xObj = aCnt.InsertEmbeddedLink( aMedium, aName );
324 else
326
327 if (xProgress.is())
328 {
329 xProgress->end();
330 }
331 }
332
333 if ( !m_xObj.is() )
334 {
335 // object couldn't be created from file
336 // global Resource from svtools (former so3 resource)
337 OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE_FROM_FILE));
338 aErr = aErr.replaceFirst( "%", aFileName );
339
340 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(),
341 VclMessageType::Warning, VclButtonsType::Ok, aErr));
342 xBox->run();
343 }
344 else
345 {
346 if (m_xCbAsIcon->get_active())
347 {
348 //something nice here I guess would be to write the filename into
349 //the image with this icon above it
351 SvMemoryStream aTemp;
352 WriteDIBBitmapEx(aImage.GetBitmapEx(), aTemp);
353 m_aIconMetaFile = Sequence<sal_Int8>(static_cast<const sal_Int8*>(aTemp.GetData()), aTemp.TellEnd());
354 m_aIconMediaType = "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"";
355 }
356 }
357 }
358 }
359
360 m_pServers = nullptr;
361 return nRet;
362}
363
365{
366 if ( m_aIconMetaFile.hasElements() )
367 {
368 if ( pGraphicMediaType )
369 *pGraphicMediaType = m_aIconMediaType;
370
371 return uno::Reference< io::XInputStream >( new ::comphelper::SequenceInputStream( m_aIconMetaFile ) );
372 }
373
375}
376
377
379 const css::uno::Reference < css::embed::XStorage >& xStorage)
380 : InsertObjectDialog_Impl(pParent, "cui/ui/insertfloatingframe.ui", "InsertFloatingFrameDialog",
381 xStorage)
382{
383 Init();
384}
385
388 : InsertObjectDialog_Impl(pParent, "cui/ui/insertfloatingframe.ui", "InsertFloatingFrameDialog",
389 uno::Reference<embed::XStorage>())
390{
391 m_xObj = xObj;
392
393 Init();
394}
395
397{
398 m_xEDName = m_xBuilder->weld_entry("edname");
399 m_xEDURL = m_xBuilder->weld_entry("edurl");
400 m_xBTOpen = m_xBuilder->weld_button("buttonbrowse");
401 m_xRBScrollingOn = m_xBuilder->weld_radio_button("scrollbaron");
402 m_xRBScrollingOff = m_xBuilder->weld_radio_button("scrollbaroff");
403 m_xRBScrollingAuto = m_xBuilder->weld_radio_button("scrollbarauto");
404 m_xRBFrameBorderOn = m_xBuilder->weld_radio_button("borderon");
405 m_xRBFrameBorderOff = m_xBuilder->weld_radio_button("borderoff");
406 m_xFTMarginWidth = m_xBuilder->weld_label("widthlabel");
407 m_xNMMarginWidth = m_xBuilder->weld_spin_button("width");
408 m_xCBMarginWidthDefault = m_xBuilder->weld_check_button("defaultwidth");
409 m_xFTMarginHeight = m_xBuilder->weld_label("heightlabel");
410 m_xNMMarginHeight = m_xBuilder->weld_spin_button("height");
411 m_xCBMarginHeightDefault = m_xBuilder->weld_check_button("defaultheight");
412
414 m_xCBMarginWidthDefault->connect_toggled(aLink);
415 m_xCBMarginHeightDefault->connect_toggled(aLink);
416
417 m_xCBMarginWidthDefault->set_active(true);
418 m_xCBMarginHeightDefault->set_active(true);
419 m_xRBScrollingAuto->set_active(true);
420 m_xRBFrameBorderOn->set_active(true);
421
422 m_xBTOpen->connect_clicked(LINK(this, SfxInsertFloatingFrameDialog, OpenHdl));
423}
424
426{
427 short nRet = RET_OK;
428 bool bOK = false;
430 if ( m_xObj.is() )
431 {
432 try
433 {
434 if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED )
435 m_xObj->changeState( embed::EmbedStates::RUNNING );
436 xSet.set( m_xObj->getComponent(), uno::UNO_QUERY );
437 OUString aStr;
438 uno::Any aAny = xSet->getPropertyValue( "FrameURL" );
439 if ( aAny >>= aStr )
440 m_xEDURL->set_text( aStr );
441 aAny = xSet->getPropertyValue( "FrameName" );
442 if ( aAny >>= aStr )
443 m_xEDName->set_text(aStr);
444
445 sal_Int32 nSize = SIZE_NOT_SET;
446 aAny = xSet->getPropertyValue( "FrameMarginWidth" );
447 aAny >>= nSize;
448
449 if ( nSize == SIZE_NOT_SET )
450 {
451 m_xCBMarginWidthDefault->set_active(true);
452 m_xNMMarginWidth->set_text(OUString::number(DEFAULT_MARGIN_WIDTH));
453 m_xFTMarginWidth->set_sensitive(false);
454 m_xNMMarginWidth->set_sensitive(false);
455 }
456 else
457 m_xNMMarginWidth->set_text(OUString::number(nSize));
458
459 aAny = xSet->getPropertyValue( "FrameMarginHeight" );
460 aAny >>= nSize;
461
462 if ( nSize == SIZE_NOT_SET )
463 {
464 m_xCBMarginHeightDefault->set_active(true);
465 m_xNMMarginHeight->set_text(OUString::number(DEFAULT_MARGIN_HEIGHT));
466 m_xFTMarginHeight->set_sensitive(false);
467 m_xNMMarginHeight->set_sensitive(false);
468 }
469 else
470 m_xNMMarginHeight->set_text(OUString::number(nSize));
471
472 bool bScrollOn = false;
473 bool bScrollOff = false;
474 bool bScrollAuto = false;
475
476 bool bSet = false;
477 aAny = xSet->getPropertyValue( "FrameIsAutoScroll" );
478 aAny >>= bSet;
479 if ( !bSet )
480 {
481 aAny = xSet->getPropertyValue( "FrameIsScrollingMode" );
482 aAny >>= bSet;
483 bScrollOn = bSet;
484 bScrollOff = !bSet;
485 }
486 else
487 bScrollAuto = true;
488
489 m_xRBScrollingOn->set_sensitive(bScrollOn);
490 m_xRBScrollingOff->set_sensitive(bScrollOff);
491 m_xRBScrollingAuto->set_sensitive(bScrollAuto);
492
493 bSet = false;
494 aAny = xSet->getPropertyValue( "FrameIsAutoBorder" );
495 aAny >>= bSet;
496 if ( !bSet )
497 {
498 aAny = xSet->getPropertyValue( "FrameIsBorder" );
499 aAny >>= bSet;
500 m_xRBFrameBorderOn->set_active(bSet);
501 m_xRBFrameBorderOff->set_active(!bSet);
502 }
503
504 bOK = true;
505 }
506 catch ( uno::Exception& )
507 {
508 OSL_FAIL( "No IFrame!" );
509 }
510 }
511 else
512 {
513 DBG_ASSERT( m_xStorage.is(), "No storage!");
514 bOK = m_xStorage.is();
515 }
516
517 if (!bOK)
518 return RET_OK;
519
521 if ( nRet == RET_OK )
522 {
523 OUString aURL;
524 if (!m_xEDURL->get_text().isEmpty())
525 {
526 // URL can be a valid and absolute URL or a system file name
527 INetURLObject aObj;
528 aObj.SetSmartProtocol( INetProtocol::File );
529 if ( aObj.SetSmartURL( m_xEDURL->get_text() ) )
531 }
532
533 if ( !m_xObj.is() && !aURL.isEmpty() )
534 {
535 // create the object
536 OUString aName;
539 if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED )
540 m_xObj->changeState( embed::EmbedStates::RUNNING );
541 xSet.set( m_xObj->getComponent(), uno::UNO_QUERY );
542 }
543
544 if ( m_xObj.is() )
545 {
546 try
547 {
548 bool bIPActive = m_xObj->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE;
549 if ( bIPActive )
550 m_xObj->changeState( embed::EmbedStates::RUNNING );
551
552 OUString aName = m_xEDName->get_text();
553 ScrollingMode eScroll = ScrollingMode::No;
554 if (m_xRBScrollingOn->get_active())
555 eScroll = ScrollingMode::Yes;
556 if (m_xRBScrollingOff->get_active())
557 eScroll = ScrollingMode::No;
558 if (m_xRBScrollingAuto->get_active())
559 eScroll = ScrollingMode::Auto;
560
561 bool bHasBorder = m_xRBFrameBorderOn->get_active();
562
563 tools::Long lMarginWidth;
564 if (!m_xCBMarginWidthDefault->get_active())
565 lMarginWidth = static_cast<tools::Long>(m_xNMMarginWidth->get_text().toInt32());
566 else
567 lMarginWidth = SIZE_NOT_SET;
568
569 tools::Long lMarginHeight;
570 if (!m_xCBMarginHeightDefault->get_active())
571 lMarginHeight = static_cast<tools::Long>(m_xNMMarginHeight->get_text().toInt32());
572 else
573 lMarginHeight = SIZE_NOT_SET;
574
575 xSet->setPropertyValue( "FrameURL", Any( aURL ) );
576 xSet->setPropertyValue( "FrameName", Any( aName ) );
577
578 if ( eScroll == ScrollingMode::Auto )
579 xSet->setPropertyValue( "FrameIsAutoScroll", Any( true ) );
580 else
581 xSet->setPropertyValue( "FrameIsScrollingMode", Any( eScroll == ScrollingMode::Yes ) );
582
583 xSet->setPropertyValue( "FrameIsBorder", Any( bHasBorder ) );
584 xSet->setPropertyValue( "FrameMarginWidth", Any( sal_Int32( lMarginWidth ) ) );
585 xSet->setPropertyValue( "FrameMarginHeight", Any( sal_Int32( lMarginHeight ) ) );
586
587 if ( bIPActive )
588 m_xObj->changeState( embed::EmbedStates::INPLACE_ACTIVE );
589 }
590 catch ( uno::Exception& )
591 {
592 OSL_FAIL( "No IFrame!" );
593 }
594 }
595 }
596
597 return nRet;
598}
599
601{
602 weld::CheckButton& rCB = dynamic_cast<weld::CheckButton&>(rButton);
603 if (&rCB == m_xCBMarginWidthDefault.get())
604 {
605 if (rCB.get_active())
606 m_xNMMarginWidth->set_text(OUString::number(DEFAULT_MARGIN_WIDTH));
607 m_xFTMarginWidth->set_sensitive(!rCB.get_active());
608 m_xNMMarginWidth->set_sensitive(!rCB.get_active());
609 }
610
611 if (&rCB == m_xCBMarginHeightDefault.get())
612 {
613 if (rCB.get_active())
614 m_xNMMarginHeight->set_text(OUString::number(DEFAULT_MARGIN_HEIGHT));
615 m_xFTMarginHeight->set_sensitive(!rCB.get_active());
616 m_xNMMarginHeight->set_sensitive(!rCB.get_active());
617 }
618}
619
621{
622 // create the file dialog
623 sfx2::FileDialogHelper aFileDlg(
624 ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, OUString(),
625 SfxFilterFlags::NONE, SfxFilterFlags::NONE, m_xDialog.get());
626
627 // set the title
628 aFileDlg.SetTitle(CuiResId(RID_CUISTR_SELECT_FILE_IFRAME));
629
630 // show the dialog
631 if ( aFileDlg.Execute() == ERRCODE_NONE )
633}
634
635/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XExecutableDialog > m_xDialog
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
void SetSmartProtocol(INetProtocol eTheSmartScheme)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
bool SetSmartURL(std::u16string_view rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
OUString PathToFileName() const
BitmapEx GetBitmapEx() const
virtual bool IsCreateNew() const
Definition: insdlg.cxx:64
css::uno::Reference< css::embed::XEmbeddedObject > m_xObj
Definition: insdlg.hxx:34
const css::uno::Reference< css::embed::XStorage > m_xStorage
Definition: insdlg.hxx:35
InsertObjectDialog_Impl(weld::Window *pParent, const OUString &rUIXMLDescription, const OString &rID, css::uno::Reference< css::embed::XStorage > xStorage)
Definition: insdlg.cxx:74
comphelper::EmbeddedObjectContainer aCnt
Definition: insdlg.hxx:36
virtual css::uno::Reference< css::io::XInputStream > GetIconIfIconified(OUString *pGraphicMediaType)
Definition: insdlg.cxx:69
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
std::unique_ptr< weld::CheckButton > m_xCBMarginWidthDefault
Definition: insdlg.hxx:96
std::unique_ptr< weld::RadioButton > m_xRBScrollingOff
Definition: insdlg.hxx:88
std::unique_ptr< weld::Label > m_xFTMarginWidth
Definition: insdlg.hxx:94
std::unique_ptr< weld::Entry > m_xEDURL
Definition: insdlg.hxx:84
std::unique_ptr< weld::RadioButton > m_xRBFrameBorderOff
Definition: insdlg.hxx:92
virtual short run() override
Definition: insdlg.cxx:425
std::unique_ptr< weld::RadioButton > m_xRBFrameBorderOn
Definition: insdlg.hxx:91
std::unique_ptr< weld::CheckButton > m_xCBMarginHeightDefault
Definition: insdlg.hxx:99
std::unique_ptr< weld::Button > m_xBTOpen
Definition: insdlg.hxx:85
std::unique_ptr< weld::SpinButton > m_xNMMarginWidth
Definition: insdlg.hxx:95
std::unique_ptr< weld::Label > m_xFTMarginHeight
Definition: insdlg.hxx:97
std::unique_ptr< weld::RadioButton > m_xRBScrollingOn
Definition: insdlg.hxx:87
SfxInsertFloatingFrameDialog(weld::Window *pParent, const css::uno::Reference< css::embed::XStorage > &xStorage)
Definition: insdlg.cxx:378
std::unique_ptr< weld::SpinButton > m_xNMMarginHeight
Definition: insdlg.hxx:98
std::unique_ptr< weld::RadioButton > m_xRBScrollingAuto
Definition: insdlg.hxx:89
std::unique_ptr< weld::Entry > m_xEDName
Definition: insdlg.hxx:83
static SfxViewFrame * Current()
SfxFrame & GetFrame() const
static SVT_DLLPUBLIC Image GetImage(const INetURLObject &rURL, bool bBig=false, css::uno::Reference< css::ucb::XCommandEnvironment > const &env=utl::UCBContentHelper::getDefaultCommandEnvironment())
css::uno::Sequence< sal_Int8 > GetByteSequence() const
std::unique_ptr< weld::Entry > m_xEdFilepath
Definition: insdlg.hxx:60
std::unique_ptr< weld::RadioButton > m_xRbNewObject
Definition: insdlg.hxx:55
bool IsCreateNew() const override
Definition: insdlg.hxx:68
std::unique_ptr< weld::Button > m_xBtnFilepath
Definition: insdlg.hxx:61
const SvObjectServerList * m_pServers
Definition: insdlg.hxx:50
std::unique_ptr< weld::CheckButton > m_xCbAsIcon
Definition: insdlg.hxx:63
virtual short run() override
Definition: insdlg.cxx:154
std::unique_ptr< weld::RadioButton > m_xRbObjectFromfile
Definition: insdlg.hxx:56
std::unique_ptr< weld::CheckButton > m_xCbFilelink
Definition: insdlg.hxx:62
std::unique_ptr< weld::TreeView > m_xLbObjecttype
Definition: insdlg.hxx:58
SvInsertOleDlg(weld::Window *pParent, const css::uno::Reference< css::embed::XStorage > &xStorage, const SvObjectServerList *pServers)
Definition: insdlg.cxx:130
css::uno::Reference< css::io::XInputStream > GetIconIfIconified(OUString *pGraphicMediaType) override
get replacement for the iconified embedded object and the mediatype of the replacement
Definition: insdlg.cxx:364
css::uno::Sequence< sal_Int8 > m_aIconMetaFile
Definition: insdlg.hxx:52
OUString m_aIconMediaType
Definition: insdlg.hxx:53
const void * GetData()
virtual sal_uInt64 TellEnd() override
const SvObjectServer * Get(std::u16string_view rHumanName) const
size_t Count() const
css::uno::Reference< css::embed::XEmbeddedObject > InsertEmbeddedLink(const css::uno::Sequence< css::beans::PropertyValue > &, OUString &)
css::uno::Reference< css::embed::XEmbeddedObject > CreateEmbeddedObject(const css::uno::Sequence< sal_Int8 > &, OUString &, OUString const *pBaseURL=nullptr)
bool InsertEmbeddedObject(const css::uno::Reference< css::embed::XEmbeddedObject > &, OUString &)
#define SO3_IFRAME_CLASSID
#define SO3_OUT_CLASSID
OUString GetPath() const
void SetTitle(const OUString &rNewTitle)
virtual short run()
std::shared_ptr< weld::Dialog > m_xDialog
std::unique_ptr< weld::Builder > m_xBuilder
virtual bool get_active() const=0
virtual void set_sensitive(bool sensitive)=0
OUString CuiResId(TranslateId aKey)
Definition: cuiresmgr.cxx:23
const char * pS
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
bool VCL_DLLPUBLIC WriteDIBBitmapEx(const BitmapEx &rSource, SvStream &rOStm)
URL aURL
#define ERRCODE_NONE
Any aHelper
ScrollingMode
#define SIZE_NOT_SET
IMPL_LINK_NOARG(SvInsertOleDlg, DoubleClickHdl, weld::TreeView &, bool)
Definition: insdlg.cxx:83
IMPL_LINK(SvInsertOleDlg, RadioHdl, weld::Toggleable &, rButton, void)
Definition: insdlg.cxx:113
OUString aName
aStr
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
Reference
int i
long Long
Reference< XFrame > xFrame
SVT_DLLPUBLIC OUString SvtResId(TranslateId aId)
signed char sal_Int8
RET_OK
#define DEFAULT_MARGIN_HEIGHT
#define DEFAULT_MARGIN_WIDTH