LibreOffice Module dbaccess (master) 1
indexfieldscontrol.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
23#include <com/sun/star/awt/XWindow.hpp>
24#include <com/sun/star/uno/Sequence.hxx>
25#include "indexes.hxx"
26
27namespace dbaui
28{
29
30 class DbaMouseDownListBoxController;
31
32 // IndexFieldsControl
34 {
36
37 IndexFields m_aFields; // !! order matters !!
38 IndexFields::const_iterator m_aSeekRow; // !!
39
41
44
47
49
50 public:
51 IndexFieldsControl(const css::uno::Reference<css::awt::XWindow> &rParent);
52 virtual ~IndexFieldsControl() override;
53 virtual void dispose() override;
54
55 void Init(const css::uno::Sequence< OUString >& _rAvailableFields, bool _bAddIndexAppendix);
56
57 void initializeFrom(IndexFields&& _rFields);
58 void commitTo(IndexFields& _rFields);
59
60 bool SaveModified() override;
62
63 const IndexFields& GetSavedValue() const { return m_aSavedValue; }
65
67 virtual OUString GetCellText(sal_Int32 _nRow,sal_uInt16 nColId) const override;
68
69 private:
70 // EditBrowseBox overridables
71 virtual void PaintCell( OutputDevice& _rDev, const tools::Rectangle& _rRect, sal_uInt16 _nColumnId ) const override;
72 virtual bool SeekRow(sal_Int32 nRow) override;
73 virtual sal_uInt32 GetTotalCellWidth(sal_Int32 nRow, sal_uInt16 nColId) override;
74 virtual bool IsTabAllowed(bool bForward) const override;
75
76 ::svt::CellController* GetController(sal_Int32 _nRow, sal_uInt16 _nColumnId) override;
77 void InitController(::svt::CellControllerRef&, sal_Int32 _nRow, sal_uInt16 _nColumnId) override;
78
79 OUString GetRowCellText(const IndexFields::const_iterator& _rRow,sal_uInt16 nColId) const;
80 bool implGetFieldDesc(sal_Int32 _nRow, IndexFields::const_iterator& _rPos);
81
82 bool isNewField() const { return GetCurRow() >= static_cast<sal_Int32>(m_aFields.size()); }
83
84 DECL_LINK( OnListEntrySelected, DbaMouseDownListBoxController&, void );
85
86 using ::svt::EditBrowseBox::Init;
87 };
88
89} // namespace dbaui
90
91/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 GetCurRow() const
Link< IndexFieldsControl &, void > m_aModifyHdl
virtual void dispose() override
IndexFields::const_iterator m_aSeekRow
void initializeFrom(IndexFields &&_rFields)
VclPtr< ::svt::ListBoxControl > m_pSortingCell
void SetModifyHdl(const Link< IndexFieldsControl &, void > &_rHdl)
const IndexFields & GetSavedValue() const
OUString GetRowCellText(const IndexFields::const_iterator &_rRow, sal_uInt16 nColId) const
virtual sal_uInt32 GetTotalCellWidth(sal_Int32 nRow, sal_uInt16 nColId) override
IndexFieldsControl(const css::uno::Reference< css::awt::XWindow > &rParent)
virtual void PaintCell(OutputDevice &_rDev, const tools::Rectangle &_rRect, sal_uInt16 _nColumnId) const override
VclPtr< ::svt::ListBoxControl > m_pFieldNameCell
virtual OUString GetCellText(sal_Int32 _nRow, sal_uInt16 nColId) const override
virtual bool SeekRow(sal_Int32 nRow) override
void commitTo(IndexFields &_rFields)
DECL_LINK(OnListEntrySelected, DbaMouseDownListBoxController &, void)
virtual ~IndexFieldsControl() override
bool implGetFieldDesc(sal_Int32 _nRow, IndexFields::const_iterator &_rPos)
void InitController(::svt::CellControllerRef &, sal_Int32 _nRow, sal_uInt16 _nColumnId) override
::svt::CellController * GetController(sal_Int32 _nRow, sal_uInt16 _nColumnId) override
virtual bool IsTabAllowed(bool bForward) const override
virtual void Init()
virtual bool IsModified() const
std::vector< OIndexField > IndexFields
Definition: indexes.hxx:39