1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_DBACCESS_SOURCE_UI_DLG_DBFINDEX_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_DLG_DBFINDEX_HXX
23 #include <vcl/dialog.hxx>
24 #include <vcl/button.hxx>
25 #include <vcl/combobox.hxx>
26 #include <vcl/layout.hxx>
27 #include <vcl/lstbox.hxx>
28 #include <vcl/fixed.hxx>
35 /// represents a single dbf index
39 OUString aIndexFileName
;
43 OTableIndex( const OTableIndex
& _rSource
) : aIndexFileName(_rSource
.aIndexFileName
) { }
44 OTableIndex( const OUString
& rFileName
) : aIndexFileName( rFileName
) { }
46 void SetIndexFileName( const OUString
& rFileName
) { aIndexFileName
= rFileName
; }
47 OUString
GetIndexFileName() const { return aIndexFileName
; }
50 typedef ::std::list
< OTableIndex
> TableIndexList
;
53 class ODbaseIndexDialog
;
54 /** holds the INF file of a table
58 friend class ODbaseIndexDialog
;
61 TableIndexList aIndexList
;
65 OTableInfo( const OUString
& rName
) : aTableName(rName
) { }
67 void WriteInfFile( const OUString
& rDSN
) const;
70 typedef ::std::list
< OTableInfo
> TableInfoList
;
73 class ODbaseIndexDialog
: public ModalDialog
76 VclPtr
<OKButton
> m_pPB_OK
;
77 VclPtr
<ComboBox
> m_pCB_Tables
;
78 VclPtr
<VclContainer
> m_pIndexes
;
79 VclPtr
<ListBox
> m_pLB_TableIndexes
;
80 VclPtr
<ListBox
> m_pLB_FreeIndexes
;
82 VclPtr
<PushButton
> m_pAdd
;
83 VclPtr
<PushButton
> m_pRemove
;
84 VclPtr
<PushButton
> m_pAddAll
;
85 VclPtr
<PushButton
> m_pRemoveAll
;
87 DECL_LINK( TableSelectHdl
, ComboBox
* );
88 DECL_LINK( AddClickHdl
, PushButton
* );
89 DECL_LINK( RemoveClickHdl
, PushButton
* );
90 DECL_LINK( AddAllClickHdl
, PushButton
* );
91 DECL_LINK( RemoveAllClickHdl
, PushButton
* );
92 DECL_LINK( OKClickHdl
, PushButton
* );
93 DECL_LINK( OnListEntrySelected
, ListBox
* );
96 TableInfoList m_aTableInfoList
;
97 TableIndexList m_aFreeIndexList
;
102 bool GetTable(const OUString
& rName
, TableInfoList::iterator
& _rPosition
);
104 OTableIndex
implRemoveIndex(const OUString
& _rName
, TableIndexList
& _rList
, ListBox
& _rDisplay
, bool _bMustExist
);
105 static void implInsertIndex(const OTableIndex
& _rIndex
, TableIndexList
& _rList
, ListBox
& _rDisplay
);
107 OTableIndex
RemoveFreeIndex( const OUString
& _rName
, bool _bMustExist
) { return implRemoveIndex(_rName
, m_aFreeIndexList
, *m_pLB_FreeIndexes
, _bMustExist
); }
108 void InsertFreeIndex( const OTableIndex
& _rIndex
) { implInsertIndex(_rIndex
, m_aFreeIndexList
, *m_pLB_FreeIndexes
); }
109 OTableIndex
RemoveTableIndex( const OUString
& _rTableName
, const OUString
& _rIndexName
, bool _bMustExist
);
110 void InsertTableIndex( const OUString
& _rTableName
, const OTableIndex
& _rIndex
);
115 ODbaseIndexDialog( vcl::Window
* pParent
, const OUString
& aDataSrcName
);
116 virtual ~ODbaseIndexDialog();
117 virtual void dispose() SAL_OVERRIDE
;
122 #endif // INCLUDED_DBACCESS_SOURCE_UI_DLG_DBFINDEX_HXX
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */