Bump for 3.6-28
[LibreOffice.git] / extensions / source / propctrlr / browserline.hxx
blobbe88c81b3b01cceb765ee616e3045cde32dc361e
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;
56 protected:
57 ~IButtonClickListener() {}
60 //========================================================================
61 class OBrowserLine
63 private:
64 ::rtl::OUString m_sEntryName;
65 FixedText m_aFtTitle;
66 Size m_aOutputSize;
67 Point m_aLinePos;
68 ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >
69 m_xControl;
70 Window* m_pControlWindow;
71 PushButton* m_pBrowseButton;
72 PushButton* m_pAdditionalBrowseButton;
73 IButtonClickListener* m_pClickListener;
74 Window* m_pTheParent;
75 sal_uInt16 m_nNameWidth;
76 sal_uInt16 m_nEnableFlags;
77 bool m_bIndentTitle;
78 bool m_bReadOnly;
80 public:
81 OBrowserLine( const ::rtl::OUString& _rEntryName, Window* pParent);
82 ~OBrowserLine();
84 void setControl( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _rxControl );
85 const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& getControl() const
87 return m_xControl;
89 inline Window* getControlWindow() const
91 return m_pControlWindow;
94 const ::rtl::OUString&
95 GetEntryName() const { return m_sEntryName; }
97 void SetComponentHelpIds( const rtl::OString& _rHelpId, const rtl::OString& _sPrimaryButtonId, const rtl::OString& _sSecondaryButtonId );
99 void SetTitle(const String& rString );
100 void FullFillTitleString();
101 String GetTitle() const;
102 void SetTitleWidth(sal_uInt16);
104 void SetPosSizePixel(Point aPos,Size aSize);
105 void Show(sal_Bool bFlag=sal_True);
106 void Hide();
107 sal_Bool IsVisible();
109 Window* GetRefWindow();
110 void SetTabOrder(Window* pRefWindow, sal_uInt16 nFlags );
112 sal_Bool GrabFocus();
113 void ShowBrowseButton( const ::rtl::OUString& _rImageURL, sal_Bool _bPrimary );
114 void ShowBrowseButton( const Image& _rImage, sal_Bool _bPrimary );
115 void ShowBrowseButton( sal_Bool _bPrimary );
116 void HideBrowseButton( sal_Bool _bPrimary );
118 void EnablePropertyControls( sal_Int16 _nControls, bool _bEnable );
119 void EnablePropertyLine( bool _bEnable );
121 void SetReadOnly( bool _bReadOnly );
123 void SetClickListener( IButtonClickListener* _pListener );
125 void IndentTitle( bool _bIndent );
127 private:
128 DECL_LINK( OnButtonClicked, PushButton* );
129 DECL_LINK( OnButtonFocus, PushButton* );
131 void implHideBrowseButton( sal_Bool _bPrimary, bool _bReLayout );
132 void implUpdateEnabledDisabled();
134 void impl_layoutComponents();
136 PushButton& impl_ensureButton( bool _bPrimary );
137 void impl_getImagesFromURL_nothrow( const ::rtl::OUString& _rImageURL, Image& _out_rImage );
140 //............................................................................
141 } // namespace pcr
142 //............................................................................
144 #endif // _EXTENSIONS_PROPCTRLR_BROWSERLINE_HXX_
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */