1*46dbaceeSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*46dbaceeSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*46dbaceeSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*46dbaceeSAndrew Rist * distributed with this work for additional information 6*46dbaceeSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*46dbaceeSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*46dbaceeSAndrew Rist * "License"); you may not use this file except in compliance 9*46dbaceeSAndrew Rist * with the License. You may obtain a copy of the License at 10*46dbaceeSAndrew Rist * 11*46dbaceeSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*46dbaceeSAndrew Rist * 13*46dbaceeSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*46dbaceeSAndrew Rist * software distributed under the License is distributed on an 15*46dbaceeSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*46dbaceeSAndrew Rist * KIND, either express or implied. See the License for the 17*46dbaceeSAndrew Rist * specific language governing permissions and limitations 18*46dbaceeSAndrew Rist * under the License. 19*46dbaceeSAndrew Rist * 20*46dbaceeSAndrew Rist *************************************************************/ 21*46dbaceeSAndrew Rist 22*46dbaceeSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_ 25cdf0e10cSrcweir #define _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir /** === begin UNO includes === **/ 28cdf0e10cSrcweir #include <com/sun/star/inspection/XPropertyControl.hpp> 29cdf0e10cSrcweir /** === end UNO includes === **/ 30cdf0e10cSrcweir #include <vcl/fixed.hxx> 31cdf0e10cSrcweir #ifndef _SV_BUTTON_HXX 32cdf0e10cSrcweir #include <vcl/button.hxx> 33cdf0e10cSrcweir #endif 34cdf0e10cSrcweir 35cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace inspection { namespace PropertyLineElement 36cdf0e10cSrcweir { 37cdf0e10cSrcweir const sal_Int16 CompleteLine = 0x4000; 38cdf0e10cSrcweir } } } } } 39cdf0e10cSrcweir 40cdf0e10cSrcweir //............................................................................ 41cdf0e10cSrcweir namespace pcr 42cdf0e10cSrcweir { 43cdf0e10cSrcweir //............................................................................ 44cdf0e10cSrcweir 45cdf0e10cSrcweir class OBrowserLine; 46cdf0e10cSrcweir 47cdf0e10cSrcweir //======================================================================== 48cdf0e10cSrcweir class IButtonClickListener 49cdf0e10cSrcweir { 50cdf0e10cSrcweir public: 51cdf0e10cSrcweir virtual void buttonClicked( OBrowserLine* _pLine, sal_Bool _bPrimary ) = 0; 52cdf0e10cSrcweir }; 53cdf0e10cSrcweir 54cdf0e10cSrcweir //======================================================================== 55cdf0e10cSrcweir class OBrowserLine 56cdf0e10cSrcweir { 57cdf0e10cSrcweir private: 58cdf0e10cSrcweir ::rtl::OUString m_sEntryName; 59cdf0e10cSrcweir FixedText m_aFtTitle; 60cdf0e10cSrcweir Size m_aOutputSize; 61cdf0e10cSrcweir Point m_aLinePos; 62cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl > 63cdf0e10cSrcweir m_xControl; 64cdf0e10cSrcweir Window* m_pControlWindow; 65cdf0e10cSrcweir PushButton* m_pBrowseButton; 66cdf0e10cSrcweir PushButton* m_pAdditionalBrowseButton; 67cdf0e10cSrcweir IButtonClickListener* m_pClickListener; 68cdf0e10cSrcweir Window* m_pTheParent; 69cdf0e10cSrcweir sal_uInt16 m_nNameWidth; 70cdf0e10cSrcweir sal_uInt16 m_nEnableFlags; 71cdf0e10cSrcweir bool m_bIndentTitle; 72cdf0e10cSrcweir bool m_bReadOnly; 73cdf0e10cSrcweir 74cdf0e10cSrcweir public: 75cdf0e10cSrcweir OBrowserLine( const ::rtl::OUString& _rEntryName, Window* pParent); 76cdf0e10cSrcweir ~OBrowserLine(); 77cdf0e10cSrcweir 78cdf0e10cSrcweir void setControl( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _rxControl ); getControl()79cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& getControl() 80cdf0e10cSrcweir { 81cdf0e10cSrcweir return m_xControl; 82cdf0e10cSrcweir } getControlWindow() const83cdf0e10cSrcweir inline Window* getControlWindow() const 84cdf0e10cSrcweir { 85cdf0e10cSrcweir return m_pControlWindow; 86cdf0e10cSrcweir } 87cdf0e10cSrcweir 88cdf0e10cSrcweir const ::rtl::OUString& GetEntryName() const89cdf0e10cSrcweir GetEntryName() const { return m_sEntryName; } 90cdf0e10cSrcweir 91cdf0e10cSrcweir void SetComponentHelpIds( const rtl::OString& _rHelpId, const rtl::OString& _sPrimaryButtonId, const rtl::OString& _sSecondaryButtonId ); 92cdf0e10cSrcweir 93cdf0e10cSrcweir void SetTitle(const String& rString ); 94cdf0e10cSrcweir void FullFillTitleString(); 95cdf0e10cSrcweir String GetTitle() const; 96cdf0e10cSrcweir void SetTitleWidth(sal_uInt16); 97cdf0e10cSrcweir 98cdf0e10cSrcweir void SetPosSizePixel(Point aPos,Size aSize); 99cdf0e10cSrcweir void Show(sal_Bool bFlag=sal_True); 100cdf0e10cSrcweir void Hide(); 101cdf0e10cSrcweir sal_Bool IsVisible(); 102cdf0e10cSrcweir 103cdf0e10cSrcweir Window* GetRefWindow(); 104cdf0e10cSrcweir void SetTabOrder(Window* pRefWindow, sal_uInt16 nFlags ); 105cdf0e10cSrcweir 106cdf0e10cSrcweir sal_Bool GrabFocus(); 107cdf0e10cSrcweir void ShowBrowseButton( const ::rtl::OUString& _rImageURL, sal_Bool _bPrimary ); 108cdf0e10cSrcweir void ShowBrowseButton( const Image& _rImage, sal_Bool _bPrimary ); 109cdf0e10cSrcweir void ShowBrowseButton( sal_Bool _bPrimary ); 110cdf0e10cSrcweir void HideBrowseButton( sal_Bool _bPrimary ); 111cdf0e10cSrcweir 112cdf0e10cSrcweir void EnablePropertyControls( sal_Int16 _nControls, bool _bEnable ); 113cdf0e10cSrcweir void EnablePropertyLine( bool _bEnable ); 114cdf0e10cSrcweir 115cdf0e10cSrcweir void SetReadOnly( bool _bReadOnly ); 116cdf0e10cSrcweir 117cdf0e10cSrcweir void SetClickListener( IButtonClickListener* _pListener ); 118cdf0e10cSrcweir 119cdf0e10cSrcweir void IndentTitle( bool _bIndent ); 120cdf0e10cSrcweir 121cdf0e10cSrcweir private: 122cdf0e10cSrcweir DECL_LINK( OnButtonClicked, PushButton* ); 123cdf0e10cSrcweir DECL_LINK( OnButtonFocus, PushButton* ); 124cdf0e10cSrcweir 125cdf0e10cSrcweir void implHideBrowseButton( sal_Bool _bPrimary, bool _bReLayout ); 126cdf0e10cSrcweir void implUpdateEnabledDisabled(); 127cdf0e10cSrcweir 128cdf0e10cSrcweir void impl_layoutComponents(); 129cdf0e10cSrcweir 130cdf0e10cSrcweir PushButton& impl_ensureButton( bool _bPrimary ); 131cdf0e10cSrcweir void impl_getImagesFromURL_nothrow( const ::rtl::OUString& _rImageURL, Image& _out_rImage, Image& _out_rHCImage ); 132cdf0e10cSrcweir }; 133cdf0e10cSrcweir 134cdf0e10cSrcweir //............................................................................ 135cdf0e10cSrcweir } // namespace pcr 136cdf0e10cSrcweir //............................................................................ 137cdf0e10cSrcweir 138cdf0e10cSrcweir #endif // _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_ 139cdf0e10cSrcweir 140