bump product version to 5.0.4.1
[LibreOffice.git] / extensions / source / propctrlr / browserline.hxx
blob9f39ec6277f366a3256329a15df56c00ebd4ffab
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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;
30 } } } } }
33 namespace pcr
37 class OBrowserLine;
40 class IButtonClickListener
42 public:
43 virtual void buttonClicked( OBrowserLine* _pLine, bool _bPrimary ) = 0;
45 protected:
46 ~IButtonClickListener() {}
50 class OBrowserLine
52 private:
53 OUString m_sEntryName;
54 VclPtr<FixedText> m_aFtTitle;
55 Size m_aOutputSize;
56 Point m_aLinePos;
57 ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >
58 m_xControl;
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;
66 bool m_bIndentTitle;
67 bool m_bReadOnly;
69 public:
70 OBrowserLine( const OUString& _rEntryName, vcl::Window* pParent);
71 ~OBrowserLine();
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
76 return m_xControl;
78 inline vcl::Window* getControlWindow() const
80 return m_pControlWindow;
83 const OUString&
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);
95 void Hide();
96 bool IsVisible();
98 vcl::Window* GetRefWindow();
99 void SetTabOrder(vcl::Window* pRefWindow, sal_uInt16 nFlags );
101 bool GrabFocus();
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 );
116 private:
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 );
130 } // namespace pcr
133 #endif // INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_BROWSERLINE_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */