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 <svl/poolitem.hxx>
26 #include <svtools/simptabl.hxx>
27 #include "optpath.hxx"
29 class SvTreeListEntry
;
32 class OptHeaderTabListBox
;
38 class DbRegistrationOptionsPage
: public SfxTabPage
44 VclPtr
<SvSimpleTableContainer
> m_pPathCtrl
;
45 VclPtr
<PushButton
> m_pNew
;
46 VclPtr
<PushButton
> m_pEdit
;
47 VclPtr
<PushButton
> m_pDelete
;
49 VclPtr
<svx::OptHeaderTabListBox
> pPathBox
;
50 SvTreeListEntry
* m_pCurEntry
;
51 sal_uLong m_nOldCount
;
54 #ifdef INCLUDED_CUI_SOURCE_INC_DBREGISTER_HXX
55 DECL_LINK( NewHdl
, void * );
56 DECL_LINK( EditHdl
, void * );
57 DECL_LINK( DeleteHdl
, void * );
59 DECL_LINK(PathSelect_Impl
, void *);
61 DECL_LINK( HeaderSelect_Impl
, HeaderBar
* );
62 DECL_LINK( HeaderEndDrag_Impl
, HeaderBar
* );
63 DECL_LINK( NameValidator
, OUString
*);
66 /** inserts a new entry in the tablistbox
68 The name of the entry.
70 The location of the file.
72 void insertNewEntry( const OUString
& _sName
,const OUString
& _sLocation
, const bool bReadOnly
);
74 /** opens the LinkDialog to create a register pair
76 The old name of the entry may be empty.
78 The old location of the entry may be empty.
80 The entry to remove if the entry will be changed
82 void openLinkDialog(const OUString
& _sOldName
,const OUString
& _sOldLocation
,SvTreeListEntry
* _pEntry
= NULL
);
87 DbRegistrationOptionsPage( vcl::Window
* pParent
, const SfxItemSet
& rSet
);
88 virtual ~DbRegistrationOptionsPage();
89 virtual void dispose() SAL_OVERRIDE
;
91 static VclPtr
<SfxTabPage
> Create( vcl::Window
* pParent
, const SfxItemSet
* rSet
);
92 static const sal_uInt16
* GetRanges();
94 virtual bool FillItemSet( SfxItemSet
* rSet
) SAL_OVERRIDE
;
95 virtual void Reset( const SfxItemSet
* rSet
) SAL_OVERRIDE
;
96 virtual void FillUserData() SAL_OVERRIDE
;
99 /** helper for DatabaseRegistrationDialog
101 Necessary so that DatabaseRegistrationDialog is self-contained, i.e. always reflects
102 the current registration state.
104 class RegistrationItemSetHolder
107 SfxItemSet m_aRegistrationItems
;
110 RegistrationItemSetHolder( const SfxItemSet
& _rMasterSet
);
111 ~RegistrationItemSetHolder();
114 const SfxItemSet
& getRegistrationItems() const { return m_aRegistrationItems
; }
117 class DatabaseRegistrationDialog
:public RegistrationItemSetHolder
118 ,public SfxSingleTabDialog
121 DatabaseRegistrationDialog( vcl::Window
* pParent
, const SfxItemSet
& rAttr
);
123 virtual short Execute() SAL_OVERRIDE
;
130 #endif // INCLUDED_CUI_SOURCE_INC_DBREGISTER_HXX
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */