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 OUString& 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;
199 if (SfxViewFrame* pFrame = SfxViewFrame::Current())
200 {
201 // Have a current frame, create a matching progressbar, but don't start it yet.
203 = pFrame->GetFrame().GetFrameInterface();
205 xFrame, uno::UNO_QUERY);
206 if (xProgressFactory.is())
207 {
208 xProgress = xProgressFactory->createStatusIndicator();
209 if (xProgress)
210 {
211 aProgressText = CuiResId(RID_CUISTR_OLE_INSERT);
212 }
213 }
214 }
215
216 const embed::InsertedObjectInfo aNewInf = xDialogCreator->createInstanceByDialog(
218 aName,
219 {comphelper::makePropertyValue("StatusIndicator", xProgress),
220 comphelper::makePropertyValue("StatusIndicatorText", aProgressText)} );
221
222 OSL_ENSURE( aNewInf.Object.is(), "The object must be created or an exception must be thrown!" );
223 m_xObj = aNewInf.Object;
224 for ( const auto& opt : aNewInf.Options )
225 if ( opt.Name == "Icon" )
226 {
227 opt.Value >>= m_aIconMetaFile;
228 }
229 else if ( opt.Name == "IconFormat" )
230 {
231 datatransfer::DataFlavor aFlavor;
232 if ( opt.Value >>= aFlavor )
233 m_aIconMediaType = aFlavor.MimeType;
234 }
235
236 }
237 }
238 catch( ucb::CommandAbortedException& )
239 {
240 // the user has pressed cancel
241 }
242 catch( uno::Exception& )
243 {
244 // TODO: Error handling
245 }
246 }
247 else
248 {
249 // create object with desired ClassId
250 m_xObj = aCnt.CreateEmbeddedObject( pS->GetClassName().GetByteSequence(), aName );
251 }
252
253 if ( !m_xObj.is() )
254 {
255 if( !aFileName.isEmpty() ) // from OLE Dialog
256 {
257 // object couldn't be created from file
258 // global Resource from svtools (former so3 resource)
259 OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE_FROM_FILE));
260 aErr = aErr.replaceFirst( "%", aFileName );
261
262 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(),
263 VclMessageType::Warning, VclButtonsType::Ok, aErr));
264 xBox->run();
265 }
266 else
267 {
268 // object couldn't be created
269 // global Resource from svtools (former so3 resource)
270 OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE));
271 aErr = aErr.replaceFirst( "%", aServerName );
272
273 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(),
274 VclMessageType::Warning, VclButtonsType::Ok, aErr));
275 xBox->run();
276 }
277 }
278 }
279 }
280 else
281 {
282 aFileName = m_xEdFilepath->get_text();
284 aURL.SetSmartProtocol( INetProtocol::File );
285 aURL.SetSmartURL( aFileName );
286 aFileName = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE );
287 bool bLink = m_xCbFilelink->get_active();
288
289 if ( !aFileName.isEmpty() )
290 {
291 uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
293 task::InteractionHandler::createWithParent(xContext, nullptr) );
294
295 // create MediaDescriptor for file to create object from
297 comphelper::makePropertyValue("URL", aFileName),
298 comphelper::makePropertyValue("InteractionHandler", xInteraction)
299 };
300
301 // create object from media descriptor
302
304 if (SfxViewFrame* pFrame = SfxViewFrame::Current())
305 {
306 // Have a current frame, create visual indication that insert is in progress.
307 uno::Reference<frame::XFrame> xFrame = pFrame->GetFrame().GetFrameInterface();
308 uno::Reference<task::XStatusIndicatorFactory> xProgressFactory(xFrame, uno::UNO_QUERY);
309 if (xProgressFactory.is())
310 {
311 xProgress = xProgressFactory->createStatusIndicator();
312 if (xProgress)
313 {
314 OUString aOleInsert(CuiResId(RID_CUISTR_OLE_INSERT));
315 xProgress->start(aOleInsert, 100);
316 }
317 }
318 }
319
320 if ( bLink )
321 m_xObj = aCnt.InsertEmbeddedLink( aMedium, aName );
322 else
324
325 if (xProgress.is())
326 {
327 xProgress->end();
328 }
329 }
330
331 if ( !m_xObj.is() )
332 {
333 // object couldn't be created from file
334 // global Resource from svtools (former so3 resource)
335 OUString aErr(SvtResId(STR_ERROR_OBJNOCREATE_FROM_FILE));
336 aErr = aErr.replaceFirst( "%", aFileName );
337
338 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(),
339 VclMessageType::Warning, VclButtonsType::Ok, aErr));
340 xBox->run();
341 }
342 else
343 {
344 if (m_xCbAsIcon->get_active())
345 {
346 //something nice here I guess would be to write the filename into
347 //the image with this icon above it
349 SvMemoryStream aTemp;
350 WriteDIBBitmapEx(aImage.GetBitmapEx(), aTemp);
351 m_aIconMetaFile = Sequence<sal_Int8>(static_cast<const sal_Int8*>(aTemp.GetData()), aTemp.TellEnd());
352 m_aIconMediaType = "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"";
353 }
354 }
355 }
356 }
357
358 m_pServers = nullptr;
359 return nRet;
360}
361
363{
364 if ( m_aIconMetaFile.hasElements() )
365 {
366 if ( pGraphicMediaType )
367 *pGraphicMediaType = m_aIconMediaType;
368
369 return uno::Reference< io::XInputStream >( new ::comphelper::SequenceInputStream( m_aIconMetaFile ) );
370 }
371
373}
374
375
377 const css::uno::Reference < css::embed::XStorage >& xStorage)
378 : InsertObjectDialog_Impl(pParent, "cui/ui/insertfloatingframe.ui", "InsertFloatingFrameDialog",
379 xStorage)
380{
381 Init();
382}
383
386 : InsertObjectDialog_Impl(pParent, "cui/ui/insertfloatingframe.ui", "InsertFloatingFrameDialog",
387 uno::Reference<embed::XStorage>())
388{
389 m_xObj = xObj;
390
391 Init();
392}
393
395{
396 m_xEDName = m_xBuilder->weld_entry("edname");
397 m_xEDURL = m_xBuilder->weld_entry("edurl");
398 m_xBTOpen = m_xBuilder->weld_button("buttonbrowse");
399 m_xRBScrollingOn = m_xBuilder->weld_radio_button("scrollbaron");
400 m_xRBScrollingOff = m_xBuilder->weld_radio_button("scrollbaroff");
401 m_xRBScrollingAuto = m_xBuilder->weld_radio_button("scrollbarauto");
402 m_xRBFrameBorderOn = m_xBuilder->weld_radio_button("borderon");
403 m_xRBFrameBorderOff = m_xBuilder->weld_radio_button("borderoff");
404 m_xFTMarginWidth = m_xBuilder->weld_label("widthlabel");
405 m_xNMMarginWidth = m_xBuilder->weld_spin_button("width");
406 m_xCBMarginWidthDefault = m_xBuilder->weld_check_button("defaultwidth");
407 m_xFTMarginHeight = m_xBuilder->weld_label("heightlabel");
408 m_xNMMarginHeight = m_xBuilder->weld_spin_button("height");
409 m_xCBMarginHeightDefault = m_xBuilder->weld_check_button("defaultheight");
410
412 m_xCBMarginWidthDefault->connect_toggled(aLink);
413 m_xCBMarginHeightDefault->connect_toggled(aLink);
414
415 m_xCBMarginWidthDefault->set_active(true);
416 m_xCBMarginHeightDefault->set_active(true);
417 m_xRBScrollingAuto->set_active(true);
418 m_xRBFrameBorderOn->set_active(true);
419
420 m_xBTOpen->connect_clicked(LINK(this, SfxInsertFloatingFrameDialog, OpenHdl));
421}
422
424{
425 short nRet = RET_OK;
426 bool bOK = false;
428 if ( m_xObj.is() )
429 {
430 try
431 {
432 if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED )
433 m_xObj->changeState( embed::EmbedStates::RUNNING );
434 xSet.set( m_xObj->getComponent(), uno::UNO_QUERY );
435 OUString aStr;
436 uno::Any aAny = xSet->getPropertyValue( "FrameURL" );
437 if ( aAny >>= aStr )
438 m_xEDURL->set_text( aStr );
439 aAny = xSet->getPropertyValue( "FrameName" );
440 if ( aAny >>= aStr )
441 m_xEDName->set_text(aStr);
442
443 sal_Int32 nSize = SIZE_NOT_SET;
444 aAny = xSet->getPropertyValue( "FrameMarginWidth" );
445 aAny >>= nSize;
446
447 if ( nSize == SIZE_NOT_SET )
448 {
449 m_xCBMarginWidthDefault->set_active(true);
450 m_xNMMarginWidth->set_text(OUString::number(DEFAULT_MARGIN_WIDTH));
451 m_xFTMarginWidth->set_sensitive(false);
452 m_xNMMarginWidth->set_sensitive(false);
453 }
454 else
455 m_xNMMarginWidth->set_text(OUString::number(nSize));
456
457 aAny = xSet->getPropertyValue( "FrameMarginHeight" );
458 aAny >>= nSize;
459
460 if ( nSize == SIZE_NOT_SET )
461 {
462 m_xCBMarginHeightDefault->set_active(true);
463 m_xNMMarginHeight->set_text(OUString::number(DEFAULT_MARGIN_HEIGHT));
464 m_xFTMarginHeight->set_sensitive(false);
465 m_xNMMarginHeight->set_sensitive(false);
466 }
467 else
468 m_xNMMarginHeight->set_text(OUString::number(nSize));
469
470 bool bScrollOn = false;
471 bool bScrollOff = false;
472 bool bScrollAuto = false;
473
474 bool bSet = false;
475 aAny = xSet->getPropertyValue( "FrameIsAutoScroll" );
476 aAny >>= bSet;
477 if ( !bSet )
478 {
479 aAny = xSet->getPropertyValue( "FrameIsScrollingMode" );
480 aAny >>= bSet;
481 bScrollOn = bSet;
482 bScrollOff = !bSet;
483 }
484 else
485 bScrollAuto = true;
486
487 m_xRBScrollingOn->set_sensitive(bScrollOn);
488 m_xRBScrollingOff->set_sensitive(bScrollOff);
489 m_xRBScrollingAuto->set_sensitive(bScrollAuto);
490
491 bSet = false;
492 aAny = xSet->getPropertyValue( "FrameIsAutoBorder" );
493 aAny >>= bSet;
494 if ( !bSet )
495 {
496 aAny = xSet->getPropertyValue( "FrameIsBorder" );
497 aAny >>= bSet;
498 m_xRBFrameBorderOn->set_active(bSet);
499 m_xRBFrameBorderOff->set_active(!bSet);
500 }
501
502 bOK = true;
503 }
504 catch ( uno::Exception& )
505 {
506 OSL_FAIL( "No IFrame!" );
507 }
508 }
509 else
510 {
511 DBG_ASSERT( m_xStorage.is(), "No storage!");
512 bOK = m_xStorage.is();
513 }
514
515 if (!bOK)
516 return RET_OK;
517
519 if ( nRet == RET_OK )
520 {
521 OUString aURL;
522 if (!m_xEDURL->get_text().isEmpty())
523 {
524 // URL can be a valid and absolute URL or a system file name
525 INetURLObject aObj;
526 aObj.SetSmartProtocol( INetProtocol::File );
527 if ( aObj.SetSmartURL( m_xEDURL->get_text() ) )
529 }
530
531 if ( !m_xObj.is() && !aURL.isEmpty() )
532 {
533 // create the object
534 OUString aName;
537 if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED )
538 m_xObj->changeState( embed::EmbedStates::RUNNING );
539 xSet.set( m_xObj->getComponent(), uno::UNO_QUERY );
540 }
541
542 if ( m_xObj.is() )
543 {
544 try
545 {
546 bool bIPActive = m_xObj->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE;
547 if ( bIPActive )
548 m_xObj->changeState( embed::EmbedStates::RUNNING );
549
550 OUString aName = m_xEDName->get_text();
551 ScrollingMode eScroll = ScrollingMode::No;
552 if (m_xRBScrollingOn->get_active())
553 eScroll = ScrollingMode::Yes;
554 if (m_xRBScrollingOff->get_active())
555 eScroll = ScrollingMode::No;
556 if (m_xRBScrollingAuto->get_active())
557 eScroll = ScrollingMode::Auto;
558
559 bool bHasBorder = m_xRBFrameBorderOn->get_active();
560
561 tools::Long lMarginWidth;
562 if (!m_xCBMarginWidthDefault->get_active())
563 lMarginWidth = static_cast<tools::Long>(m_xNMMarginWidth->get_text().toInt32());
564 else
565 lMarginWidth = SIZE_NOT_SET;
566
567 tools::Long lMarginHeight;
568 if (!m_xCBMarginHeightDefault->get_active())
569 lMarginHeight = static_cast<tools::Long>(m_xNMMarginHeight->get_text().toInt32());
570 else
571 lMarginHeight = SIZE_NOT_SET;
572
573 xSet->setPropertyValue( "FrameURL", Any( aURL ) );
574 xSet->setPropertyValue( "FrameName", Any( aName ) );
575
576 if ( eScroll == ScrollingMode::Auto )
577 xSet->setPropertyValue( "FrameIsAutoScroll", Any( true ) );
578 else
579 xSet->setPropertyValue( "FrameIsScrollingMode", Any( eScroll == ScrollingMode::Yes ) );
580
581 xSet->setPropertyValue( "FrameIsBorder", Any( bHasBorder ) );
582 xSet->setPropertyValue( "FrameMarginWidth", Any( sal_Int32( lMarginWidth ) ) );
583 xSet->setPropertyValue( "FrameMarginHeight", Any( sal_Int32( lMarginHeight ) ) );
584
585 if ( bIPActive )
586 m_xObj->changeState( embed::EmbedStates::INPLACE_ACTIVE );
587 }
588 catch ( uno::Exception& )
589 {
590 OSL_FAIL( "No IFrame!" );
591 }
592 }
593 }
594
595 return nRet;
596}
597
599{
600 weld::CheckButton& rCB = dynamic_cast<weld::CheckButton&>(rButton);
601 if (&rCB == m_xCBMarginWidthDefault.get())
602 {
603 if (rCB.get_active())
604 m_xNMMarginWidth->set_text(OUString::number(DEFAULT_MARGIN_WIDTH));
605 m_xFTMarginWidth->set_sensitive(!rCB.get_active());
606 m_xNMMarginWidth->set_sensitive(!rCB.get_active());
607 }
608
609 if (&rCB == m_xCBMarginHeightDefault.get())
610 {
611 if (rCB.get_active())
612 m_xNMMarginHeight->set_text(OUString::number(DEFAULT_MARGIN_HEIGHT));
613 m_xFTMarginHeight->set_sensitive(!rCB.get_active());
614 m_xNMMarginHeight->set_sensitive(!rCB.get_active());
615 }
616}
617
619{
620 // create the file dialog
621 sfx2::FileDialogHelper aFileDlg(
622 ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, OUString(),
623 SfxFilterFlags::NONE, SfxFilterFlags::NONE, m_xDialog.get());
624
625 // set the title
626 aFileDlg.SetTitle(CuiResId(RID_CUISTR_SELECT_FILE_IFRAME));
627
628 // show the dialog
629 if ( aFileDlg.Execute() == ERRCODE_NONE )
631}
632
633/* 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, const ILibreOfficeKitNotifier *pNotifier=nullptr)
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
comphelper::EmbeddedObjectContainer aCnt
Definition: insdlg.hxx:36
InsertObjectDialog_Impl(weld::Window *pParent, const OUString &rUIXMLDescription, const OUString &rID, css::uno::Reference< css::embed::XStorage > xStorage)
Definition: insdlg.cxx:74
virtual css::uno::Reference< css::io::XInputStream > GetIconIfIconified(OUString *pGraphicMediaType)
Definition: insdlg.cxx:69
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:423
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:376
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 SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
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:362
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