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