1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_BROWSERLINE_HXX
21 #define INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_BROWSERLINE_HXX
23 #include <com/sun/star/inspection/XPropertyControl.hpp>
24 #include <vcl/fixed.hxx>
25 #include <vcl/button.hxx>
27 namespace com
{ namespace sun
{ namespace star
{ namespace inspection
{ namespace PropertyLineElement
29 const sal_Int16 CompleteLine
= 0x4000;
40 class IButtonClickListener
43 virtual void buttonClicked( OBrowserLine
* _pLine
, bool _bPrimary
) = 0;
46 ~IButtonClickListener() {}
53 OUString m_sEntryName
;
54 VclPtr
<FixedText
> m_aFtTitle
;
57 ::com::sun::star::uno::Reference
< ::com::sun::star::inspection::XPropertyControl
>
59 VclPtr
<vcl::Window
> m_pControlWindow
;
60 VclPtr
<PushButton
> m_pBrowseButton
;
61 VclPtr
<PushButton
> m_pAdditionalBrowseButton
;
62 IButtonClickListener
* m_pClickListener
;
63 VclPtr
<vcl::Window
> m_pTheParent
;
64 sal_uInt16 m_nNameWidth
;
65 sal_uInt16 m_nEnableFlags
;
70 OBrowserLine( const OUString
& _rEntryName
, vcl::Window
* pParent
);
73 void setControl( const ::com::sun::star::uno::Reference
< ::com::sun::star::inspection::XPropertyControl
>& _rxControl
);
74 const ::com::sun::star::uno::Reference
< ::com::sun::star::inspection::XPropertyControl
>& getControl() const
78 inline vcl::Window
* getControlWindow() const
80 return m_pControlWindow
;
84 GetEntryName() const { return m_sEntryName
; }
86 void SetComponentHelpIds( const OString
& _rHelpId
, const OString
& _sPrimaryButtonId
, const OString
& _sSecondaryButtonId
);
88 void SetTitle(const OUString
& rString
);
89 void FullFillTitleString();
90 OUString
GetTitle() const;
91 void SetTitleWidth(sal_uInt16
);
93 void SetPosSizePixel(Point aPos
,Size aSize
);
94 void Show(bool bFlag
=true);
98 vcl::Window
* GetRefWindow();
99 void SetTabOrder(vcl::Window
* pRefWindow
, sal_uInt16 nFlags
);
102 void ShowBrowseButton( const OUString
& _rImageURL
, bool _bPrimary
);
103 void ShowBrowseButton( const Image
& _rImage
, bool _bPrimary
);
104 void ShowBrowseButton( bool _bPrimary
);
105 void HideBrowseButton( bool _bPrimary
);
107 void EnablePropertyControls( sal_Int16 _nControls
, bool _bEnable
);
108 void EnablePropertyLine( bool _bEnable
);
110 void SetReadOnly( bool _bReadOnly
);
112 void SetClickListener( IButtonClickListener
* _pListener
);
114 void IndentTitle( bool _bIndent
);
117 DECL_LINK( OnButtonClicked
, PushButton
* );
118 DECL_LINK( OnButtonFocus
, PushButton
* );
120 void implHideBrowseButton( bool _bPrimary
, bool _bReLayout
);
121 void implUpdateEnabledDisabled();
123 void impl_layoutComponents();
125 PushButton
& impl_ensureButton( bool _bPrimary
);
126 static void impl_getImagesFromURL_nothrow( const OUString
& _rImageURL
, Image
& _out_rImage
);
133 #endif // INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_BROWSERLINE_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */