merged tag LIBREOFFICE_3_2_99_3
[LibreOffice.git] / extensions / source / propctrlr / browserline.hxx
blobfd091c712e78ae25f8abbcd5016c045481d6a16e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_
30 #define _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_
32 /** === begin UNO includes === **/
33 #include <com/sun/star/inspection/XPropertyControl.hpp>
34 /** === end UNO includes === **/
35 #include <vcl/fixed.hxx>
36 #include <vcl/button.hxx>
38 namespace com { namespace sun { namespace star { namespace inspection { namespace PropertyLineElement
40 const sal_Int16 CompleteLine = 0x4000;
41 } } } } }
43 //............................................................................
44 namespace pcr
46 //............................................................................
48 class OBrowserLine;
50 //========================================================================
51 class IButtonClickListener
53 public:
54 virtual void buttonClicked( OBrowserLine* _pLine, sal_Bool _bPrimary ) = 0;
57 //========================================================================
58 class OBrowserLine
60 private:
61 ::rtl::OUString m_sEntryName;
62 FixedText m_aFtTitle;
63 Size m_aOutputSize;
64 Point m_aLinePos;
65 ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >
66 m_xControl;
67 Window* m_pControlWindow;
68 PushButton* m_pBrowseButton;
69 PushButton* m_pAdditionalBrowseButton;
70 IButtonClickListener* m_pClickListener;
71 Window* m_pTheParent;
72 sal_uInt16 m_nNameWidth;
73 sal_uInt16 m_nEnableFlags;
74 bool m_bIndentTitle;
75 bool m_bReadOnly;
77 public:
78 OBrowserLine( const ::rtl::OUString& _rEntryName, Window* pParent);
79 ~OBrowserLine();
81 void setControl( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _rxControl );
82 const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& getControl()
84 return m_xControl;
86 inline Window* getControlWindow() const
88 return m_pControlWindow;
91 const ::rtl::OUString&
92 GetEntryName() const { return m_sEntryName; }
94 void SetComponentHelpIds( const SmartId& _rHelpId, sal_uInt32 _bPrimaryButtonId, sal_uInt32 _nSecondaryButtonId );
96 void SetTitle(const String& rString );
97 void FullFillTitleString();
98 String GetTitle() const;
99 void SetTitleWidth(sal_uInt16);
101 void SetPosSizePixel(Point aPos,Size aSize);
102 void Show(sal_Bool bFlag=sal_True);
103 void Hide();
104 sal_Bool IsVisible();
106 Window* GetRefWindow();
107 void SetTabOrder(Window* pRefWindow, sal_uInt16 nFlags );
109 sal_Bool GrabFocus();
110 void ShowBrowseButton( const ::rtl::OUString& _rImageURL, sal_Bool _bPrimary );
111 void ShowBrowseButton( const Image& _rImage, sal_Bool _bPrimary );
112 void ShowBrowseButton( sal_Bool _bPrimary );
113 void HideBrowseButton( sal_Bool _bPrimary );
115 void EnablePropertyControls( sal_Int16 _nControls, bool _bEnable );
116 void EnablePropertyLine( bool _bEnable );
118 void SetReadOnly( bool _bReadOnly );
120 void SetClickListener( IButtonClickListener* _pListener );
122 void IndentTitle( bool _bIndent );
124 private:
125 DECL_LINK( OnButtonClicked, PushButton* );
126 DECL_LINK( OnButtonFocus, PushButton* );
128 void implHideBrowseButton( sal_Bool _bPrimary, bool _bReLayout );
129 void implUpdateEnabledDisabled();
131 void impl_layoutComponents();
133 PushButton& impl_ensureButton( bool _bPrimary );
134 void impl_getImagesFromURL_nothrow( const ::rtl::OUString& _rImageURL, Image& _out_rImage, Image& _out_rHCImage );
137 //............................................................................
138 } // namespace pcr
139 //............................................................................
141 #endif // _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */