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_INDEXFIELDSCONTROL_HXX_
21 #define _DBAUI_INDEXFIELDSCONTROL_HXX_
23 #include "moduledbu.hxx"
24 #include <svtools/editbrowsebox.hxx>
25 #include "indexcollection.hxx"
26 #include <com/sun/star/uno/Sequence.hxx>
28 //......................................................................
31 //......................................................................
33 //==================================================================
35 //==================================================================
36 class IndexFieldsControl
: public ::svt::EditBrowseBox
38 OModuleClient m_aModuleClient
;
40 IndexFields m_aSavedValue
;
42 IndexFields m_aFields
; // !! order matters !!
43 ConstIndexFieldsIterator m_aSeekRow
; // !!
47 ::svt::ListBoxControl
* m_pSortingCell
;
48 ::svt::ListBoxControl
* m_pFieldNameCell
;
50 String m_sAscendingText
;
51 String m_sDescendingText
;
53 sal_Int32 m_nMaxColumnsInIndex
;
54 sal_Bool m_bAddIndexAppendix
;
57 IndexFieldsControl( Window
* _pParent
, const ResId
& _rId
,sal_Int32 _nMaxColumnsInIndex
,sal_Bool _bAddIndexAppendix
);
58 ~IndexFieldsControl();
60 void Init(const ::com::sun::star::uno::Sequence
< OUString
>& _rAvailableFields
);
62 void initializeFrom(const IndexFields
& _rFields
);
63 void commitTo(IndexFields
& _rFields
);
65 sal_Bool
SaveModified();
66 sal_Bool
IsModified() const;
68 const IndexFields
& GetSavedValue() const { return m_aSavedValue
; }
69 void SaveValue() { m_aSavedValue
= m_aFields
; }
71 void SetModifyHdl(const Link
& _rHdl
) { m_aModifyHdl
= _rHdl
; }
72 Link
GetModifyHdl() const { return m_aModifyHdl
; }
73 virtual String
GetCellText(long _nRow
,sal_uInt16 nColId
) const;
76 // EditBrowseBox overridables
77 virtual void PaintCell( OutputDevice
& _rDev
, const Rectangle
& _rRect
, sal_uInt16 _nColumnId
) const;
78 virtual sal_Bool
SeekRow(long nRow
);
79 virtual sal_uInt32
GetTotalCellWidth(long nRow
, sal_uInt16 nColId
);
80 virtual sal_Bool
IsTabAllowed(sal_Bool bForward
) const;
82 ::svt::CellController
* GetController(long _nRow
, sal_uInt16 _nColumnId
);
83 void InitController(::svt::CellControllerRef
&, long _nRow
, sal_uInt16 _nColumnId
);
86 String
GetRowCellText(const ConstIndexFieldsIterator
& _rRow
,sal_uInt16 nColId
) const;
87 sal_Bool
implGetFieldDesc(long _nRow
, ConstIndexFieldsIterator
& _rPos
);
89 sal_Bool
isNewField() const { return GetCurRow() >= (sal_Int32
)m_aFields
.size(); }
91 DECL_LINK( OnListEntrySelected
, ListBox
* );
94 using ::svt::EditBrowseBox::Init
;
97 //......................................................................
99 //......................................................................
101 #endif // _DBAUI_INDEXFIELDSCONTROL_HXX_
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */