masterfix DEV300: #i10000# build fix
[LibreOffice.git] / extensions / source / propctrlr / browserline.hxx
blobac65993c0e1297058f18c6c10b505b6c5b386678
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_
29 #define _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_
31 /** === begin UNO includes === **/
32 #include <com/sun/star/inspection/XPropertyControl.hpp>
33 /** === end UNO includes === **/
34 #include <vcl/fixed.hxx>
35 #ifndef _SV_BUTTON_HXX
36 #include <vcl/button.hxx>
37 #endif
39 namespace com { namespace sun { namespace star { namespace inspection { namespace PropertyLineElement
41 const sal_Int16 CompleteLine = 0x4000;
42 } } } } }
44 //............................................................................
45 namespace pcr
47 //............................................................................
49 class OBrowserLine;
51 //========================================================================
52 class IButtonClickListener
54 public:
55 virtual void buttonClicked( OBrowserLine* _pLine, sal_Bool _bPrimary ) = 0;
58 //========================================================================
59 class OBrowserLine
61 private:
62 ::rtl::OUString m_sEntryName;
63 FixedText m_aFtTitle;
64 Size m_aOutputSize;
65 Point m_aLinePos;
66 ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >
67 m_xControl;
68 Window* m_pControlWindow;
69 PushButton* m_pBrowseButton;
70 PushButton* m_pAdditionalBrowseButton;
71 IButtonClickListener* m_pClickListener;
72 Window* m_pTheParent;
73 sal_uInt16 m_nNameWidth;
74 sal_uInt16 m_nEnableFlags;
75 bool m_bIndentTitle;
76 bool m_bReadOnly;
78 public:
79 OBrowserLine( const ::rtl::OUString& _rEntryName, Window* pParent);
80 ~OBrowserLine();
82 void setControl( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _rxControl );
83 const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& getControl()
85 return m_xControl;
87 inline Window* getControlWindow() const
89 return m_pControlWindow;
92 const ::rtl::OUString&
93 GetEntryName() const { return m_sEntryName; }
95 void SetComponentHelpIds( const rtl::OString& _rHelpId, const rtl::OString& _sPrimaryButtonId, const rtl::OString& _sSecondaryButtonId );
97 void SetTitle(const String& rString );
98 void FullFillTitleString();
99 String GetTitle() const;
100 void SetTitleWidth(sal_uInt16);
102 void SetPosSizePixel(Point aPos,Size aSize);
103 void Show(sal_Bool bFlag=sal_True);
104 void Hide();
105 sal_Bool IsVisible();
107 Window* GetRefWindow();
108 void SetTabOrder(Window* pRefWindow, sal_uInt16 nFlags );
110 sal_Bool GrabFocus();
111 void ShowBrowseButton( const ::rtl::OUString& _rImageURL, sal_Bool _bPrimary );
112 void ShowBrowseButton( const Image& _rImage, sal_Bool _bPrimary );
113 void ShowBrowseButton( sal_Bool _bPrimary );
114 void HideBrowseButton( sal_Bool _bPrimary );
116 void EnablePropertyControls( sal_Int16 _nControls, bool _bEnable );
117 void EnablePropertyLine( bool _bEnable );
119 void SetReadOnly( bool _bReadOnly );
121 void SetClickListener( IButtonClickListener* _pListener );
123 void IndentTitle( bool _bIndent );
125 private:
126 DECL_LINK( OnButtonClicked, PushButton* );
127 DECL_LINK( OnButtonFocus, PushButton* );
129 void implHideBrowseButton( sal_Bool _bPrimary, bool _bReLayout );
130 void implUpdateEnabledDisabled();
132 void impl_layoutComponents();
134 PushButton& impl_ensureButton( bool _bPrimary );
135 void impl_getImagesFromURL_nothrow( const ::rtl::OUString& _rImageURL, Image& _out_rImage, Image& _out_rHCImage );
138 //............................................................................
139 } // namespace pcr
140 //............................................................................
142 #endif // _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_