1*3334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*3334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*3334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*3334a7e6SAndrew Rist * distributed with this work for additional information 6*3334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*3334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*3334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 9*3334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*3334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*3334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*3334a7e6SAndrew Rist * software distributed under the License is distributed on an 15*3334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 17*3334a7e6SAndrew Rist * specific language governing permissions and limitations 18*3334a7e6SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*3334a7e6SAndrew Rist *************************************************************/ 21*3334a7e6SAndrew Rist 22*3334a7e6SAndrew Rist 23cdf0e10cSrcweir #ifndef _SVX_DATANAVI_HXX 24cdf0e10cSrcweir #define _SVX_DATANAVI_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <vcl/dialog.hxx> 27cdf0e10cSrcweir #include <vcl/fixed.hxx> 28cdf0e10cSrcweir #include <vcl/lstbox.hxx> 29cdf0e10cSrcweir #include <vcl/menubtn.hxx> 30cdf0e10cSrcweir #include <vcl/msgbox.hxx> 31cdf0e10cSrcweir #include <vcl/tabctrl.hxx> 32cdf0e10cSrcweir #include <vcl/tabpage.hxx> 33cdf0e10cSrcweir #include <vcl/toolbox.hxx> 34cdf0e10cSrcweir #include <svtools/inettbc.hxx> 35cdf0e10cSrcweir #include <svtools/svmedit.hxx> 36cdf0e10cSrcweir #include <svtools/svtreebx.hxx> 37cdf0e10cSrcweir #include <sfx2/dockwin.hxx> 38cdf0e10cSrcweir #include <sfx2/ctrlitem.hxx> 39cdf0e10cSrcweir #include <svx/simptabl.hxx> 40cdf0e10cSrcweir #include <rtl/ref.hxx> 41cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 42cdf0e10cSrcweir #include <com/sun/star/container/XContainer.hpp> 43cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp> 44cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp> 45cdf0e10cSrcweir #include <com/sun/star/xforms/XFormsUIHelper1.hpp> 46cdf0e10cSrcweir #include <com/sun/star/xforms/XModel.hpp> 47cdf0e10cSrcweir #include <com/sun/star/xforms/XSubmission.hpp> 48cdf0e10cSrcweir #include <com/sun/star/xml/dom/XNode.hpp> 49cdf0e10cSrcweir #include <com/sun/star/xml/dom/events/XEventTarget.hpp> 50cdf0e10cSrcweir 51cdf0e10cSrcweir #include "datalistener.hxx" 52cdf0e10cSrcweir #include <vector> 53cdf0e10cSrcweir 54cdf0e10cSrcweir // forward --------------------------------------------------------------- 55cdf0e10cSrcweir 56cdf0e10cSrcweir class FmFormShell; 57cdf0e10cSrcweir 58cdf0e10cSrcweir //======================================================================== 59cdf0e10cSrcweir //............................................................................ 60cdf0e10cSrcweir namespace svxform 61cdf0e10cSrcweir { 62cdf0e10cSrcweir //............................................................................ 63cdf0e10cSrcweir 64cdf0e10cSrcweir enum DataGroupType 65cdf0e10cSrcweir { 66cdf0e10cSrcweir DGTUnknown = 0, 67cdf0e10cSrcweir DGTInstance, 68cdf0e10cSrcweir DGTSubmission, 69cdf0e10cSrcweir DGTBinding 70cdf0e10cSrcweir }; 71cdf0e10cSrcweir 72cdf0e10cSrcweir enum DataItemType 73cdf0e10cSrcweir { 74cdf0e10cSrcweir DITNone = 0, 75cdf0e10cSrcweir DITText, 76cdf0e10cSrcweir DITAttribute, 77cdf0e10cSrcweir DITElement, 78cdf0e10cSrcweir DITBinding 79cdf0e10cSrcweir }; 80cdf0e10cSrcweir 81cdf0e10cSrcweir struct ItemNode; 82cdf0e10cSrcweir class XFormsPage; 83cdf0e10cSrcweir class DataNavigatorWindow; 84cdf0e10cSrcweir class AddInstanceDialog; 85cdf0e10cSrcweir 86cdf0e10cSrcweir typedef ::com::sun::star::uno::Reference< 87cdf0e10cSrcweir ::com::sun::star::xforms::XFormsUIHelper1 > XFormsUIHelper1_ref; 88cdf0e10cSrcweir typedef ::com::sun::star::uno::Reference< 89cdf0e10cSrcweir ::com::sun::star::xml::dom::XNode > XNode_ref; 90cdf0e10cSrcweir typedef ::com::sun::star::uno::Reference< 91cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > XPropertySet_ref; 92cdf0e10cSrcweir typedef ::com::sun::star::uno::Reference< 93cdf0e10cSrcweir ::com::sun::star::xforms::XModel > XModel_ref; 94cdf0e10cSrcweir typedef ::com::sun::star::uno::Reference< 95cdf0e10cSrcweir ::com::sun::star::container::XContainer > XContainer_ref; 96cdf0e10cSrcweir typedef ::com::sun::star::uno::Reference< 97cdf0e10cSrcweir ::com::sun::star::container::XNameContainer > XNameContainer_ref; 98cdf0e10cSrcweir typedef ::com::sun::star::uno::Reference< 99cdf0e10cSrcweir ::com::sun::star::frame::XFrame > XFrame_ref; 100cdf0e10cSrcweir typedef ::com::sun::star::uno::Reference< 101cdf0e10cSrcweir ::com::sun::star::frame::XModel > XFrameModel_ref; 102cdf0e10cSrcweir typedef ::com::sun::star::uno::Reference< 103cdf0e10cSrcweir ::com::sun::star::xml::dom::events::XEventTarget > XEventTarget_ref; 104cdf0e10cSrcweir typedef ::com::sun::star::uno::Reference< 105cdf0e10cSrcweir ::com::sun::star::xforms::XSubmission > XSubmission_ref; 106cdf0e10cSrcweir 107cdf0e10cSrcweir typedef ::com::sun::star::uno::Sequence< 108cdf0e10cSrcweir ::com::sun::star::beans::PropertyValue > PropertyValue_seq; 109cdf0e10cSrcweir 110cdf0e10cSrcweir typedef std::vector< XContainer_ref > ContainerList; 111cdf0e10cSrcweir typedef std::vector< XEventTarget_ref > EventTargetList; 112cdf0e10cSrcweir 113cdf0e10cSrcweir //======================================================================== 114cdf0e10cSrcweir class DataTreeListBox : public SvTreeListBox 115cdf0e10cSrcweir { 116cdf0e10cSrcweir private: 117cdf0e10cSrcweir XFormsPage* m_pXFormsPage; 118cdf0e10cSrcweir DataGroupType m_eGroup; 119cdf0e10cSrcweir 120cdf0e10cSrcweir protected: 121cdf0e10cSrcweir using SvTreeListBox::ExecuteDrop; 122cdf0e10cSrcweir 123cdf0e10cSrcweir public: 124cdf0e10cSrcweir DataTreeListBox( XFormsPage* pPage, DataGroupType _eGroup, const ResId& rResId ); 125cdf0e10cSrcweir ~DataTreeListBox(); 126cdf0e10cSrcweir 127cdf0e10cSrcweir virtual PopupMenu* CreateContextMenu( void ); 128cdf0e10cSrcweir virtual void ExcecuteContextMenuAction( sal_uInt16 _nSelectedPopupEntry ); 129cdf0e10cSrcweir virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); 130cdf0e10cSrcweir virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); 131cdf0e10cSrcweir virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); 132cdf0e10cSrcweir 133cdf0e10cSrcweir void DeleteAndClear(); 134cdf0e10cSrcweir void RemoveEntry( SvLBoxEntry* _pEntry ); 135cdf0e10cSrcweir }; 136cdf0e10cSrcweir 137cdf0e10cSrcweir //======================================================================== 138cdf0e10cSrcweir class XFormsPage : public TabPage 139cdf0e10cSrcweir { 140cdf0e10cSrcweir private: 141cdf0e10cSrcweir ToolBox m_aToolBox; 142cdf0e10cSrcweir DataTreeListBox m_aItemList; 143cdf0e10cSrcweir 144cdf0e10cSrcweir XFormsUIHelper1_ref m_xUIHelper; 145cdf0e10cSrcweir 146cdf0e10cSrcweir DataNavigatorWindow* m_pNaviWin; 147cdf0e10cSrcweir bool m_bHasModel; 148cdf0e10cSrcweir DataGroupType m_eGroup; 149cdf0e10cSrcweir ImageList m_TbxImageList; 150cdf0e10cSrcweir ImageList m_TbxHCImageList; 151cdf0e10cSrcweir // these strings are not valid on the Submission and Binding Page 152cdf0e10cSrcweir // mb: furthermore these are properties of an instance, thus 153cdf0e10cSrcweir // it would be much better to get/set them through the UIHelper 154cdf0e10cSrcweir // interface. 155cdf0e10cSrcweir String m_sInstanceName; 156cdf0e10cSrcweir String m_sInstanceURL; 157cdf0e10cSrcweir bool m_bLinkOnce; 158cdf0e10cSrcweir 159cdf0e10cSrcweir DECL_LINK( TbxSelectHdl, ToolBox * ); 160cdf0e10cSrcweir DECL_LINK( ItemSelectHdl, DataTreeListBox * ); 161cdf0e10cSrcweir 162cdf0e10cSrcweir void AddChildren( SvLBoxEntry* _pParent, 163cdf0e10cSrcweir const ImageList& _rImgLst, 164cdf0e10cSrcweir const XNode_ref& _xNode ); 165cdf0e10cSrcweir bool DoToolBoxAction( sal_uInt16 _nToolBoxID ); 166cdf0e10cSrcweir SvLBoxEntry* AddEntry( ItemNode* _pNewNode, bool _bIsElement ); 167cdf0e10cSrcweir SvLBoxEntry* AddEntry( const XPropertySet_ref& _rPropSet ); 168cdf0e10cSrcweir void EditEntry( const XPropertySet_ref& _rPropSet ); 169cdf0e10cSrcweir bool RemoveEntry(); 170cdf0e10cSrcweir 171cdf0e10cSrcweir protected: 172cdf0e10cSrcweir virtual long Notify( NotifyEvent& rNEvt ); 173cdf0e10cSrcweir 174cdf0e10cSrcweir public: 175cdf0e10cSrcweir XFormsPage( Window* pParent, DataNavigatorWindow* _pNaviWin, DataGroupType _eGroup ); 176cdf0e10cSrcweir ~XFormsPage(); 177cdf0e10cSrcweir 178cdf0e10cSrcweir virtual void Resize(); 179cdf0e10cSrcweir HasModel() const180cdf0e10cSrcweir inline bool HasModel() const { return m_bHasModel; } 181cdf0e10cSrcweir String SetModel( const XModel_ref& _xModel, sal_uInt16 _nPagePos ); 182cdf0e10cSrcweir void ClearModel(); 183cdf0e10cSrcweir String LoadInstance( const PropertyValue_seq& _xPropSeq, 184cdf0e10cSrcweir const ImageList& _rImgLst ); 185cdf0e10cSrcweir 186cdf0e10cSrcweir bool DoMenuAction( sal_uInt16 _nMenuID ); 187cdf0e10cSrcweir void EnableMenuItems( Menu* _pMenu ); 188cdf0e10cSrcweir GetSelectedItem() const189cdf0e10cSrcweir inline SvLBoxEntry* GetSelectedItem() const { return m_aItemList.FirstSelected(); } GetInstanceName() const190cdf0e10cSrcweir inline const String& GetInstanceName() const { return m_sInstanceName; } GetInstanceURL() const191cdf0e10cSrcweir inline const String& GetInstanceURL() const { return m_sInstanceURL; } GetLinkOnce() const192cdf0e10cSrcweir inline bool GetLinkOnce() const { return m_bLinkOnce; } SetInstanceName(const String & name)193cdf0e10cSrcweir inline void SetInstanceName( const String &name ) { m_sInstanceName=name; } SetInstanceURL(const String & url)194cdf0e10cSrcweir inline void SetInstanceURL( const String &url ) { m_sInstanceURL=url; } SetLinkOnce(bool bLinkOnce)195cdf0e10cSrcweir inline void SetLinkOnce( bool bLinkOnce ) { m_bLinkOnce=bLinkOnce; } 196cdf0e10cSrcweir 197cdf0e10cSrcweir typedef com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> XPropertySet_t; 198cdf0e10cSrcweir typedef com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode> XNode_t; 199cdf0e10cSrcweir GetBindingForNode(const XNode_t & xNode)200cdf0e10cSrcweir inline XPropertySet_t GetBindingForNode( const XNode_t &xNode ) { return m_xUIHelper->getBindingForNode(xNode,true); } GetServiceNameForNode(const XNode_t & xNode)201cdf0e10cSrcweir inline String GetServiceNameForNode( const XNode_t &xNode ) { return m_xUIHelper->getDefaultServiceNameForNode(xNode); } GetXFormsHelper(void) const202cdf0e10cSrcweir inline XFormsUIHelper1_ref GetXFormsHelper( void ) const { return m_xUIHelper; } 203cdf0e10cSrcweir }; 204cdf0e10cSrcweir 205cdf0e10cSrcweir //======================================================================== 206cdf0e10cSrcweir 207cdf0e10cSrcweir typedef std::vector< XFormsPage* > PageList; 208cdf0e10cSrcweir typedef ::rtl::Reference < DataListener > DataListener_ref; 209cdf0e10cSrcweir 210cdf0e10cSrcweir class DataNavigatorWindow : public Window 211cdf0e10cSrcweir { 212cdf0e10cSrcweir private: 213cdf0e10cSrcweir 214cdf0e10cSrcweir ListBox m_aModelsBox; 215cdf0e10cSrcweir MenuButton m_aModelBtn; 216cdf0e10cSrcweir TabControl m_aTabCtrl; 217cdf0e10cSrcweir MenuButton m_aInstanceBtn; 218cdf0e10cSrcweir 219cdf0e10cSrcweir XFormsPage* m_pInstPage; 220cdf0e10cSrcweir XFormsPage* m_pSubmissionPage; 221cdf0e10cSrcweir XFormsPage* m_pBindingPage; 222cdf0e10cSrcweir 223cdf0e10cSrcweir long m_nMinWidth; 224cdf0e10cSrcweir long m_nMinHeight; 225cdf0e10cSrcweir long m_nBorderHeight; 226cdf0e10cSrcweir sal_uInt16 m_nLastSelectedPos; 227cdf0e10cSrcweir bool m_bShowDetails; 228cdf0e10cSrcweir bool m_bIsNotifyDisabled; 229cdf0e10cSrcweir Size m_a2Size; 230cdf0e10cSrcweir Size m_a3Size; 231cdf0e10cSrcweir ImageList m_aItemImageList; 232cdf0e10cSrcweir ImageList m_aItemHCImageList; 233cdf0e10cSrcweir PageList m_aPageList; 234cdf0e10cSrcweir ContainerList m_aContainerList; 235cdf0e10cSrcweir EventTargetList m_aEventTargetList; 236cdf0e10cSrcweir Timer m_aUpdateTimer; 237cdf0e10cSrcweir 238cdf0e10cSrcweir DataListener_ref m_xDataListener; 239cdf0e10cSrcweir XNameContainer_ref m_xDataContainer; 240cdf0e10cSrcweir XFrame_ref m_xFrame; 241cdf0e10cSrcweir XFrameModel_ref m_xFrameModel; 242cdf0e10cSrcweir 243cdf0e10cSrcweir DECL_LINK( ModelSelectHdl, ListBox * ); 244cdf0e10cSrcweir DECL_LINK( MenuSelectHdl, MenuButton * ); 245cdf0e10cSrcweir DECL_LINK( MenuActivateHdl, MenuButton * ); 246cdf0e10cSrcweir DECL_LINK( ActivatePageHdl, TabControl* ); 247cdf0e10cSrcweir DECL_LINK( UpdateHdl, Timer* ); 248cdf0e10cSrcweir 249cdf0e10cSrcweir XFormsPage* GetCurrentPage( sal_uInt16& rCurId ); 250cdf0e10cSrcweir void LoadModels(); 251cdf0e10cSrcweir void SetPageModel(); 252cdf0e10cSrcweir void ClearAllPageModels( bool bClearPages ); 253cdf0e10cSrcweir void InitPages(); 254cdf0e10cSrcweir void CreateInstancePage( const PropertyValue_seq& _xPropSeq ); 255cdf0e10cSrcweir bool HasFirstInstancePage() const; 256cdf0e10cSrcweir sal_uInt16 GetNewPageId() const; 257cdf0e10cSrcweir 258cdf0e10cSrcweir protected: 259cdf0e10cSrcweir virtual void Resize(); 260cdf0e10cSrcweir 261cdf0e10cSrcweir public: 262cdf0e10cSrcweir DataNavigatorWindow( Window* pParent, SfxBindings* pBindings ); 263cdf0e10cSrcweir ~DataNavigatorWindow(); 264cdf0e10cSrcweir 265cdf0e10cSrcweir void SetDocModified(); 266cdf0e10cSrcweir void NotifyChanges( bool _bLoadAll = false ); 267cdf0e10cSrcweir void AddContainerBroadcaster( const XContainer_ref& xContainer ); 268cdf0e10cSrcweir void AddEventBroadcaster( const XEventTarget_ref& xTarget ); 269cdf0e10cSrcweir void RemoveBroadcaster(); 270cdf0e10cSrcweir GetItemImageList() const271cdf0e10cSrcweir inline const ImageList& GetItemImageList() const { return m_aItemImageList; } GetItemHCImageList() const272cdf0e10cSrcweir inline const ImageList& GetItemHCImageList() const { return m_aItemHCImageList; } IsShowDetails() const273cdf0e10cSrcweir inline bool IsShowDetails() const { return m_bShowDetails; } DisableNotify(bool _bDisable)274cdf0e10cSrcweir inline void DisableNotify( bool _bDisable ) { m_bIsNotifyDisabled = _bDisable; } 275cdf0e10cSrcweir }; 276cdf0e10cSrcweir 277cdf0e10cSrcweir //======================================================================== 278cdf0e10cSrcweir class DataNavigator : public SfxDockingWindow, public SfxControllerItem 279cdf0e10cSrcweir { 280cdf0e10cSrcweir private: 281cdf0e10cSrcweir DataNavigatorWindow m_aDataWin; 282cdf0e10cSrcweir 283cdf0e10cSrcweir protected: 284cdf0e10cSrcweir virtual void Resize(); 285cdf0e10cSrcweir virtual sal_Bool Close(); 286cdf0e10cSrcweir virtual void GetFocus(); 287cdf0e10cSrcweir virtual Size CalcDockingSize( SfxChildAlignment ); 288cdf0e10cSrcweir virtual SfxChildAlignment CheckAlignment( SfxChildAlignment, SfxChildAlignment ); 289cdf0e10cSrcweir 290cdf0e10cSrcweir public: 291cdf0e10cSrcweir DataNavigator( SfxBindings* pBindings, SfxChildWindow* pMgr, Window* pParent ); 292cdf0e10cSrcweir virtual ~DataNavigator(); 293cdf0e10cSrcweir 294cdf0e10cSrcweir using Window::Update; 295cdf0e10cSrcweir using SfxDockingWindow::StateChanged; 296cdf0e10cSrcweir 297cdf0e10cSrcweir void Update( FmFormShell* pFormShell ); 298cdf0e10cSrcweir void StateChanged( sal_uInt16 nSID, SfxItemState eState, 299cdf0e10cSrcweir const SfxPoolItem* pState ); 300cdf0e10cSrcweir }; 301cdf0e10cSrcweir 302cdf0e10cSrcweir //======================================================================== 303cdf0e10cSrcweir class SVX_DLLPUBLIC DataNavigatorManager : public SfxChildWindow 304cdf0e10cSrcweir { 305cdf0e10cSrcweir public: 306cdf0e10cSrcweir SVX_DLLPRIVATE DataNavigatorManager( Window* pParent, sal_uInt16 nId, 307cdf0e10cSrcweir SfxBindings* pBindings, SfxChildWinInfo* pInfo ); 308cdf0e10cSrcweir SFX_DECL_CHILDWINDOW( DataNavigatorManager ); 309cdf0e10cSrcweir }; 310cdf0e10cSrcweir 311cdf0e10cSrcweir //======================================================================== 312cdf0e10cSrcweir class AddDataItemDialog : public ModalDialog 313cdf0e10cSrcweir { 314cdf0e10cSrcweir private: 315cdf0e10cSrcweir 316cdf0e10cSrcweir FixedLine m_aItemFL; 317cdf0e10cSrcweir FixedText m_aNameFT; 318cdf0e10cSrcweir Edit m_aNameED; 319cdf0e10cSrcweir FixedText m_aDefaultFT; 320cdf0e10cSrcweir Edit m_aDefaultED; 321cdf0e10cSrcweir PushButton m_aDefaultBtn; 322cdf0e10cSrcweir 323cdf0e10cSrcweir FixedLine m_aSettingsFL; 324cdf0e10cSrcweir FixedText m_aDataTypeFT; 325cdf0e10cSrcweir ListBox m_aDataTypeLB; 326cdf0e10cSrcweir 327cdf0e10cSrcweir CheckBox m_aRequiredCB; 328cdf0e10cSrcweir PushButton m_aRequiredBtn; 329cdf0e10cSrcweir CheckBox m_aRelevantCB; 330cdf0e10cSrcweir PushButton m_aRelevantBtn; 331cdf0e10cSrcweir CheckBox m_aConstraintCB; 332cdf0e10cSrcweir PushButton m_aConstraintBtn; 333cdf0e10cSrcweir CheckBox m_aReadonlyCB; 334cdf0e10cSrcweir PushButton m_aReadonlyBtn; 335cdf0e10cSrcweir CheckBox m_aCalculateCB; 336cdf0e10cSrcweir PushButton m_aCalculateBtn; 337cdf0e10cSrcweir 338cdf0e10cSrcweir FixedLine m_aButtonsFL; 339cdf0e10cSrcweir OKButton m_aOKBtn; 340cdf0e10cSrcweir CancelButton m_aEscBtn; 341cdf0e10cSrcweir HelpButton m_aHelpBtn; 342cdf0e10cSrcweir 343cdf0e10cSrcweir XFormsUIHelper1_ref m_xUIHelper; 344cdf0e10cSrcweir XPropertySet_ref m_xBinding; 345cdf0e10cSrcweir XPropertySet_ref m_xTempBinding; 346cdf0e10cSrcweir 347cdf0e10cSrcweir ItemNode* m_pItemNode; 348cdf0e10cSrcweir DataItemType m_eItemType; 349cdf0e10cSrcweir String m_sFL_Element; 350cdf0e10cSrcweir String m_sFL_Attribute; 351cdf0e10cSrcweir String m_sFL_Binding; 352cdf0e10cSrcweir String m_sFT_BindingExp; 353cdf0e10cSrcweir 354cdf0e10cSrcweir DECL_LINK( CheckHdl, CheckBox * ); 355cdf0e10cSrcweir DECL_LINK( ConditionHdl, PushButton * ); 356cdf0e10cSrcweir DECL_LINK( OKHdl, OKButton * ); 357cdf0e10cSrcweir 358cdf0e10cSrcweir void InitDialog(); 359cdf0e10cSrcweir void InitFromNode(); 360cdf0e10cSrcweir void InitDataTypeBox(); 361cdf0e10cSrcweir 362cdf0e10cSrcweir public: 363cdf0e10cSrcweir AddDataItemDialog( 364cdf0e10cSrcweir Window* pParent, ItemNode* _pNode, const XFormsUIHelper1_ref& _rUIHelper ); 365cdf0e10cSrcweir ~AddDataItemDialog(); 366cdf0e10cSrcweir 367cdf0e10cSrcweir void InitText( DataItemType _eType ); 368cdf0e10cSrcweir }; 369cdf0e10cSrcweir 370cdf0e10cSrcweir //======================================================================== 371cdf0e10cSrcweir class AddConditionDialog : public ModalDialog 372cdf0e10cSrcweir { 373cdf0e10cSrcweir private: 374cdf0e10cSrcweir FixedText m_aConditionFT; 375cdf0e10cSrcweir MultiLineEdit m_aConditionED; 376cdf0e10cSrcweir FixedText m_aResultFT; 377cdf0e10cSrcweir FixedText m_aResultWin; 378cdf0e10cSrcweir PushButton m_aEditNamespacesBtn; 379cdf0e10cSrcweir FixedLine m_aButtonsFL; 380cdf0e10cSrcweir OKButton m_aOKBtn; 381cdf0e10cSrcweir CancelButton m_aEscBtn; 382cdf0e10cSrcweir HelpButton m_aHelpBtn; 383cdf0e10cSrcweir 384cdf0e10cSrcweir Timer m_aResultTimer; 385cdf0e10cSrcweir ::rtl::OUString m_sPropertyName; 386cdf0e10cSrcweir 387cdf0e10cSrcweir XFormsUIHelper1_ref m_xUIHelper; 388cdf0e10cSrcweir XPropertySet_ref m_xBinding; 389cdf0e10cSrcweir 390cdf0e10cSrcweir DECL_LINK( ModifyHdl, MultiLineEdit * ); 391cdf0e10cSrcweir DECL_LINK( ResultHdl, Timer * ); 392cdf0e10cSrcweir DECL_LINK( EditHdl, PushButton * ); 393cdf0e10cSrcweir DECL_LINK( OKHdl, OKButton * ); 394cdf0e10cSrcweir 395cdf0e10cSrcweir public: 396cdf0e10cSrcweir AddConditionDialog( Window* pParent, 397cdf0e10cSrcweir const ::rtl::OUString& _rPropertyName, const XPropertySet_ref& _rBinding ); 398cdf0e10cSrcweir ~AddConditionDialog(); 399cdf0e10cSrcweir GetUIHelper() const400cdf0e10cSrcweir inline XFormsUIHelper1_ref GetUIHelper() const { return m_xUIHelper; } GetCondition() const401cdf0e10cSrcweir inline String GetCondition() const { return m_aConditionED.GetText(); } 402cdf0e10cSrcweir inline void SetCondition( const String& _rCondition ); 403cdf0e10cSrcweir }; 404cdf0e10cSrcweir SetCondition(const String & _rCondition)405cdf0e10cSrcweir inline void AddConditionDialog::SetCondition( const String& _rCondition ) 406cdf0e10cSrcweir { 407cdf0e10cSrcweir m_aConditionED.SetText( _rCondition ); 408cdf0e10cSrcweir m_aResultTimer.Start(); 409cdf0e10cSrcweir } 410cdf0e10cSrcweir 411cdf0e10cSrcweir //======================================================================== 412cdf0e10cSrcweir class NamespaceItemDialog : public ModalDialog 413cdf0e10cSrcweir { 414cdf0e10cSrcweir private: 415cdf0e10cSrcweir typedef std::vector< ::rtl::OUString > PrefixList; 416cdf0e10cSrcweir 417cdf0e10cSrcweir FixedText m_aNamespacesFT; 418cdf0e10cSrcweir SvxSimpleTable m_aNamespacesList; 419cdf0e10cSrcweir PushButton m_aAddNamespaceBtn; 420cdf0e10cSrcweir PushButton m_aEditNamespaceBtn; 421cdf0e10cSrcweir PushButton m_aDeleteNamespaceBtn; 422cdf0e10cSrcweir FixedLine m_aButtonsFL; 423cdf0e10cSrcweir OKButton m_aOKBtn; 424cdf0e10cSrcweir CancelButton m_aEscBtn; 425cdf0e10cSrcweir HelpButton m_aHelpBtn; 426cdf0e10cSrcweir 427cdf0e10cSrcweir AddConditionDialog* m_pConditionDlg; 428cdf0e10cSrcweir PrefixList m_aRemovedList; 429cdf0e10cSrcweir 430cdf0e10cSrcweir XNameContainer_ref& m_rNamespaces; 431cdf0e10cSrcweir 432cdf0e10cSrcweir DECL_LINK( SelectHdl, SvxSimpleTable * ); 433cdf0e10cSrcweir DECL_LINK( ClickHdl, PushButton * ); 434cdf0e10cSrcweir DECL_LINK( OKHdl, OKButton * ); 435cdf0e10cSrcweir 436cdf0e10cSrcweir void LoadNamespaces(); 437cdf0e10cSrcweir 438cdf0e10cSrcweir public: 439cdf0e10cSrcweir NamespaceItemDialog( AddConditionDialog* pParent, XNameContainer_ref& _rContainer ); 440cdf0e10cSrcweir ~NamespaceItemDialog(); 441cdf0e10cSrcweir }; 442cdf0e10cSrcweir 443cdf0e10cSrcweir //======================================================================== 444cdf0e10cSrcweir class ManageNamespaceDialog : public ModalDialog 445cdf0e10cSrcweir { 446cdf0e10cSrcweir private: 447cdf0e10cSrcweir FixedText m_aPrefixFT; 448cdf0e10cSrcweir Edit m_aPrefixED; 449cdf0e10cSrcweir FixedText m_aUrlFT; 450cdf0e10cSrcweir Edit m_aUrlED; 451cdf0e10cSrcweir FixedLine m_aButtonsFL; 452cdf0e10cSrcweir OKButton m_aOKBtn; 453cdf0e10cSrcweir CancelButton m_aEscBtn; 454cdf0e10cSrcweir HelpButton m_aHelpBtn; 455cdf0e10cSrcweir 456cdf0e10cSrcweir AddConditionDialog* m_pConditionDlg; 457cdf0e10cSrcweir 458cdf0e10cSrcweir DECL_LINK( OKHdl, OKButton * ); 459cdf0e10cSrcweir 460cdf0e10cSrcweir public: 461cdf0e10cSrcweir ManageNamespaceDialog( Window* pParent, AddConditionDialog* _pCondDlg, bool _bIsEdit ); 462cdf0e10cSrcweir ~ManageNamespaceDialog(); 463cdf0e10cSrcweir 464cdf0e10cSrcweir inline void SetNamespace( const String& _rPrefix, const String& _rURL ); GetPrefix() const465cdf0e10cSrcweir inline String GetPrefix() const { return m_aPrefixED.GetText(); } GetURL() const466cdf0e10cSrcweir inline String GetURL() const { return m_aUrlED.GetText(); } 467cdf0e10cSrcweir }; 468cdf0e10cSrcweir SetNamespace(const String & _rPrefix,const String & _rURL)469cdf0e10cSrcweir void ManageNamespaceDialog::SetNamespace( const String& _rPrefix, const String& _rURL ) 470cdf0e10cSrcweir { 471cdf0e10cSrcweir m_aPrefixED.SetText( _rPrefix ); 472cdf0e10cSrcweir m_aUrlED.SetText( _rURL ); 473cdf0e10cSrcweir } 474cdf0e10cSrcweir 475cdf0e10cSrcweir //======================================================================== 476cdf0e10cSrcweir class AddSubmissionDialog : public ModalDialog 477cdf0e10cSrcweir { 478cdf0e10cSrcweir private: 479cdf0e10cSrcweir FixedLine m_aSubmissionFL; 480cdf0e10cSrcweir FixedText m_aNameFT; 481cdf0e10cSrcweir Edit m_aNameED; 482cdf0e10cSrcweir FixedText m_aActionFT; 483cdf0e10cSrcweir Edit m_aActionED; 484cdf0e10cSrcweir FixedText m_aMethodFT; 485cdf0e10cSrcweir ListBox m_aMethodLB; 486cdf0e10cSrcweir FixedText m_aRefFT; 487cdf0e10cSrcweir Edit m_aRefED; 488cdf0e10cSrcweir PushButton m_aRefBtn; 489cdf0e10cSrcweir FixedText m_aBindFT; 490cdf0e10cSrcweir ListBox m_aBindLB; 491cdf0e10cSrcweir FixedText m_aReplaceFT; 492cdf0e10cSrcweir ListBox m_aReplaceLB; 493cdf0e10cSrcweir 494cdf0e10cSrcweir FixedLine m_aButtonsFL; 495cdf0e10cSrcweir OKButton m_aOKBtn; 496cdf0e10cSrcweir CancelButton m_aEscBtn; 497cdf0e10cSrcweir HelpButton m_aHelpBtn; 498cdf0e10cSrcweir 499cdf0e10cSrcweir ItemNode* m_pItemNode; 500cdf0e10cSrcweir 501cdf0e10cSrcweir XFormsUIHelper1_ref m_xUIHelper; 502cdf0e10cSrcweir XSubmission_ref m_xNewSubmission; 503cdf0e10cSrcweir XPropertySet_ref m_xSubmission; 504cdf0e10cSrcweir XPropertySet_ref m_xTempBinding; 505cdf0e10cSrcweir XPropertySet_ref m_xCreatedBinding; 506cdf0e10cSrcweir 507cdf0e10cSrcweir DECL_LINK( RefHdl, PushButton * ); 508cdf0e10cSrcweir DECL_LINK( OKHdl, OKButton * ); 509cdf0e10cSrcweir 510cdf0e10cSrcweir void FillAllBoxes(); 511cdf0e10cSrcweir 512cdf0e10cSrcweir public: 513cdf0e10cSrcweir AddSubmissionDialog( Window* pParent, ItemNode* _pNode, 514cdf0e10cSrcweir const XFormsUIHelper1_ref& _rUIHelper ); 515cdf0e10cSrcweir ~AddSubmissionDialog(); 516cdf0e10cSrcweir GetNewSubmission() const517cdf0e10cSrcweir inline const XSubmission_ref& GetNewSubmission() const { return m_xNewSubmission; } 518cdf0e10cSrcweir }; 519cdf0e10cSrcweir 520cdf0e10cSrcweir //======================================================================== 521cdf0e10cSrcweir class AddModelDialog : public ModalDialog 522cdf0e10cSrcweir { 523cdf0e10cSrcweir private: 524cdf0e10cSrcweir FixedLine m_aModelFL; 525cdf0e10cSrcweir FixedText m_aNameFT; 526cdf0e10cSrcweir Edit m_aNameED; 527cdf0e10cSrcweir CheckBox m_aModifyCB; 528cdf0e10cSrcweir FixedLine m_aButtonsFL; 529cdf0e10cSrcweir OKButton m_aOKBtn; 530cdf0e10cSrcweir CancelButton m_aEscBtn; 531cdf0e10cSrcweir HelpButton m_aHelpBtn; 532cdf0e10cSrcweir 533cdf0e10cSrcweir public: 534cdf0e10cSrcweir AddModelDialog( Window* pParent, bool _bEdit ); 535cdf0e10cSrcweir ~AddModelDialog(); 536cdf0e10cSrcweir GetName() const537cdf0e10cSrcweir inline String GetName() const { return m_aNameED.GetText(); } SetName(const String & _rName)538cdf0e10cSrcweir inline void SetName( const String& _rName ) { m_aNameED.SetText( _rName );} 539cdf0e10cSrcweir GetModifyDoc() const540cdf0e10cSrcweir inline bool GetModifyDoc() const { return bool( m_aModifyCB.IsChecked() ); } SetModifyDoc(const bool _bModify)541cdf0e10cSrcweir inline void SetModifyDoc( const bool _bModify ) { m_aModifyCB.Check( _bModify ); } 542cdf0e10cSrcweir }; 543cdf0e10cSrcweir 544cdf0e10cSrcweir //======================================================================== 545cdf0e10cSrcweir class AddInstanceDialog : public ModalDialog 546cdf0e10cSrcweir { 547cdf0e10cSrcweir private: 548cdf0e10cSrcweir FixedLine m_aInstanceFL; 549cdf0e10cSrcweir FixedText m_aNameFT; 550cdf0e10cSrcweir Edit m_aNameED; 551cdf0e10cSrcweir FixedText m_aURLFT; 552cdf0e10cSrcweir SvtURLBox m_aURLED; 553cdf0e10cSrcweir PushButton m_aFilePickerBtn; 554cdf0e10cSrcweir CheckBox m_aLinkInstanceCB; 555cdf0e10cSrcweir FixedLine m_aButtonsFL; 556cdf0e10cSrcweir OKButton m_aOKBtn; 557cdf0e10cSrcweir CancelButton m_aEscBtn; 558cdf0e10cSrcweir HelpButton m_aHelpBtn; 559cdf0e10cSrcweir 560cdf0e10cSrcweir String m_sAllFilterName; 561cdf0e10cSrcweir 562cdf0e10cSrcweir DECL_LINK( FilePickerHdl, PushButton * ); 563cdf0e10cSrcweir 564cdf0e10cSrcweir public: 565cdf0e10cSrcweir AddInstanceDialog( Window* pParent, bool _bEdit ); 566cdf0e10cSrcweir ~AddInstanceDialog(); 567cdf0e10cSrcweir 568cdf0e10cSrcweir inline void SetRenameMode(); GetName() const569cdf0e10cSrcweir inline String GetName() const { return m_aNameED.GetText(); } SetName(const String & _rName)570cdf0e10cSrcweir inline void SetName( const String& _rName ) { m_aNameED.SetText( _rName );} GetURL() const571cdf0e10cSrcweir inline String GetURL() const { return m_aURLED.GetText(); } SetURL(const String & _rURL)572cdf0e10cSrcweir inline void SetURL( const String& _rURL ) { m_aURLED.SetText( _rURL );} IsLinkInstance() const573cdf0e10cSrcweir inline bool IsLinkInstance() const { return ( m_aLinkInstanceCB.IsChecked() != sal_False ); } SetLinkInstance(bool _bLink)574cdf0e10cSrcweir inline void SetLinkInstance( bool _bLink ) { m_aLinkInstanceCB.Check( _bLink != false ); } 575cdf0e10cSrcweir }; 576cdf0e10cSrcweir SetRenameMode()577cdf0e10cSrcweir inline void AddInstanceDialog::SetRenameMode() 578cdf0e10cSrcweir { 579cdf0e10cSrcweir m_aURLFT.Disable(); 580cdf0e10cSrcweir m_aURLED.Disable(); 581cdf0e10cSrcweir m_aFilePickerBtn.Disable(); 582cdf0e10cSrcweir m_aLinkInstanceCB.Disable(); 583cdf0e10cSrcweir } 584cdf0e10cSrcweir 585cdf0e10cSrcweir //======================================================================== 586cdf0e10cSrcweir class LinkedInstanceWarningBox : public MessBox 587cdf0e10cSrcweir { 588cdf0e10cSrcweir public: 589cdf0e10cSrcweir LinkedInstanceWarningBox( Window* pParent ); 590cdf0e10cSrcweir }; 591cdf0e10cSrcweir 592cdf0e10cSrcweir //............................................................................ 593cdf0e10cSrcweir } // namespace svxform 594cdf0e10cSrcweir //............................................................................ 595cdf0e10cSrcweir 596cdf0e10cSrcweir #endif // _SVX_DATANAVI_HXX 597