1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: browserline.hxx,v $
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>
42 namespace com
{ namespace sun
{ namespace star
{ namespace inspection
{ namespace PropertyLineElement
44 const sal_Int16 CompleteLine
= 0x4000;
47 //............................................................................
50 //............................................................................
54 //========================================================================
55 class IButtonClickListener
58 virtual void buttonClicked( OBrowserLine
* _pLine
, sal_Bool _bPrimary
) = 0;
61 //========================================================================
65 ::rtl::OUString m_sEntryName
;
69 ::com::sun::star::uno::Reference
< ::com::sun::star::inspection::XPropertyControl
>
71 Window
* m_pControlWindow
;
72 PushButton
* m_pBrowseButton
;
73 PushButton
* m_pAdditionalBrowseButton
;
74 IButtonClickListener
* m_pClickListener
;
76 sal_uInt16 m_nNameWidth
;
77 sal_uInt16 m_nEnableFlags
;
82 OBrowserLine( const ::rtl::OUString
& _rEntryName
, Window
* pParent
);
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()
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
);
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
);
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 //............................................................................
144 //............................................................................
146 #endif // _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_