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