1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dbregister.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SVX_DBREGISTER_HXX
32 #define SVX_DBREGISTER_HXX
34 #include "optpath.hxx"
35 #include <tools/string.hxx>
36 #include <comphelper/stl_types.hxx>
37 #include <svtools/poolitem.hxx>
38 #include "ControlFocusHelper.hxx"
39 #include <sfx2/basedlgs.hxx>
44 class OptHeaderTabListBox
;
46 //........................................................................
49 //........................................................................
51 //====================================================================
52 //= DbRegistrationOptionsPage
53 //====================================================================
54 class DbRegistrationOptionsPage
: public SfxTabPage
59 SvxControlFocusHelper aPathCtrl
;
65 HeaderBar
* pHeaderBar
;
66 ::svx::OptHeaderTabListBox
* pPathBox
;
67 SvLBoxEntry
* m_pCurEntry
;
72 #ifdef SVX_DBREGISTER_HXX
73 DECL_LINK( NewHdl
, void * );
74 DECL_LINK( EditHdl
, void * );
75 DECL_LINK( DeleteHdl
, void * );
77 DECL_LINK( PathSelect_Impl
, SvTabListBox
* );
79 DECL_LINK( HeaderSelect_Impl
, HeaderBar
* );
80 DECL_LINK( HeaderEndDrag_Impl
, HeaderBar
* );
81 DECL_LINK( NameValidator
, String
*);
84 /** inserts a new entry in the tablistbox
86 The name of the entry.
88 The location of the file.
90 void insertNewEntry(const ::rtl::OUString
& _sName
,const ::rtl::OUString
& _sLocation
);
92 /** opens the LinkDialog to create a register pair
94 The old name of the entry may be empty.
96 The old location of the entry may be empty.
98 The entry to remove if the entry will be changed
100 void openLinkDialog(const String
& _sOldName
,const String
& _sOldLocation
,SvLBoxEntry
* _pEntry
= NULL
);
102 /** opens a file pciker to select a database file
104 If set, the file picker use it as default directory
106 the location of the database file
108 String
getFileLocation(const String
& _sLocation
);
112 DbRegistrationOptionsPage( Window
* pParent
, const SfxItemSet
& rSet
);
113 virtual ~DbRegistrationOptionsPage();
115 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rSet
);
116 static USHORT
* GetRanges();
118 virtual BOOL
FillItemSet( SfxItemSet
& rSet
);
119 virtual void Reset( const SfxItemSet
& rSet
);
120 virtual void FillUserData();
123 //====================================================================
124 //= RegistrationItemSetHolder
125 //====================================================================
126 /** helper for DatabaseRegistrationDialog
128 Necessary so that DatabaseRegistrationDialog is self-contained, i.e. always reflects
129 the current registration state.
131 class RegistrationItemSetHolder
134 SfxItemSet m_aRegistrationItems
;
137 RegistrationItemSetHolder( const SfxItemSet
& _rMasterSet
);
138 ~RegistrationItemSetHolder();
141 const SfxItemSet
& getRegistrationItems() const { return m_aRegistrationItems
; }
144 //====================================================================
145 //= DatabaseRegistrationDialog
146 //====================================================================
147 class DatabaseRegistrationDialog
:public RegistrationItemSetHolder
148 ,public SfxSingleTabDialog
151 DatabaseRegistrationDialog( Window
* pParent
, const SfxItemSet
& rAttr
);
152 ~DatabaseRegistrationDialog();
154 virtual short Execute();
157 //........................................................................
159 //........................................................................
161 #endif // SVX_DBREGISTER_HXX