LibreOffice Module extensions (master) 1
browserview.cxx
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#include "browserview.hxx"
21#include "propertyeditor.hxx"
22#include <helpids.h>
23#include <memory>
24
25namespace pcr
26{
27 using namespace ::com::sun::star::uno;
28 using namespace ::com::sun::star::lang;
29
30 OPropertyBrowserView::OPropertyBrowserView(const css::uno::Reference<css::uno::XComponentContext>& rContext, weld::Builder& rBuilder)
31 : m_xPropBox(new OPropertyEditor(rContext, rBuilder))
32 , m_nActivePage(0)
33 {
35 m_xPropBox->setPageActivationHandler(LINK(this, OPropertyBrowserView, OnPageActivation));
36 }
37
38 IMPL_LINK(OPropertyBrowserView, OnPageActivation, const OUString&, rNewPage, void)
39 {
40 m_nActivePage = rNewPage.toUInt32();
41 m_aPageActivationHandler.Call(nullptr);
42 }
43
45 {
46 sal_uInt16 nTmpPage = m_xPropBox->GetCurPage();
47 if (nTmpPage)
48 m_nActivePage = nTmpPage;
49 }
50
51 void OPropertyBrowserView::activatePage(sal_uInt16 _nPage)
52 {
53 m_nActivePage = _nPage;
55 }
56
58 {
59 ::Size aSize = m_xPropBox->get_preferred_size();
60 return css::awt::Size(aSize.Width(), aSize.Height());
61 }
62} // namespace pcr
63
64/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr tools::Long Height() const
constexpr tools::Long Width() const
css::awt::Size getMinimumSize() const
Definition: browserview.cxx:57
std::unique_ptr< OPropertyEditor, o3tl::default_delete< OPropertyEditor > > m_xPropBox
Definition: browserview.hxx:32
OPropertyBrowserView(const css::uno::Reference< css::uno::XComponentContext > &rContext, weld::Builder &rBuilder)
Definition: browserview.cxx:30
void activatePage(sal_uInt16 _nPage)
Definition: browserview.cxx:51
OPropertyEditor & getPropertyBox()
Definition: browserview.hxx:40
void SetPage(sal_uInt16)
constexpr OUStringLiteral HID_FM_PROPDLG_TABCTR
Definition: helpids.h:296
a property handler for any virtual string properties
Definition: browserline.cxx:39
IMPL_LINK(OBrowserLine, OnButtonClicked, weld::Button &, rButton, void)