Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / extensions / source / propctrlr / browserline.hxx
blob45b98a56128efdd5a0747d9524fa6c3677b39ce9
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 css::uno::Reference< css::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 css::uno::Reference< css::inspection::XPropertyControl >& _rxControl );
74 const css::uno::Reference< css::inspection::XPropertyControl >& getControl() const
76 return m_xControl;
78 vcl::Window* getControlWindow() const
80 return m_pControlWindow;
83 const OUString& GetEntryName() const { return m_sEntryName; }
85 void SetComponentHelpIds(const OString& _rHelpId);
87 void SetTitle(const OUString& rString );
88 void FullFillTitleString();
89 OUString GetTitle() const;
90 void SetTitleWidth(sal_uInt16);
92 void SetPosSizePixel(Point aPos,Size aSize);
93 void Show(bool bFlag=true);
94 void Hide();
95 bool IsVisible() const;
97 vcl::Window* GetRefWindow();
98 void SetTabOrder(vcl::Window* pRefWindow, ZOrderFlags nFlags );
100 bool GrabFocus();
101 void ShowBrowseButton( const OUString& _rImageURL, bool _bPrimary );
102 void ShowBrowseButton( const Image& _rImage, bool _bPrimary );
103 void ShowBrowseButton( bool _bPrimary );
104 void HideBrowseButton( bool _bPrimary );
106 void EnablePropertyControls( sal_Int16 _nControls, bool _bEnable );
107 void EnablePropertyLine( bool _bEnable );
109 void SetReadOnly( bool _bReadOnly );
111 void SetClickListener( IButtonClickListener* _pListener );
113 void IndentTitle( bool _bIndent );
115 private:
116 DECL_LINK( OnButtonClicked, Button*, void );
117 DECL_LINK( OnButtonFocus, Control&, void );
119 void implHideBrowseButton(bool _bPrimary);
120 void implUpdateEnabledDisabled();
122 void impl_layoutComponents();
124 PushButton& impl_ensureButton( bool _bPrimary );
128 } // namespace pcr
131 #endif // INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_BROWSERLINE_HXX
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */