bump product version to 4.1.6.2
[LibreOffice.git] / dbaccess / source / ui / dlg / dbfindex.hxx
blob9a299e14595e2a17e090f4885313b59fe10f755c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
28 #include <list>
29 #include <comphelper/stl_types.hxx>
31 //.........................................................................
32 namespace dbaui
34 //.........................................................................
36 //=========================================================================
37 //= OTableIndex
38 //=========================================================================
39 /// represents a single dbf index
40 class OTableIndex
42 private:
43 String aIndexFileName;
45 public:
46 OTableIndex() { }
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 //=========================================================================
59 //= OTableInfo
60 //=========================================================================
61 class ODbaseIndexDialog;
62 /** holds the INF file of a table
64 class OTableInfo
66 friend class ODbaseIndexDialog;
67 private:
68 String aTableName;
69 TableIndexList aIndexList;
71 public:
72 OTableInfo() { }
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 //////////////////////////////////////////////////////////////////////////
83 // IndexDialog
84 class ODbaseIndexDialog : public ModalDialog
86 protected:
87 OKButton aPB_OK;
88 CancelButton aPB_CANCEL;
89 HelpButton aPB_HELP;
91 FixedText m_FT_Tables;
92 ComboBox aCB_Tables;
94 FixedLine m_FL_Indexes;
96 FixedText m_FT_TableIndexes;
97 ListBox aLB_TableIndexes;
99 FixedText m_FT_AllIndexes;
100 ListBox aLB_FreeIndexes;
102 ImageButton aIB_Add;
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* );
115 String m_aDSN;
116 TableInfoList m_aTableInfoList;
117 TableIndexList m_aFreeIndexList;
118 sal_Bool m_bCaseSensitiv;
120 void Init();
121 void SetCtrls();
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 );
132 void checkButtons();
134 public:
135 ODbaseIndexDialog( Window * pParent, String aDataSrcName );
136 virtual ~ODbaseIndexDialog();
139 //.........................................................................
140 } // namespace dbaui
141 //.........................................................................
143 #endif // _DBAUI_DBFINDEX_HXX_
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */