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 #ifndef INCLUDED_SVX_SOURCE_INC_DATANAVI_HXX 20 #define INCLUDED_SVX_SOURCE_INC_DATANAVI_HXX 21 22 #include <vcl/builder.hxx> 23 #include <vcl/fixed.hxx> 24 #include <vcl/layout.hxx> 25 #include <vcl/lstbox.hxx> 26 #include <vcl/menubtn.hxx> 27 #include <vcl/tabctrl.hxx> 28 #include <vcl/tabpage.hxx> 29 #include <vcl/toolbox.hxx> 30 #include <vcl/idle.hxx> 31 #include <vcl/weld.hxx> 32 #include <svtools/inettbc.hxx> 33 #include <vcl/treelistbox.hxx> 34 #include <sfx2/dockwin.hxx> 35 #include <sfx2/childwin.hxx> 36 #include <sfx2/ctrlitem.hxx> 37 #include <svx/dialmgr.hxx> 38 #include <svx/strings.hrc> 39 #include <svx/svxdllapi.h> 40 #include <rtl/ref.hxx> 41 #include <com/sun/star/beans/XPropertySet.hpp> 42 #include <com/sun/star/container/XContainer.hpp> 43 #include <com/sun/star/container/XNameContainer.hpp> 44 #include <com/sun/star/frame/XFrame.hpp> 45 #include <com/sun/star/xforms/XFormsUIHelper1.hpp> 46 #include <com/sun/star/xforms/XModel.hpp> 47 #include <com/sun/star/xforms/XSubmission.hpp> 48 #include <com/sun/star/xml/dom/XNode.hpp> 49 #include <com/sun/star/xml/dom/events/XEventTarget.hpp> 50 51 #include "datalistener.hxx" 52 53 #include <memory> 54 #include <vector> 55 56 class FmFormShell; 57 58 59 namespace svxform 60 { 61 62 63 enum DataGroupType 64 { 65 DGTUnknown = 0, 66 DGTInstance, 67 DGTSubmission, 68 DGTBinding 69 }; 70 71 enum DataItemType 72 { 73 DITNone = 0, 74 DITText, 75 DITAttribute, 76 DITElement, 77 DITBinding 78 }; 79 80 struct ItemNode; 81 class XFormsPage; 82 class DataNavigatorWindow; 83 class AddInstanceDialog; 84 85 class DataTreeListBox : public SvTreeListBox 86 { 87 private: 88 std::unique_ptr<VclBuilder> m_xBuilder; 89 VclPtr<PopupMenu> m_xMenu; 90 VclPtr<XFormsPage> m_pXFormsPage; 91 DataGroupType m_eGroup; 92 sal_uInt16 m_nAddId; 93 sal_uInt16 m_nAddElementId; 94 sal_uInt16 m_nAddAttributeId; 95 sal_uInt16 m_nEditId; 96 sal_uInt16 m_nRemoveId; 97 98 protected: 99 using SvTreeListBox::ExecuteDrop; 100 101 public: 102 DataTreeListBox( vcl::Window* pParent, WinBits nBits ); 103 virtual ~DataTreeListBox() override; 104 virtual void dispose() override; 105 106 virtual VclPtr<PopupMenu> CreateContextMenu() override; 107 virtual void ExecuteContextMenuAction( sal_uInt16 _nSelectedPopupEntry ) override; 108 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override; 109 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override; 110 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) override; 111 112 void SetGroup(DataGroupType _eGroup); 113 void SetXFormsPage(XFormsPage* _pPage); 114 void SetToolBoxItemIds(sal_uInt16 _nAddId, 115 sal_uInt16 _nAddElementId, 116 sal_uInt16 _nAddAttributeId, 117 sal_uInt16 _nEditId, 118 sal_uInt16 _nRemoveId); 119 void DeleteAndClear(); 120 void RemoveEntry( SvTreeListEntry const * _pEntry ); 121 }; 122 123 class ReplaceString 124 { 125 OUString m_sDoc_UI; 126 OUString m_sInstance_UI; 127 OUString m_sNone_UI; 128 129 static constexpr OUStringLiteral const m_sDoc_API = "all"; 130 static constexpr OUStringLiteral const m_sInstance_API = "instance"; 131 static constexpr OUStringLiteral const m_sNone_API = "none"; 132 133 ReplaceString( const ReplaceString& ) = delete; 134 135 public: ReplaceString()136 ReplaceString() 137 { 138 m_sDoc_UI = SvxResId(RID_STR_REPLACE_DOC); 139 m_sInstance_UI = SvxResId(RID_STR_REPLACE_INST); 140 m_sNone_UI = SvxResId(RID_STR_REPLACE_NONE); 141 } 142 143 /** convert submission replace string from API value to UI value. 144 Use 'none' as default. */ toUI(const OUString & rStr) const145 OUString const & toUI( const OUString& rStr ) const 146 { 147 if( rStr == m_sDoc_API ) 148 return m_sDoc_UI; 149 else if( rStr == m_sInstance_API ) 150 return m_sInstance_UI; 151 else 152 return m_sNone_UI; 153 } 154 155 /** convert submission replace string from UI to API. 156 Use 'none' as default. */ toAPI(const OUString & rStr) const157 OUString toAPI( const OUString& rStr ) const 158 { 159 if( rStr == m_sDoc_UI ) 160 return m_sDoc_API; 161 else if( rStr == m_sInstance_UI ) 162 return m_sInstance_API; 163 else 164 return m_sNone_API; 165 } 166 }; 167 168 class MethodString 169 { 170 OUString m_sPost_UI; 171 OUString m_sPut_UI; 172 OUString m_sGet_UI; 173 174 static constexpr OUStringLiteral m_sPost_API = "post"; 175 static constexpr OUStringLiteral m_sPut_API = "put"; 176 static constexpr OUStringLiteral m_sGet_API = "get"; 177 178 MethodString( const MethodString& ) = delete; 179 180 public: 181 MethodString()182 MethodString() 183 { 184 m_sPost_UI = SvxResId(RID_STR_METHOD_POST); 185 m_sPut_UI = SvxResId(RID_STR_METHOD_PUT); 186 m_sGet_UI = SvxResId(RID_STR_METHOD_GET); 187 } 188 189 /** convert from API to UI; put is default. */ toUI(const OUString & rStr) const190 OUString const & toUI( const OUString& rStr ) const 191 { 192 if( rStr == m_sGet_API ) 193 return m_sGet_UI; 194 else if( rStr == m_sPost_API ) 195 return m_sPost_UI; 196 else 197 return m_sPut_UI; 198 } 199 200 /** convert from UI to API; put is default */ toAPI(const OUString & rStr) const201 OUString toAPI( const OUString& rStr ) const 202 { 203 if( rStr == m_sGet_UI ) 204 return m_sGet_API; 205 else if( rStr == m_sPost_UI ) 206 return m_sPost_API; 207 else 208 return m_sPut_API; 209 } 210 }; 211 212 class XFormsPage : public TabPage 213 { 214 private: 215 MethodString const m_aMethodString; 216 ReplaceString const m_aReplaceString; 217 218 VclPtr<ToolBox> m_pToolBox; 219 VclPtr<DataTreeListBox> m_pItemList; 220 sal_uInt16 m_nAddId; 221 sal_uInt16 m_nAddElementId; 222 sal_uInt16 m_nAddAttributeId; 223 sal_uInt16 m_nEditId; 224 sal_uInt16 m_nRemoveId; 225 226 css::uno::Reference< css::xforms::XFormsUIHelper1 > 227 m_xUIHelper; 228 229 VclPtr<DataNavigatorWindow> m_pNaviWin; 230 bool m_bHasModel; 231 DataGroupType const m_eGroup; 232 // these strings are not valid on the Submission and Binding Page 233 // mb: furthermore these are properties of an instance, thus 234 // it would be much better to get/set them through the UIHelper 235 // interface. 236 OUString m_sInstanceName; 237 OUString m_sInstanceURL; 238 bool m_bLinkOnce; 239 240 DECL_LINK(TbxSelectHdl, ToolBox *, void); 241 DECL_LINK(ItemSelectHdl, SvTreeListBox*, void); 242 243 void AddChildren(SvTreeListEntry* _pParent, 244 const css::uno::Reference< css::xml::dom::XNode >& _xNode); 245 bool DoToolBoxAction( sal_uInt16 _nToolBoxID ); 246 SvTreeListEntry* AddEntry( std::unique_ptr<ItemNode> _pNewNode, bool _bIsElement ); 247 SvTreeListEntry* AddEntry( const css::uno::Reference< css::beans::XPropertySet >& _rPropSet ); 248 void EditEntry( const css::uno::Reference< css::beans::XPropertySet >& _rPropSet ); 249 bool RemoveEntry(); 250 251 protected: 252 virtual bool EventNotify( NotifyEvent& rNEvt ) override; 253 254 public: 255 XFormsPage( vcl::Window* pParent, DataNavigatorWindow* _pNaviWin, DataGroupType _eGroup ); 256 virtual ~XFormsPage() override; 257 virtual void dispose() override; 258 259 virtual void Resize() override; 260 HasModel() const261 bool HasModel() const { return m_bHasModel; } 262 OUString SetModel( const css::uno::Reference< css::xforms::XModel > & _xModel, sal_uInt16 _nPagePos ); 263 void ClearModel(); 264 OUString LoadInstance(const css::uno::Sequence< css::beans::PropertyValue >& _xPropSeq); 265 266 bool DoMenuAction( sal_uInt16 _nMenuID ); 267 void EnableMenuItems( Menu* _pMenu ); 268 GetInstanceName() const269 const OUString& GetInstanceName() const { return m_sInstanceName; } GetInstanceURL() const270 const OUString& GetInstanceURL() const { return m_sInstanceURL; } GetLinkOnce() const271 bool GetLinkOnce() const { return m_bLinkOnce; } SetInstanceName(const OUString & name)272 void SetInstanceName( const OUString &name ) { m_sInstanceName=name; } SetInstanceURL(const OUString & url)273 void SetInstanceURL( const OUString &url ) { m_sInstanceURL=url; } SetLinkOnce(bool bLinkOnce)274 void SetLinkOnce( bool bLinkOnce ) { m_bLinkOnce=bLinkOnce; } 275 276 css::uno::Reference<css::beans::XPropertySet> GetBindingForNode(const css::uno::Reference<css::xml::dom::XNode> & xNode)277 GetBindingForNode( const css::uno::Reference<css::xml::dom::XNode> &xNode ) { return m_xUIHelper->getBindingForNode(xNode,true); } GetServiceNameForNode(const css::uno::Reference<css::xml::dom::XNode> & xNode)278 OUString GetServiceNameForNode( const css::uno::Reference<css::xml::dom::XNode> &xNode ) { return m_xUIHelper->getDefaultServiceNameForNode(xNode); } 279 const css::uno::Reference< css::xforms::XFormsUIHelper1 >& GetXFormsHelper() const280 GetXFormsHelper() const { return m_xUIHelper; } 281 }; 282 283 class DataNavigatorWindow : public vcl::Window, public VclBuilderContainer 284 { 285 private: 286 VclPtr<ListBox> m_pModelsBox; 287 VclPtr<MenuButton> m_pModelBtn; 288 VclPtr<TabControl> m_pTabCtrl; 289 VclPtr<MenuButton> m_pInstanceBtn; 290 291 VclPtr<XFormsPage> m_pInstPage; 292 VclPtr<XFormsPage> m_pSubmissionPage; 293 VclPtr<XFormsPage> m_pBindingPage; 294 295 sal_Int32 m_nLastSelectedPos; 296 bool m_bShowDetails; 297 bool m_bIsNotifyDisabled; 298 std::vector< VclPtr<XFormsPage> > 299 m_aPageList; 300 std::vector< css::uno::Reference< css::container::XContainer > > 301 m_aContainerList; 302 std::vector< css::uno::Reference< css::xml::dom::events::XEventTarget > > 303 m_aEventTargetList; 304 Timer m_aUpdateTimer; 305 306 ::rtl::Reference < DataListener > 307 m_xDataListener; 308 css::uno::Reference< css::container::XNameContainer > 309 m_xDataContainer; 310 css::uno::Reference< css::frame::XFrame > 311 m_xFrame; 312 css::uno::Reference< css::frame::XModel > 313 m_xFrameModel; 314 315 DECL_LINK( ModelSelectListBoxHdl, ListBox&, void ); 316 DECL_LINK( MenuSelectHdl, MenuButton *, void ); 317 DECL_LINK( MenuActivateHdl, MenuButton *, void ); 318 DECL_LINK( ActivatePageHdl, TabControl*, void); 319 DECL_LINK( UpdateHdl, Timer *, void); 320 void ModelSelectHdl(ListBox const *); 321 XFormsPage* GetCurrentPage( sal_uInt16& rCurId ); 322 void LoadModels(); 323 void SetPageModel(); 324 void ClearAllPageModels( bool bClearPages ); 325 void InitPages(); 326 void CreateInstancePage( const css::uno::Sequence< css::beans::PropertyValue >& _xPropSeq ); 327 bool HasFirstInstancePage() const; 328 sal_uInt16 GetNewPageId() const; 329 330 bool IsAdditionalPage(sal_uInt16 nPageId) const; 331 332 protected: 333 virtual void Resize() override; 334 virtual Size GetOptimalSize() const override; 335 336 public: 337 DataNavigatorWindow( vcl::Window* pParent, SfxBindings const * pBindings ); 338 virtual ~DataNavigatorWindow() override; 339 virtual void dispose() override; 340 341 static void SetDocModified(); 342 void NotifyChanges( bool _bLoadAll = false ); 343 void AddContainerBroadcaster( const css::uno::Reference< css::container::XContainer > & xContainer ); 344 void AddEventBroadcaster( const css::uno::Reference< css::xml::dom::events::XEventTarget >& xTarget ); 345 void RemoveBroadcaster(); 346 IsShowDetails() const347 bool IsShowDetails() const { return m_bShowDetails; } DisableNotify(bool _bDisable)348 void DisableNotify( bool _bDisable ) { m_bIsNotifyDisabled = _bDisable; } 349 }; 350 351 class DataNavigator : public SfxDockingWindow, public SfxControllerItem 352 { 353 private: 354 VclPtr<DataNavigatorWindow> m_aDataWin; 355 356 protected: 357 virtual void Resize() override; 358 virtual Size CalcDockingSize( SfxChildAlignment ) override; 359 virtual SfxChildAlignment CheckAlignment( SfxChildAlignment, SfxChildAlignment ) override; 360 361 public: 362 DataNavigator( SfxBindings* pBindings, SfxChildWindow* pMgr, vcl::Window* pParent ); 363 virtual ~DataNavigator() override; 364 virtual void dispose() override; 365 366 using Window::Update; 367 using SfxDockingWindow::StateChanged; 368 369 void StateChanged( sal_uInt16 nSID, SfxItemState eState, 370 const SfxPoolItem* pState ) override; 371 }; 372 373 class SVX_DLLPUBLIC DataNavigatorManager : public SfxChildWindow 374 { 375 public: 376 SVX_DLLPRIVATE DataNavigatorManager( vcl::Window* pParent, sal_uInt16 nId, 377 SfxBindings* pBindings, SfxChildWinInfo* pInfo ); 378 SFX_DECL_CHILDWINDOW( DataNavigatorManager ); 379 }; 380 381 class AddDataItemDialog : public weld::GenericDialogController 382 { 383 private: 384 css::uno::Reference< css::xforms::XFormsUIHelper1 > 385 m_xUIHelper; 386 css::uno::Reference< css::beans::XPropertySet > 387 m_xBinding; 388 css::uno::Reference< css::beans::XPropertySet > 389 m_xTempBinding; 390 391 ItemNode* m_pItemNode; 392 DataItemType m_eItemType; 393 OUString const m_sFL_Element; 394 OUString const m_sFL_Attribute; 395 OUString const m_sFL_Binding; 396 OUString const m_sFT_BindingExp; 397 398 std::unique_ptr<weld::Frame> m_xItemFrame; 399 std::unique_ptr<weld::Label> m_xNameFT; 400 std::unique_ptr<weld::Entry> m_xNameED; 401 std::unique_ptr<weld::Label> m_xDefaultFT; 402 std::unique_ptr<weld::Entry> m_xDefaultED; 403 std::unique_ptr<weld::Button> m_xDefaultBtn; 404 std::unique_ptr<weld::Widget> m_xSettingsFrame; 405 std::unique_ptr<weld::Label> m_xDataTypeFT; 406 std::unique_ptr<weld::ComboBox> m_xDataTypeLB; 407 std::unique_ptr<weld::CheckButton> m_xRequiredCB; 408 std::unique_ptr<weld::Button> m_xRequiredBtn; 409 std::unique_ptr<weld::CheckButton> m_xRelevantCB; 410 std::unique_ptr<weld::Button> m_xRelevantBtn; 411 std::unique_ptr<weld::CheckButton> m_xConstraintCB; 412 std::unique_ptr<weld::Button> m_xConstraintBtn; 413 std::unique_ptr<weld::CheckButton> m_xReadonlyCB; 414 std::unique_ptr<weld::Button> m_xReadonlyBtn; 415 std::unique_ptr<weld::CheckButton> m_xCalculateCB; 416 std::unique_ptr<weld::Button> m_xCalculateBtn; 417 std::unique_ptr<weld::Button> m_xOKBtn; 418 419 void Check(const weld::ToggleButton* pBox); 420 DECL_LINK(CheckHdl, weld::ToggleButton&, void); 421 DECL_LINK(ConditionHdl, weld::Button&, void); 422 DECL_LINK(OKHdl, weld::Button&, void); 423 424 void InitDialog(); 425 void InitFromNode(); 426 void InitDataTypeBox(); 427 428 public: 429 AddDataItemDialog( 430 weld::Window* pParent, ItemNode* _pNode, 431 const css::uno::Reference< css::xforms::XFormsUIHelper1 >& _rUIHelper ); 432 virtual ~AddDataItemDialog() override; 433 434 void InitText( DataItemType _eType ); 435 }; 436 437 class AddConditionDialog : public weld::GenericDialogController 438 { 439 private: 440 Idle m_aResultIdle; 441 OUString const m_sPropertyName; 442 443 css::uno::Reference< css::xforms::XFormsUIHelper1 > 444 m_xUIHelper; 445 css::uno::Reference< css::beans::XPropertySet > 446 m_xBinding; 447 448 std::unique_ptr<weld::TextView> m_xConditionED; 449 std::unique_ptr<weld::TextView> m_xResultWin; 450 std::unique_ptr<weld::Button> m_xEditNamespacesBtn; 451 std::unique_ptr<weld::Button> m_xOKBtn; 452 453 DECL_LINK(ModifyHdl, weld::TextView&, void); 454 DECL_LINK(ResultHdl, Timer *, void); 455 DECL_LINK(EditHdl, weld::Button&, void); 456 DECL_LINK(OKHdl, weld::Button&, void); 457 458 public: 459 AddConditionDialog(weld::Window* pParent, 460 const OUString& _rPropertyName, const css::uno::Reference< css::beans::XPropertySet >& _rBinding); 461 virtual ~AddConditionDialog() override; 462 GetUIHelper() const463 const css::uno::Reference< css::xforms::XFormsUIHelper1 >& GetUIHelper() const { return m_xUIHelper; } GetCondition() const464 OUString GetCondition() const { return m_xConditionED->get_text(); } SetCondition(const OUString & _rCondition)465 void SetCondition(const OUString& _rCondition) 466 { 467 m_xConditionED->set_text(_rCondition); 468 m_aResultIdle.Start(); 469 } 470 }; 471 472 class NamespaceItemDialog : public weld::GenericDialogController 473 { 474 private: 475 AddConditionDialog* m_pConditionDlg; 476 std::vector< OUString > m_aRemovedList; 477 478 css::uno::Reference< css::container::XNameContainer >& 479 m_rNamespaces; 480 481 std::unique_ptr<weld::TreeView> m_xNamespacesList; 482 std::unique_ptr<weld::Button> m_xAddNamespaceBtn; 483 std::unique_ptr<weld::Button> m_xEditNamespaceBtn; 484 std::unique_ptr<weld::Button> m_xDeleteNamespaceBtn; 485 std::unique_ptr<weld::Button> m_xOKBtn; 486 487 DECL_LINK(SelectHdl, weld::TreeView&, void); 488 DECL_LINK(ClickHdl, weld::Button&, void); 489 DECL_LINK(OKHdl, weld::Button&, void); 490 491 void LoadNamespaces(); 492 493 public: 494 NamespaceItemDialog(AddConditionDialog* pParent, css::uno::Reference< css::container::XNameContainer >& _rContainer); 495 virtual ~NamespaceItemDialog() override; 496 }; 497 498 class ManageNamespaceDialog : public weld::GenericDialogController 499 { 500 private: 501 AddConditionDialog* m_pConditionDlg; 502 503 std::unique_ptr<weld::Entry> m_xPrefixED; 504 std::unique_ptr<weld::Entry> m_xUrlED; 505 std::unique_ptr<weld::Button> m_xOKBtn; 506 std::unique_ptr<weld::Label> m_xAltTitle; 507 508 DECL_LINK(OKHdl, weld::Button&, void); 509 510 public: 511 ManageNamespaceDialog(weld::Window* pParent, AddConditionDialog* _pCondDlg, bool bIsEdit); 512 virtual ~ManageNamespaceDialog() override; 513 SetNamespace(const OUString & _rPrefix,const OUString & _rURL)514 void SetNamespace(const OUString& _rPrefix, const OUString& _rURL) 515 { 516 m_xPrefixED->set_text(_rPrefix); 517 m_xUrlED->set_text(_rURL); 518 } GetPrefix() const519 OUString GetPrefix() const { return m_xPrefixED->get_text(); } GetURL() const520 OUString GetURL() const { return m_xUrlED->get_text(); } 521 }; 522 523 class AddSubmissionDialog : public weld::GenericDialogController 524 { 525 private: 526 MethodString const m_aMethodString; 527 ReplaceString const m_aReplaceString; 528 529 ItemNode* const m_pItemNode; 530 531 css::uno::Reference< css::xforms::XFormsUIHelper1 > 532 m_xUIHelper; 533 css::uno::Reference< css::xforms::XSubmission > 534 m_xNewSubmission; 535 css::uno::Reference< css::beans::XPropertySet > 536 m_xSubmission; 537 css::uno::Reference< css::beans::XPropertySet > 538 m_xTempBinding; 539 css::uno::Reference< css::beans::XPropertySet > 540 m_xCreatedBinding; 541 542 std::unique_ptr<weld::Entry> m_xNameED; 543 std::unique_ptr<weld::Entry> m_xActionED; 544 std::unique_ptr<weld::ComboBox> m_xMethodLB; 545 std::unique_ptr<weld::Entry> m_xRefED; 546 std::unique_ptr<weld::Button> m_xRefBtn; 547 std::unique_ptr<weld::ComboBox> m_xBindLB; 548 std::unique_ptr<weld::ComboBox> m_xReplaceLB; 549 std::unique_ptr<weld::Button> m_xOKBtn; 550 551 DECL_LINK(RefHdl, weld::Button&, void); 552 DECL_LINK(OKHdl, weld::Button&, void); 553 554 void FillAllBoxes(); 555 556 public: 557 AddSubmissionDialog(weld::Window* pParent, ItemNode* pNode, 558 const css::uno::Reference< css::xforms::XFormsUIHelper1 >& rUIHelper); 559 virtual ~AddSubmissionDialog() override; 560 GetNewSubmission() const561 const css::uno::Reference< css::xforms::XSubmission >& GetNewSubmission() const { return m_xNewSubmission; } 562 }; 563 564 class AddModelDialog : public weld::GenericDialogController 565 { 566 private: 567 std::unique_ptr<weld::Entry> m_xNameED; 568 std::unique_ptr<weld::CheckButton> m_xModifyCB; 569 std::unique_ptr<weld::Label> m_xAltTitle; 570 571 public: 572 AddModelDialog(weld::Window* pParent, bool _bEdit); 573 virtual ~AddModelDialog() override; 574 GetName() const575 OUString GetName() const { return m_xNameED->get_text(); } SetName(const OUString & _rName)576 void SetName( const OUString& _rName ) { m_xNameED->set_text( _rName );} 577 GetModifyDoc() const578 bool GetModifyDoc() const { return m_xModifyCB->get_active(); } SetModifyDoc(const bool bModify)579 void SetModifyDoc( const bool bModify ) { m_xModifyCB->set_active(bModify); } 580 }; 581 582 class AddInstanceDialog : public weld::GenericDialogController 583 { 584 private: 585 OUString m_sAllFilterName; 586 587 std::unique_ptr<weld::Entry> m_xNameED; 588 std::unique_ptr<weld::Label> m_xURLFT; 589 std::unique_ptr<URLBox> m_xURLED; 590 std::unique_ptr<weld::Button> m_xFilePickerBtn; 591 std::unique_ptr<weld::CheckButton> m_xLinkInstanceCB; 592 std::unique_ptr<weld::Label> m_xAltTitle; 593 594 DECL_LINK(FilePickerHdl, weld::Button&, void); 595 596 public: 597 AddInstanceDialog(weld::Window* pParent, bool _bEdit); 598 virtual ~AddInstanceDialog() override; 599 GetName() const600 OUString GetName() const { return m_xNameED->get_text(); } SetName(const OUString & rName)601 void SetName( const OUString& rName ) { m_xNameED->set_text( rName );} GetURL() const602 OUString GetURL() const { return m_xURLED->get_active_text(); } SetURL(const OUString & rURL)603 void SetURL( const OUString& rURL ) { m_xURLED->set_entry_text( rURL );} IsLinkInstance() const604 bool IsLinkInstance() const { return m_xLinkInstanceCB->get_active(); } SetLinkInstance(bool bLink)605 void SetLinkInstance( bool bLink ) { m_xLinkInstanceCB->set_active(bLink); } 606 }; 607 608 class LinkedInstanceWarningBox : public weld::MessageDialogController 609 { 610 public: 611 LinkedInstanceWarningBox(weld::Widget* pParent); 612 }; 613 } 614 615 616 #endif // INCLUDED_SVX_SOURCE_INC_DATANAVI_HXX 617 618 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 619