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_CUI_SOURCE_INC_DBREGISTER_HXX
21 #define INCLUDED_CUI_SOURCE_INC_DBREGISTER_HXX
23 #include <rtl/ustring.hxx>
24 #include <sfx2/basedlgs.hxx>
25 #include <sfx2/tabdlg.hxx>
30 class DbRegistrationOptionsPage
: public SfxTabPage
33 sal_uLong m_nOldCount
;
36 std::unique_ptr
<weld::Button
> m_xNew
;
37 std::unique_ptr
<weld::Button
> m_xEdit
;
38 std::unique_ptr
<weld::Button
> m_xDelete
;
39 std::unique_ptr
<weld::TreeView
> m_xPathBox
;
40 std::unique_ptr
<weld::TreeIter
> m_xIter
;
42 DECL_LINK( NewHdl
, weld::Button
&, void );
43 DECL_LINK( EditHdl
, weld::Button
&, void );
44 DECL_LINK( DeleteHdl
, weld::Button
&, void );
45 DECL_LINK( PathBoxDoubleClickHdl
, weld::TreeView
&, bool);
47 DECL_LINK( PathSelect_Impl
, weld::TreeView
&, void);
49 DECL_LINK( HeaderSelect_Impl
, int, void );
50 DECL_LINK( NameValidator
, const OUString
&, bool);
52 /** inserts a new entry in the tablistbox
54 The name of the entry.
56 The location of the file.
58 void insertNewEntry( const OUString
& _sName
,const OUString
& _sLocation
, const bool bReadOnly
);
60 /** opens the LinkDialog to create a register pair
62 The old name of the entry may be empty.
64 The old location of the entry may be empty.
66 The entry to remove if the entry will be changed
68 void openLinkDialog(const OUString
& sOldName
, const OUString
& sOldLocation
, int nEntry
= -1);
71 DbRegistrationOptionsPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rSet
);
72 virtual ~DbRegistrationOptionsPage() override
;
74 static std::unique_ptr
<SfxTabPage
> Create( weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* rSet
);
76 virtual bool FillItemSet( SfxItemSet
* rSet
) override
;
77 virtual void Reset( const SfxItemSet
* rSet
) override
;
78 virtual void FillUserData() override
;
81 /** helper for DatabaseRegistrationDialog
83 Necessary so that DatabaseRegistrationDialog is self-contained, i.e. always reflects
84 the current registration state.
86 class RegistrationItemSetHolder
89 SfxItemSet m_aRegistrationItems
;
92 RegistrationItemSetHolder( const SfxItemSet
& _rMasterSet
);
93 ~RegistrationItemSetHolder();
96 const SfxItemSet
& getRegistrationItems() const { return m_aRegistrationItems
; }
99 class DatabaseRegistrationDialog
:public RegistrationItemSetHolder
100 ,public SfxSingleTabDialogController
103 DatabaseRegistrationDialog(weld::Window
* pParent
, const SfxItemSet
& rAttr
);
105 virtual short run() override
;
109 #endif // INCLUDED_CUI_SOURCE_INC_DBREGISTER_HXX
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */