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 SVX_DBREGISTER_HXX
21 #define SVX_DBREGISTER_HXX
23 #include "optpath.hxx"
24 #include <tools/string.hxx>
25 #include <comphelper/stl_types.hxx>
26 #include <svl/poolitem.hxx>
27 #include "ControlFocusHelper.hxx"
28 #include <sfx2/basedlgs.hxx>
30 class SvTreeListEntry
;
33 class OptHeaderTabListBox
;
35 //........................................................................
38 //........................................................................
40 //====================================================================
41 //= DbRegistrationOptionsPage
42 //====================================================================
43 class DbRegistrationOptionsPage
: public SfxTabPage
49 SvxControlFocusHelper aPathCtrl
;
54 HeaderBar
* pHeaderBar
;
55 ::svx::OptHeaderTabListBox
* pPathBox
;
56 SvTreeListEntry
* m_pCurEntry
;
57 sal_uLong m_nOldCount
;
60 #ifdef SVX_DBREGISTER_HXX
61 DECL_LINK( NewHdl
, void * );
62 DECL_LINK( EditHdl
, void * );
63 DECL_LINK( DeleteHdl
, void * );
65 DECL_LINK(PathSelect_Impl
, void *);
67 DECL_LINK( HeaderSelect_Impl
, HeaderBar
* );
68 DECL_LINK( HeaderEndDrag_Impl
, HeaderBar
* );
69 DECL_LINK( NameValidator
, String
*);
72 /** inserts a new entry in the tablistbox
74 The name of the entry.
76 The location of the file.
78 void insertNewEntry( const ::rtl::OUString
& _sName
,const ::rtl::OUString
& _sLocation
, const bool bReadOnly
);
80 /** opens the LinkDialog to create a register pair
82 The old name of the entry may be empty.
84 The old location of the entry may be empty.
86 The entry to remove if the entry will be changed
88 void openLinkDialog(const String
& _sOldName
,const String
& _sOldLocation
,SvTreeListEntry
* _pEntry
= NULL
);
93 DbRegistrationOptionsPage( Window
* pParent
, const SfxItemSet
& rSet
);
94 virtual ~DbRegistrationOptionsPage();
96 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rSet
);
97 static sal_uInt16
* GetRanges();
99 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
100 virtual void Reset( const SfxItemSet
& rSet
);
101 virtual void FillUserData();
104 //====================================================================
105 //= RegistrationItemSetHolder
106 //====================================================================
107 /** helper for DatabaseRegistrationDialog
109 Necessary so that DatabaseRegistrationDialog is self-contained, i.e. always reflects
110 the current registration state.
112 class RegistrationItemSetHolder
115 SfxItemSet m_aRegistrationItems
;
118 RegistrationItemSetHolder( const SfxItemSet
& _rMasterSet
);
119 ~RegistrationItemSetHolder();
122 const SfxItemSet
& getRegistrationItems() const { return m_aRegistrationItems
; }
125 //====================================================================
126 //= DatabaseRegistrationDialog
127 //====================================================================
128 class DatabaseRegistrationDialog
:public RegistrationItemSetHolder
129 ,public SfxSingleTabDialog
132 DatabaseRegistrationDialog( Window
* pParent
, const SfxItemSet
& rAttr
);
133 ~DatabaseRegistrationDialog();
135 virtual short Execute();
138 //........................................................................
140 //........................................................................
142 #endif // SVX_DBREGISTER_HXX
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */