LibreOffice Module dbaccess (master) 1
indexdialog.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/container/XNameAccess.hpp>
23#include <com/sun/star/sdbc/XConnection.hpp>
24#include <com/sun/star/uno/Sequence.hxx>
25#include <com/sun/star/uno/XComponentContext.hpp>
26#include <vcl/weld.hxx>
27#include "indexes.hxx"
28
29namespace dbaui
30{
31 // DbaIndexDialog
32 class IndexFieldsControl;
33 class OIndexCollection;
35 {
36 css::uno::Reference< css::sdbc::XConnection > m_xConnection;
37
38 std::unique_ptr<OIndexCollection> m_xIndexes;
39 std::unique_ptr<weld::TreeIter> m_xPreviousSelection;
43
44 css::uno::Reference< css::uno::XComponentContext >
46
47 std::unique_ptr<weld::Toolbar> m_xActions;
48 std::unique_ptr<weld::TreeView> m_xIndexList;
49 std::unique_ptr<weld::Label> m_xIndexDetails;
50 std::unique_ptr<weld::Label> m_xDescriptionLabel;
51 std::unique_ptr<weld::Label> m_xDescription;
52 std::unique_ptr<weld::CheckButton> m_xUnique;
53 std::unique_ptr<weld::Label> m_xFieldsLabel;
54 std::unique_ptr<weld::Button> m_xClose;
55 std::unique_ptr<weld::Container> m_xTable;
56 css::uno::Reference<css::awt::XWindow> m_xTableCtrlParent;
58
59 public:
61 weld::Window* _pParent,
62 const css::uno::Sequence< OUString >& _rFieldNames,
63 const css::uno::Reference< css::container::XNameAccess >& _rxIndexes,
64 const css::uno::Reference< css::sdbc::XConnection >& _rxConnection,
65 const css::uno::Reference< css::uno::XComponentContext >& _rxContext);
66 virtual ~DbaIndexDialog() override;
67
68 typedef std::pair<const weld::TreeIter&, OUString> IterString;
69 private:
70 void fillIndexList();
71 void updateToolbox();
72 void updateControls(const weld::TreeIter* pEntry);
73
74 void IndexSelected();
75
76 DECL_LINK( OnIndexSelected, weld::TreeView&, void );
77 DECL_LINK( OnIndexAction, const OUString&, void );
78 DECL_LINK( OnEntryEditing, const weld::TreeIter&, bool );
79 DECL_LINK( OnEntryEdited, const IterString&, bool );
80 DECL_LINK( OnModifiedClick, weld::Toggleable&, void );
81 DECL_LINK( OnModified, IndexFieldsControl&, void );
82 DECL_LINK( OnCloseDialog, weld::Button&, void );
83
84 DECL_LINK( OnEditIndexAgain, void*, void );
85
86 void OnNewIndex();
87 void OnDropIndex(bool _bConfirm = true);
88 void OnRenameIndex();
89 void OnSaveIndex();
90 void OnResetIndex();
91
92 bool implCommit(const weld::TreeIter* pEntry);
93 bool implSaveModified(bool _bPlausibility = true);
95
96 bool implDropIndex(const weld::TreeIter* pEntry, bool _bRemoveFromCollection);
97
98 bool implCheckPlausibility(const Indexes::const_iterator& _rPos);
99 };
100
101} // namespace dbaui
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Container > m_xTable
Definition: indexdialog.hxx:55
DECL_LINK(OnModifiedClick, weld::Toggleable &, void)
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: indexdialog.hxx:45
css::uno::Reference< css::awt::XWindow > m_xTableCtrlParent
Definition: indexdialog.hxx:56
std::unique_ptr< OIndexCollection > m_xIndexes
Definition: indexdialog.hxx:38
virtual ~DbaIndexDialog() override
bool implCommitPreviouslySelected()
std::unique_ptr< weld::Label > m_xDescription
Definition: indexdialog.hxx:51
css::uno::Reference< css::sdbc::XConnection > m_xConnection
Definition: indexdialog.hxx:36
std::unique_ptr< weld::Label > m_xDescriptionLabel
Definition: indexdialog.hxx:50
DECL_LINK(OnCloseDialog, weld::Button &, void)
DECL_LINK(OnIndexAction, const OUString &, void)
DECL_LINK(OnEditIndexAgain, void *, void)
DECL_LINK(OnIndexSelected, weld::TreeView &, void)
std::unique_ptr< weld::Toolbar > m_xActions
Definition: indexdialog.hxx:47
std::pair< const weld::TreeIter &, OUString > IterString
Definition: indexdialog.hxx:68
std::unique_ptr< weld::Button > m_xClose
Definition: indexdialog.hxx:54
void updateControls(const weld::TreeIter *pEntry)
DbaIndexDialog(weld::Window *_pParent, const css::uno::Sequence< OUString > &_rFieldNames, const css::uno::Reference< css::container::XNameAccess > &_rxIndexes, const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
Definition: indexdialog.cxx:64
DECL_LINK(OnEntryEdited, const IterString &, bool)
DECL_LINK(OnEntryEditing, const weld::TreeIter &, bool)
std::unique_ptr< weld::Label > m_xIndexDetails
Definition: indexdialog.hxx:49
bool implDropIndex(const weld::TreeIter *pEntry, bool _bRemoveFromCollection)
std::unique_ptr< weld::TreeIter > m_xPreviousSelection
Definition: indexdialog.hxx:39
std::unique_ptr< weld::TreeView > m_xIndexList
Definition: indexdialog.hxx:48
void OnDropIndex(bool _bConfirm=true)
bool implSaveModified(bool _bPlausibility=true)
VclPtr< IndexFieldsControl > m_xFields
Definition: indexdialog.hxx:57
std::unique_ptr< weld::CheckButton > m_xUnique
Definition: indexdialog.hxx:52
DECL_LINK(OnModified, IndexFieldsControl &, void)
bool implCheckPlausibility(const Indexes::const_iterator &_rPos)
bool implCommit(const weld::TreeIter *pEntry)
std::unique_ptr< weld::Label > m_xFieldsLabel
Definition: indexdialog.hxx:53