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