LibreOffice Module dbaccess (master) 1
dbfindex.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 <utility>
23#include <vcl/weld.hxx>
24#include <deque>
25
26namespace dbaui
27{
28
29// OTableIndex
32{
33private:
35
36public:
38 explicit OTableIndex( OUString aFileName ) : aIndexFileName(std::move( aFileName )) { }
39
40 const OUString& GetIndexFileName() const { return aIndexFileName; }
41};
42
43typedef std::deque< OTableIndex > TableIndexList;
44
45// OTableInfo
50{
51 friend class ODbaseIndexDialog;
52private:
53 OUString aTableName;
55
56public:
57 explicit OTableInfo( OUString aName ) : aTableName(std::move(aName)) { }
58
59 void WriteInfFile( const OUString& rDSN ) const;
60};
61
62typedef std::deque< OTableInfo > TableInfoList;
63
64// IndexDialog
66{
67 OUString m_aDSN;
70
71 std::unique_ptr<weld::Button> m_xPB_OK;
72 std::unique_ptr<weld::ComboBox> m_xCB_Tables;
73 std::unique_ptr<weld::Widget> m_xIndexes;
74 std::unique_ptr<weld::TreeView> m_xLB_TableIndexes;
75 std::unique_ptr<weld::TreeView> m_xLB_FreeIndexes;
76
77 std::unique_ptr<weld::Button> m_xAdd;
78 std::unique_ptr<weld::Button> m_xRemove;
79 std::unique_ptr<weld::Button> m_xAddAll;
80 std::unique_ptr<weld::Button> m_xRemoveAll;
81
82 DECL_LINK( TableSelectHdl, weld::ComboBox&, void );
83 DECL_LINK( AddClickHdl, weld::Button&, void );
84 DECL_LINK( RemoveClickHdl, weld::Button&, void );
85 DECL_LINK( AddAllClickHdl, weld::Button&, void );
86 DECL_LINK( RemoveAllClickHdl, weld::Button&, void );
87 DECL_LINK( OKClickHdl, weld::Button&, void );
88 DECL_LINK( OnListEntrySelected, weld::TreeView&, void );
89
90protected:
91 void Init();
92 void SetCtrls();
93
94 static OTableIndex implRemoveIndex(const OUString& _rName, TableIndexList& _rList, weld::TreeView& _rDisplay, bool _bMustExist);
95 static void implInsertIndex(const OTableIndex& _rIndex, TableIndexList& _rList, weld::TreeView& _rDisplay);
96
97 OTableIndex RemoveFreeIndex( const OUString& _rName, bool _bMustExist ) { return implRemoveIndex(_rName, m_aFreeIndexList, *m_xLB_FreeIndexes, _bMustExist); }
99 OTableIndex RemoveTableIndex( std::u16string_view _rTableName, const OUString& _rIndexName );
100 void InsertTableIndex( std::u16string_view _rTableName, const OTableIndex& _rIndex );
101
102 void checkButtons();
103
104public:
105 ODbaseIndexDialog(weld::Window * pParent, OUString aDataSrcName);
106 virtual ~ODbaseIndexDialog() override;
107};
108
109} // namespace dbaui
110
111/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DECL_LINK(RemoveAllClickHdl, weld::Button &, void)
virtual ~ODbaseIndexDialog() override
Definition: dbfindex.cxx:75
TableInfoList m_aTableInfoList
Definition: dbfindex.hxx:68
std::unique_ptr< weld::Button > m_xAddAll
Definition: dbfindex.hxx:79
DECL_LINK(OKClickHdl, weld::Button &, void)
ODbaseIndexDialog(weld::Window *pParent, OUString aDataSrcName)
Definition: dbfindex.cxx:43
std::unique_ptr< weld::Button > m_xRemoveAll
Definition: dbfindex.hxx:80
std::unique_ptr< weld::TreeView > m_xLB_FreeIndexes
Definition: dbfindex.hxx:75
DECL_LINK(AddClickHdl, weld::Button &, void)
DECL_LINK(RemoveClickHdl, weld::Button &, void)
DECL_LINK(AddAllClickHdl, weld::Button &, void)
void InsertTableIndex(std::u16string_view _rTableName, const OTableIndex &_rIndex)
Definition: dbfindex.cxx:134
std::unique_ptr< weld::Button > m_xRemove
Definition: dbfindex.hxx:78
static void implInsertIndex(const OTableIndex &_rIndex, TableIndexList &_rList, weld::TreeView &_rDisplay)
Definition: dbfindex.cxx:113
DECL_LINK(OnListEntrySelected, weld::TreeView &, void)
void InsertFreeIndex(const OTableIndex &_rIndex)
Definition: dbfindex.hxx:98
OTableIndex RemoveFreeIndex(const OUString &_rName, bool _bMustExist)
Definition: dbfindex.hxx:97
std::unique_ptr< weld::Button > m_xAdd
Definition: dbfindex.hxx:77
static OTableIndex implRemoveIndex(const OUString &_rName, TableIndexList &_rList, weld::TreeView &_rDisplay, bool _bMustExist)
Definition: dbfindex.cxx:88
std::unique_ptr< weld::TreeView > m_xLB_TableIndexes
Definition: dbfindex.hxx:74
OTableIndex RemoveTableIndex(std::u16string_view _rTableName, const OUString &_rIndexName)
Definition: dbfindex.cxx:120
DECL_LINK(TableSelectHdl, weld::ComboBox &, void)
TableIndexList m_aFreeIndexList
Definition: dbfindex.hxx:69
std::unique_ptr< weld::Button > m_xPB_OK
Definition: dbfindex.hxx:71
std::unique_ptr< weld::Widget > m_xIndexes
Definition: dbfindex.hxx:73
std::unique_ptr< weld::ComboBox > m_xCB_Tables
Definition: dbfindex.hxx:72
represents a single dbf index
Definition: dbfindex.hxx:32
OTableIndex(OUString aFileName)
Definition: dbfindex.hxx:38
OUString aIndexFileName
Definition: dbfindex.hxx:34
const OUString & GetIndexFileName() const
Definition: dbfindex.hxx:40
holds the INF file of a table
Definition: dbfindex.hxx:50
void WriteInfFile(const OUString &rDSN) const
Definition: dbfindex.cxx:352
TableIndexList aIndexList
Definition: dbfindex.hxx:54
OUString aTableName
Definition: dbfindex.hxx:53
OTableInfo(OUString aName)
Definition: dbfindex.hxx:57
OUString aName
std::deque< OTableIndex > TableIndexList
Definition: dbfindex.hxx:43
std::deque< OTableInfo > TableInfoList
Definition: dbfindex.hxx:62