merge the formfield patch from ooo-build
[ooovba.git] / extensions / source / propctrlr / browserline.hxx
blob75cdb798422815bee3a637aea310d1ae5a15f163
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: browserline.hxx,v $
10 * $Revision: 1.13 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_
32 #define _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_
34 /** === begin UNO includes === **/
35 #include <com/sun/star/inspection/XPropertyControl.hpp>
36 /** === end UNO includes === **/
37 #include <vcl/fixed.hxx>
38 #ifndef _SV_BUTTON_HXX
39 #include <vcl/button.hxx>
40 #endif
42 namespace com { namespace sun { namespace star { namespace inspection { namespace PropertyLineElement
44 const sal_Int16 CompleteLine = 0x4000;
45 } } } } }
47 //............................................................................
48 namespace pcr
50 //............................................................................
52 class OBrowserLine;
54 //========================================================================
55 class IButtonClickListener
57 public:
58 virtual void buttonClicked( OBrowserLine* _pLine, sal_Bool _bPrimary ) = 0;
61 //========================================================================
62 class OBrowserLine
64 private:
65 ::rtl::OUString m_sEntryName;
66 FixedText m_aFtTitle;
67 Size m_aOutputSize;
68 Point m_aLinePos;
69 ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >
70 m_xControl;
71 Window* m_pControlWindow;
72 PushButton* m_pBrowseButton;
73 PushButton* m_pAdditionalBrowseButton;
74 IButtonClickListener* m_pClickListener;
75 Window* m_pTheParent;
76 sal_uInt16 m_nNameWidth;
77 sal_uInt16 m_nEnableFlags;
78 bool m_bIndentTitle;
79 bool m_bReadOnly;
81 public:
82 OBrowserLine( const ::rtl::OUString& _rEntryName, Window* pParent);
83 ~OBrowserLine();
85 void setControl( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _rxControl );
86 const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& getControl()
88 return m_xControl;
90 inline Window* getControlWindow() const
92 return m_pControlWindow;
95 const ::rtl::OUString&
96 GetEntryName() const { return m_sEntryName; }
98 void SetComponentHelpIds( const SmartId& _rHelpId, sal_uInt32 _bPrimaryButtonId, sal_uInt32 _nSecondaryButtonId );
100 void SetTitle(const String& rString );
101 void FullFillTitleString();
102 String GetTitle() const;
103 void SetTitleWidth(sal_uInt16);
105 void SetPosSizePixel(Point aPos,Size aSize);
106 void Show(sal_Bool bFlag=sal_True);
107 void Hide();
108 sal_Bool IsVisible();
110 Window* GetRefWindow();
111 void SetTabOrder(Window* pRefWindow, sal_uInt16 nFlags );
113 sal_Bool GrabFocus();
114 void ShowBrowseButton( const ::rtl::OUString& _rImageURL, sal_Bool _bPrimary );
115 void ShowBrowseButton( const Image& _rImage, sal_Bool _bPrimary );
116 void ShowBrowseButton( sal_Bool _bPrimary );
117 void HideBrowseButton( sal_Bool _bPrimary );
119 void EnablePropertyControls( sal_Int16 _nControls, bool _bEnable );
120 void EnablePropertyLine( bool _bEnable );
121 sal_Bool IsPropertyInputEnabled( ) const;
123 void SetReadOnly( bool _bReadOnly );
125 void SetClickListener( IButtonClickListener* _pListener );
127 void IndentTitle( bool _bIndent );
129 private:
130 DECL_LINK( OnButtonClicked, PushButton* );
131 DECL_LINK( OnButtonFocus, PushButton* );
133 void implHideBrowseButton( sal_Bool _bPrimary, bool _bReLayout );
134 void implUpdateEnabledDisabled();
136 void impl_layoutComponents();
138 PushButton& impl_ensureButton( bool _bPrimary );
139 void impl_getImagesFromURL_nothrow( const ::rtl::OUString& _rImageURL, Image& _out_rImage, Image& _out_rHCImage );
142 //............................................................................
143 } // namespace pcr
144 //............................................................................
146 #endif // _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_