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