Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_BROWSERLINE_HXX
21 : #define INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_BROWSERLINE_HXX
22 :
23 : #include <com/sun/star/inspection/XPropertyControl.hpp>
24 : #include <vcl/fixed.hxx>
25 : #include <vcl/button.hxx>
26 :
27 : namespace com { namespace sun { namespace star { namespace inspection { namespace PropertyLineElement
28 : {
29 : const sal_Int16 CompleteLine = 0x4000;
30 : } } } } }
31 :
32 :
33 : namespace pcr
34 : {
35 :
36 :
37 : class OBrowserLine;
38 :
39 :
40 0 : class IButtonClickListener
41 : {
42 : public:
43 : virtual void buttonClicked( OBrowserLine* _pLine, bool _bPrimary ) = 0;
44 :
45 : protected:
46 0 : ~IButtonClickListener() {}
47 : };
48 :
49 :
50 : class OBrowserLine
51 : {
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;
68 :
69 : public:
70 : OBrowserLine( const OUString& _rEntryName, vcl::Window* pParent);
71 : ~OBrowserLine();
72 :
73 : void setControl( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _rxControl );
74 0 : const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& getControl() const
75 : {
76 0 : return m_xControl;
77 : }
78 0 : inline vcl::Window* getControlWindow() const
79 : {
80 0 : return m_pControlWindow;
81 : }
82 :
83 : const OUString&
84 0 : GetEntryName() const { return m_sEntryName; }
85 :
86 : void SetComponentHelpIds( const OString& _rHelpId, const OString& _sPrimaryButtonId, const OString& _sSecondaryButtonId );
87 :
88 : void SetTitle(const OUString& rString );
89 : void FullFillTitleString();
90 : OUString GetTitle() const;
91 : void SetTitleWidth(sal_uInt16);
92 :
93 : void SetPosSizePixel(Point aPos,Size aSize);
94 : void Show(bool bFlag=true);
95 : void Hide();
96 : bool IsVisible();
97 :
98 : vcl::Window* GetRefWindow();
99 : void SetTabOrder(vcl::Window* pRefWindow, ZOrderFlags nFlags );
100 :
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 );
106 :
107 : void EnablePropertyControls( sal_Int16 _nControls, bool _bEnable );
108 : void EnablePropertyLine( bool _bEnable );
109 :
110 : void SetReadOnly( bool _bReadOnly );
111 :
112 : void SetClickListener( IButtonClickListener* _pListener );
113 :
114 : void IndentTitle( bool _bIndent );
115 :
116 : private:
117 : DECL_LINK( OnButtonClicked, PushButton* );
118 : DECL_LINK( OnButtonFocus, PushButton* );
119 :
120 : void implHideBrowseButton( bool _bPrimary, bool _bReLayout );
121 : void implUpdateEnabledDisabled();
122 :
123 : void impl_layoutComponents();
124 :
125 : PushButton& impl_ensureButton( bool _bPrimary );
126 : static void impl_getImagesFromURL_nothrow( const OUString& _rImageURL, Image& _out_rImage );
127 : };
128 :
129 :
130 : } // namespace pcr
131 :
132 :
133 : #endif // INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_BROWSERLINE_HXX
134 :
135 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|