LibreOffice Module extensions (master) 1
browserline.hxx
Go to the documentation of this file.
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#pragma once
21
22#include <com/sun/star/inspection/XPropertyControl.hpp>
23#include <vcl/weld.hxx>
24
26{
27 const sal_Int16 CompleteLine = 0x4000;
28}
29
30
31namespace pcr
32{
33
34
35 class OBrowserLine;
36
37
39 {
40 public:
41 virtual void buttonClicked( OBrowserLine* pLine, bool bPrimary ) = 0;
42
43 protected:
45 };
46
47
49 {
50 private:
51 OUString m_sEntryName;
52 std::unique_ptr<weld::Builder> m_xBuilder;
53 std::unique_ptr<weld::Container> m_xContainer;
54 std::unique_ptr<weld::Label> m_xFtTitle;
55 std::unique_ptr<weld::Button> m_xBrowseButton;
56 std::unique_ptr<weld::Button> m_xAdditionalBrowseButton;
57 css::uno::Reference< css::inspection::XPropertyControl >
65 sal_uInt16 m_nNameWidth;
66 sal_uInt16 m_nEnableFlags;
69
70 public:
71 OBrowserLine(OUString aEntryName, weld::Container* pParent, weld::SizeGroup* pLabelGroup,
72 weld::Container* pInitialControlParent);
74
75 void setControl( const css::uno::Reference< css::inspection::XPropertyControl >& rxControl );
76 const css::uno::Reference< css::inspection::XPropertyControl >& getControl() const
77 {
78 return m_xControl;
79 }
81 {
82 return m_pControlWindow;
83 }
84
85 const OUString& GetEntryName() const { return m_sEntryName; }
86
87 void SetComponentHelpIds(const OUString& rHelpId);
88
89 void SetTitle(const OUString& rString );
91 OUString GetTitle() const;
92 void SetTitleWidth(sal_uInt16);
93
94 int GetRowHeight() const { return m_xContainer->get_preferred_size().Height(); }
95 void Show(bool bFlag=true);
96 void Hide();
97
98 bool GrabFocus();
99 void ShowBrowseButton( const OUString& rImageURL, bool bPrimary );
100 void ShowBrowseButton( const css::uno::Reference<css::graphic::XGraphic>& rGraphic, bool bPrimary );
101 void ShowBrowseButton( bool bPrimary );
102 void HideBrowseButton( bool bPrimary );
103
104 void EnablePropertyControls( sal_Int16 nControls, bool bEnable );
105 void EnablePropertyLine( bool bEnable );
106
107 void SetReadOnly( bool bReadOnly );
108
109 void SetClickListener( IButtonClickListener* pListener );
110
111 void IndentTitle( bool bIndent );
112
113 private:
114 DECL_LINK( OnButtonClicked, weld::Button&, void );
115 DECL_LINK( OnButtonFocus, weld::Widget&, void );
116
117 void implHideBrowseButton(bool bPrimary);
119
120 weld::Button& impl_ensureButton(bool bPrimary);
121 };
122
123
124} // namespace pcr
125
126
127/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void buttonClicked(OBrowserLine *pLine, bool bPrimary)=0
sal_uInt16 m_nNameWidth
Definition: browserline.hxx:65
OUString m_sEntryName
Definition: browserline.hxx:51
DECL_LINK(OnButtonFocus, weld::Widget &, void)
css::uno::Reference< css::inspection::XPropertyControl > m_xControl
Definition: browserline.hxx:58
OUString GetTitle() const
std::unique_ptr< weld::Button > m_xBrowseButton
Definition: browserline.hxx:55
const css::uno::Reference< css::inspection::XPropertyControl > & getControl() const
Definition: browserline.hxx:76
OBrowserLine(OUString aEntryName, weld::Container *pParent, weld::SizeGroup *pLabelGroup, weld::Container *pInitialControlParent)
Definition: browserline.cxx:54
void setControl(const css::uno::Reference< css::inspection::XPropertyControl > &rxControl)
weld::Container * m_pInitialControlParent
Definition: browserline.hxx:59
weld::Button * m_pAdditionalBrowseButton
Definition: browserline.hxx:63
void EnablePropertyControls(sal_Int16 nControls, bool bEnable)
std::unique_ptr< weld::Builder > m_xBuilder
Definition: browserline.hxx:52
void implUpdateEnabledDisabled()
IButtonClickListener * m_pClickListener
Definition: browserline.hxx:64
void HideBrowseButton(bool bPrimary)
void SetTitle(const OUString &rString)
std::unique_ptr< weld::Container > m_xContainer
Definition: browserline.hxx:53
DECL_LINK(OnButtonClicked, weld::Button &, void)
void implHideBrowseButton(bool bPrimary)
weld::Button & impl_ensureButton(bool bPrimary)
void SetClickListener(IButtonClickListener *pListener)
std::unique_ptr< weld::Button > m_xAdditionalBrowseButton
Definition: browserline.hxx:56
weld::Widget * getControlWindow() const
Definition: browserline.hxx:80
void IndentTitle(bool bIndent)
Definition: browserline.cxx:83
const OUString & GetEntryName() const
Definition: browserline.hxx:85
void EnablePropertyLine(bool bEnable)
void Show(bool bFlag=true)
void FullFillTitleString()
void SetTitleWidth(sal_uInt16)
void SetReadOnly(bool bReadOnly)
weld::Container * m_pParent
Definition: browserline.hxx:60
weld::Button * m_pBrowseButton
Definition: browserline.hxx:62
std::unique_ptr< weld::Label > m_xFtTitle
Definition: browserline.hxx:54
int GetRowHeight() const
Definition: browserline.hxx:94
sal_uInt16 m_nEnableFlags
Definition: browserline.hxx:66
void ShowBrowseButton(const OUString &rImageURL, bool bPrimary)
void SetComponentHelpIds(const OUString &rHelpId)
Definition: browserline.cxx:91
weld::Widget * m_pControlWindow
Definition: browserline.hxx:61
a property handler for any virtual string properties
Definition: browserline.cxx:39