LibreOffice Module extensions (master) 1
gridwizard.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 "controlwizard.hxx"
23#include "commonpagesdbp.hxx"
24
27
28namespace dbp
29{
31 {
32 css::uno::Sequence< OUString > aSelectedFields;
33 };
34
35 class OGridWizard final : public OControlWizard
36 {
39
40 public:
41 OGridWizard(weld::Window* _pParent,
42 const css::uno::Reference< css::beans::XPropertySet >& _rxObjectModel,
43 const css::uno::Reference< css::uno::XComponentContext >& _rxContext);
44
46
47 private:
48 // OWizardMachine overridables
49 virtual std::unique_ptr<BuilderPage> createPage( WizardState _nState ) override;
50 virtual WizardState determineNextState( WizardState _nCurrentState ) const override;
51 virtual void enterState( WizardState _nState ) override;
52 virtual bool leaveState( WizardState _nState ) override;
53 virtual bool onFinish() override;
54
55 virtual bool approveControl(sal_Int16 _nClassId) override;
56
57 void implApplySettings();
58 };
59
61 {
62 public:
63 OGridPage(weld::Container* pPage, OGridWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID)
64 : OControlWizardPage(pPage, pWizard, rUIXMLDescription, rID)
65 {
66 }
67 protected:
68 OGridSettings& getSettings() { return static_cast<OGridWizard*>(getDialog())->getSettings(); }
69 };
70
71 class OGridFieldsSelection final : public OGridPage
72 {
73 std::unique_ptr<weld::TreeView> m_xExistFields;
74 std::unique_ptr<weld::Button> m_xSelectOne;
75 std::unique_ptr<weld::Button> m_xSelectAll;
76 std::unique_ptr<weld::Button> m_xDeselectOne;
77 std::unique_ptr<weld::Button> m_xDeselectAll;
78 std::unique_ptr<weld::TreeView> m_xSelFields;
79
80 public:
81 explicit OGridFieldsSelection(weld::Container* pPage, OGridWizard* pWizard);
82 virtual ~OGridFieldsSelection() override;
83
84 private:
85 // BuilderPage overridables
86 virtual void Activate() override;
87
88 // OWizardPage overridables
89 virtual void initializePage() override;
90 virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
91 virtual bool canAdvance() const override;
92
93 DECL_LINK(OnMoveOneEntry, weld::Button&, void);
94 DECL_LINK(OnMoveAllEntries, weld::Button&, void);
95 DECL_LINK(OnEntrySelected, weld::TreeView&, void);
96 DECL_LINK(OnEntryDoubleClicked, weld::TreeView&, bool);
97
98 void implCheckButtons();
99 };
100} // namespace dbp
101
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OControlWizard * getDialog()
DECL_LINK(OnEntrySelected, weld::TreeView &, void)
std::unique_ptr< weld::Button > m_xDeselectAll
Definition: gridwizard.hxx:77
std::unique_ptr< weld::TreeView > m_xExistFields
Definition: gridwizard.hxx:73
DECL_LINK(OnEntryDoubleClicked, weld::TreeView &, bool)
virtual ~OGridFieldsSelection() override
Definition: gridwizard.cxx:304
OGridFieldsSelection(weld::Container *pPage, OGridWizard *pWizard)
Definition: gridwizard.cxx:282
virtual void Activate() override
Definition: gridwizard.cxx:308
std::unique_ptr< weld::TreeView > m_xSelFields
Definition: gridwizard.hxx:78
std::unique_ptr< weld::Button > m_xDeselectOne
Definition: gridwizard.hxx:76
virtual bool commitPage(::vcl::WizardTypes::CommitPageReason _eReason) override
Definition: gridwizard.cxx:340
virtual bool canAdvance() const override
Definition: gridwizard.cxx:314
virtual void initializePage() override
Definition: gridwizard.cxx:320
DECL_LINK(OnMoveAllEntries, weld::Button &, void)
DECL_LINK(OnMoveOneEntry, weld::Button &, void)
std::unique_ptr< weld::Button > m_xSelectOne
Definition: gridwizard.hxx:74
std::unique_ptr< weld::Button > m_xSelectAll
Definition: gridwizard.hxx:75
OGridSettings & getSettings()
Definition: gridwizard.hxx:68
OGridPage(weld::Container *pPage, OGridWizard *pWizard, const OUString &rUIXMLDescription, const OUString &rID)
Definition: gridwizard.hxx:63
virtual bool leaveState(WizardState _nState) override
Definition: gridwizard.cxx:260
bool m_bHadDataSelection
Definition: gridwizard.hxx:38
virtual void enterState(WizardState _nState) override
Definition: gridwizard.cxx:246
OGridSettings & getSettings()
Definition: gridwizard.hxx:45
void implApplySettings()
Definition: gridwizard.cxx:80
virtual bool onFinish() override
Definition: gridwizard.cxx:272
virtual std::unique_ptr< BuilderPage > createPage(WizardState _nState) override
Definition: gridwizard.cxx:217
virtual WizardState determineNextState(WizardState _nCurrentState) const override
Definition: gridwizard.cxx:233
virtual bool approveControl(sal_Int16 _nClassId) override
Definition: gridwizard.cxx:71
OGridWizard(weld::Window *_pParent, const css::uno::Reference< css::beans::XPropertySet > &_rxObjectModel, const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
Definition: gridwizard.cxx:50
OGridSettings m_aSettings
Definition: gridwizard.hxx:37
sal_Int16 WizardState
css::uno::Sequence< OUString > aSelectedFields
Definition: gridwizard.hxx:32