update dev300-m58
[ooovba.git] / svx / source / cui / dbregister.hxx
blob303687300e8d504ce0a6663ef8d291546d9c8a17
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dbregister.hxx,v $
10 * $Revision: 1.6 $
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>
41 class SvLBoxEntry;
42 namespace svx
44 class OptHeaderTabListBox;
46 //........................................................................
47 namespace svx
49 //........................................................................
51 //====================================================================
52 //= DbRegistrationOptionsPage
53 //====================================================================
54 class DbRegistrationOptionsPage : public SfxTabPage
56 private:
57 FixedText aTypeText;
58 FixedText aPathText;
59 SvxControlFocusHelper aPathCtrl;
60 PushButton m_aNew;
61 PushButton m_aEdit;
62 PushButton m_aDelete;
63 FixedLine aStdBox;
65 HeaderBar* pHeaderBar;
66 ::svx::OptHeaderTabListBox* pPathBox;
67 SvLBoxEntry* m_pCurEntry;
68 ULONG m_nOldCount;
69 BOOL m_bModified;
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
85 @param _sName
86 The name of the entry.
87 @param _sLocation
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
93 @param _sOldName
94 The old name of the entry may be empty.
95 @param _sOldLocation
96 The old location of the entry may be empty.
97 @param _pEntry
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
103 @param _sLocation
104 If set, the file picker use it as default directory
105 @return
106 the location of the database file
108 String getFileLocation(const String& _sLocation);
109 #endif
111 public:
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
133 private:
134 SfxItemSet m_aRegistrationItems;
136 protected:
137 RegistrationItemSetHolder( const SfxItemSet& _rMasterSet );
138 ~RegistrationItemSetHolder();
140 protected:
141 const SfxItemSet& getRegistrationItems() const { return m_aRegistrationItems; }
144 //====================================================================
145 //= DatabaseRegistrationDialog
146 //====================================================================
147 class DatabaseRegistrationDialog :public RegistrationItemSetHolder
148 ,public SfxSingleTabDialog
150 public:
151 DatabaseRegistrationDialog( Window* pParent, const SfxItemSet& rAttr );
152 ~DatabaseRegistrationDialog();
154 virtual short Execute();
157 //........................................................................
158 } // namespace svx
159 //........................................................................
161 #endif // SVX_DBREGISTER_HXX