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 _DBAUI_DBFINDEX_HXX_
21 #define _DBAUI_DBFINDEX_HXX_
23 #include <vcl/dialog.hxx>
24 #include <vcl/button.hxx>
25 #include <vcl/combobox.hxx>
26 #include <vcl/lstbox.hxx>
27 #include <vcl/fixed.hxx>
29 #include <comphelper/stl_types.hxx>
31 //.........................................................................
34 //.........................................................................
36 //=========================================================================
38 //=========================================================================
39 /// represents a single dbf index
43 String aIndexFileName
;
47 OTableIndex( const OTableIndex
& _rSource
) : aIndexFileName(_rSource
.aIndexFileName
) { }
48 OTableIndex( const String
& rFileName
) : aIndexFileName( rFileName
) { }
50 void SetIndexFileName( const String
& rFileName
) { aIndexFileName
= rFileName
; }
51 String
GetIndexFileName() const { return aIndexFileName
; }
54 //-------------------------------------------------------------------------
55 typedef ::std::list
< OTableIndex
> TableIndexList
;
56 DECLARE_STL_ITERATORS(TableIndexList
);
58 //=========================================================================
60 //=========================================================================
61 class ODbaseIndexDialog
;
62 /** holds the INF file of a table
66 friend class ODbaseIndexDialog
;
69 TableIndexList aIndexList
;
73 OTableInfo( const String
& rName
) : aTableName(rName
) { }
75 void WriteInfFile( const String
& rDSN
) const;
78 //-------------------------------------------------------------------------
79 typedef ::std::list
< OTableInfo
> TableInfoList
;
80 DECLARE_STL_ITERATORS(TableInfoList
);
82 //////////////////////////////////////////////////////////////////////////
84 class ODbaseIndexDialog
: public ModalDialog
88 CancelButton aPB_CANCEL
;
91 FixedText m_FT_Tables
;
94 FixedLine m_FL_Indexes
;
96 FixedText m_FT_TableIndexes
;
97 ListBox aLB_TableIndexes
;
99 FixedText m_FT_AllIndexes
;
100 ListBox aLB_FreeIndexes
;
103 ImageButton aIB_Remove
;
104 ImageButton aIB_AddAll
;
105 ImageButton aIB_RemoveAll
;
107 DECL_LINK( TableSelectHdl
, ComboBox
* );
108 DECL_LINK( AddClickHdl
, PushButton
* );
109 DECL_LINK( RemoveClickHdl
, PushButton
* );
110 DECL_LINK( AddAllClickHdl
, PushButton
* );
111 DECL_LINK( RemoveAllClickHdl
, PushButton
* );
112 DECL_LINK( OKClickHdl
, PushButton
* );
113 DECL_LINK( OnListEntrySelected
, ListBox
* );
116 TableInfoList m_aTableInfoList
;
117 TableIndexList m_aFreeIndexList
;
118 sal_Bool m_bCaseSensitiv
;
122 sal_Bool
GetTable(const String
& rName
, TableInfoListIterator
& _rPosition
);
124 OTableIndex
implRemoveIndex(const String
& _rName
, TableIndexList
& _rList
, ListBox
& _rDisplay
, sal_Bool _bMustExist
);
125 void implInsertIndex(const OTableIndex
& _rIndex
, TableIndexList
& _rList
, ListBox
& _rDisplay
);
127 OTableIndex
RemoveFreeIndex( const String
& _rName
, sal_Bool _bMustExist
) { return implRemoveIndex(_rName
, m_aFreeIndexList
, aLB_FreeIndexes
, _bMustExist
); }
128 void InsertFreeIndex( const OTableIndex
& _rIndex
) { implInsertIndex(_rIndex
, m_aFreeIndexList
, aLB_FreeIndexes
); }
129 OTableIndex
RemoveTableIndex( const String
& _rTableName
, const String
& _rIndexName
, sal_Bool _bMustExist
);
130 void InsertTableIndex( const String
& _rTableName
, const OTableIndex
& _rIndex
);
135 ODbaseIndexDialog( Window
* pParent
, String aDataSrcName
);
136 virtual ~ODbaseIndexDialog();
139 //.........................................................................
141 //.........................................................................
143 #endif // _DBAUI_DBFINDEX_HXX_
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */