xref: /AOO41X/main/cui/source/inc/dbregister.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef SVX_DBREGISTER_HXX
29*cdf0e10cSrcweir #define SVX_DBREGISTER_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "optpath.hxx"
32*cdf0e10cSrcweir #include <tools/string.hxx>
33*cdf0e10cSrcweir #include <comphelper/stl_types.hxx>
34*cdf0e10cSrcweir #include <svl/poolitem.hxx>
35*cdf0e10cSrcweir #include "ControlFocusHelper.hxx"
36*cdf0e10cSrcweir #include <sfx2/basedlgs.hxx>
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir class SvLBoxEntry;
39*cdf0e10cSrcweir namespace svx
40*cdf0e10cSrcweir {
41*cdf0e10cSrcweir 	class OptHeaderTabListBox;
42*cdf0e10cSrcweir }
43*cdf0e10cSrcweir //........................................................................
44*cdf0e10cSrcweir namespace svx
45*cdf0e10cSrcweir {
46*cdf0e10cSrcweir //........................................................................
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir     //====================================================================
49*cdf0e10cSrcweir 	//= DbRegistrationOptionsPage
50*cdf0e10cSrcweir 	//====================================================================
51*cdf0e10cSrcweir 	class DbRegistrationOptionsPage : public SfxTabPage
52*cdf0e10cSrcweir 	{
53*cdf0e10cSrcweir 	private:
54*cdf0e10cSrcweir 		FixedLine           aStdBox;
55*cdf0e10cSrcweir 		FixedText			aTypeText;
56*cdf0e10cSrcweir 		FixedText			aPathText;
57*cdf0e10cSrcweir 		SvxControlFocusHelper	aPathCtrl;
58*cdf0e10cSrcweir 		PushButton			m_aNew;
59*cdf0e10cSrcweir 		PushButton			m_aEdit;
60*cdf0e10cSrcweir 		PushButton      	m_aDelete;
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir 		HeaderBar*			pHeaderBar;
63*cdf0e10cSrcweir 		::svx::OptHeaderTabListBox*	pPathBox;
64*cdf0e10cSrcweir 		SvLBoxEntry*		m_pCurEntry;
65*cdf0e10cSrcweir 		sal_uLong				m_nOldCount;
66*cdf0e10cSrcweir 		sal_Bool				m_bModified;
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir #ifdef SVX_DBREGISTER_HXX
69*cdf0e10cSrcweir 		DECL_LINK( NewHdl, void * );
70*cdf0e10cSrcweir 		DECL_LINK( EditHdl, void * );
71*cdf0e10cSrcweir 		DECL_LINK( DeleteHdl, void * );
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir 		DECL_LINK( PathSelect_Impl, SvTabListBox* );
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir 		DECL_LINK( HeaderSelect_Impl, HeaderBar * );
76*cdf0e10cSrcweir 		DECL_LINK( HeaderEndDrag_Impl, HeaderBar * );
77*cdf0e10cSrcweir 		DECL_LINK( NameValidator, String*);
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir 		/** inserts a new entry in the tablistbox
81*cdf0e10cSrcweir 			@param	_sName
82*cdf0e10cSrcweir 				The name of the entry.
83*cdf0e10cSrcweir 			@param	_sLocation
84*cdf0e10cSrcweir 				The location of the file.
85*cdf0e10cSrcweir 		*/
86*cdf0e10cSrcweir 		void insertNewEntry( const ::rtl::OUString& _sName,const ::rtl::OUString& _sLocation, const bool bReadOnly );
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir 		/** opens the LinkDialog to create a register pair
89*cdf0e10cSrcweir 			@param	_sOldName
90*cdf0e10cSrcweir 				The old name of the entry may be empty.
91*cdf0e10cSrcweir 			@param	_sOldLocation
92*cdf0e10cSrcweir 				The old location of the entry may be empty.
93*cdf0e10cSrcweir 			@param	_pEntry
94*cdf0e10cSrcweir 				The entry to remove if the entry will be changed
95*cdf0e10cSrcweir 		*/
96*cdf0e10cSrcweir 		void openLinkDialog(const String& _sOldName,const String& _sOldLocation,SvLBoxEntry* _pEntry = NULL);
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir #endif
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir 	public:
101*cdf0e10cSrcweir 		DbRegistrationOptionsPage( Window* pParent, const SfxItemSet& rSet );
102*cdf0e10cSrcweir 		virtual ~DbRegistrationOptionsPage();
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir 		static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rSet );
105*cdf0e10cSrcweir 		static sal_uInt16*		GetRanges();
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir 		virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
108*cdf0e10cSrcweir 		virtual	void 		Reset( const SfxItemSet& rSet );
109*cdf0e10cSrcweir 		virtual void        FillUserData();
110*cdf0e10cSrcweir 	};
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir     //====================================================================
113*cdf0e10cSrcweir 	//= RegistrationItemSetHolder
114*cdf0e10cSrcweir 	//====================================================================
115*cdf0e10cSrcweir     /** helper for DatabaseRegistrationDialog
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir         Necessary so that DatabaseRegistrationDialog is self-contained, i.e. always reflects
118*cdf0e10cSrcweir         the current registration state.
119*cdf0e10cSrcweir     */
120*cdf0e10cSrcweir     class RegistrationItemSetHolder
121*cdf0e10cSrcweir     {
122*cdf0e10cSrcweir     private:
123*cdf0e10cSrcweir         SfxItemSet  m_aRegistrationItems;
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir     protected:
126*cdf0e10cSrcweir         RegistrationItemSetHolder( const SfxItemSet& _rMasterSet );
127*cdf0e10cSrcweir         ~RegistrationItemSetHolder();
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir     protected:
130*cdf0e10cSrcweir         const SfxItemSet& getRegistrationItems() const { return m_aRegistrationItems; }
131*cdf0e10cSrcweir     };
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir     //====================================================================
134*cdf0e10cSrcweir 	//= DatabaseRegistrationDialog
135*cdf0e10cSrcweir 	//====================================================================
136*cdf0e10cSrcweir     class DatabaseRegistrationDialog    :public RegistrationItemSetHolder
137*cdf0e10cSrcweir                                         ,public SfxSingleTabDialog
138*cdf0e10cSrcweir     {
139*cdf0e10cSrcweir     public:
140*cdf0e10cSrcweir 	    DatabaseRegistrationDialog( Window* pParent, const SfxItemSet& rAttr );
141*cdf0e10cSrcweir 	    ~DatabaseRegistrationDialog();
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir         virtual short	Execute();
144*cdf0e10cSrcweir     };
145*cdf0e10cSrcweir 
146*cdf0e10cSrcweir //........................................................................
147*cdf0e10cSrcweir }	// namespace svx
148*cdf0e10cSrcweir //........................................................................
149*cdf0e10cSrcweir 
150*cdf0e10cSrcweir #endif // SVX_DBREGISTER_HXX
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir 
153