1*c4eee24dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c4eee24dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c4eee24dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c4eee24dSAndrew Rist  * distributed with this work for additional information
6*c4eee24dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c4eee24dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c4eee24dSAndrew Rist  * "License"); you may not use this file except in compliance
9*c4eee24dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*c4eee24dSAndrew Rist  *
11*c4eee24dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*c4eee24dSAndrew Rist  *
13*c4eee24dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c4eee24dSAndrew Rist  * software distributed under the License is distributed on an
15*c4eee24dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c4eee24dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c4eee24dSAndrew Rist  * specific language governing permissions and limitations
18*c4eee24dSAndrew Rist  * under the License.
19*c4eee24dSAndrew Rist  *
20*c4eee24dSAndrew Rist  *************************************************************/
21*c4eee24dSAndrew Rist 
22*c4eee24dSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _OFFAPP_CONNPOOLSETTINGS_HXX_
25cdf0e10cSrcweir #define _OFFAPP_CONNPOOLSETTINGS_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/string.hxx>
28cdf0e10cSrcweir #include <comphelper/stl_types.hxx>
29cdf0e10cSrcweir #include <svl/poolitem.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir //........................................................................
32cdf0e10cSrcweir namespace offapp
33cdf0e10cSrcweir {
34cdf0e10cSrcweir //........................................................................
35cdf0e10cSrcweir 
36cdf0e10cSrcweir 	//====================================================================
37cdf0e10cSrcweir 	//= DriverPooling
38cdf0e10cSrcweir 	//====================================================================
39cdf0e10cSrcweir 	struct DriverPooling
40cdf0e10cSrcweir 	{
41cdf0e10cSrcweir 		String				sName;
42cdf0e10cSrcweir 		sal_Bool			bEnabled;
43cdf0e10cSrcweir 		sal_Int32			nTimeoutSeconds;
44cdf0e10cSrcweir 
45cdf0e10cSrcweir 		DriverPooling( const String& _rName, sal_Bool _bEnabled, const sal_Int32 _nTimeout );
46cdf0e10cSrcweir 
47cdf0e10cSrcweir 		sal_Bool operator == (const DriverPooling& _rR) const;
operator !=offapp::DriverPooling48cdf0e10cSrcweir 		sal_Bool operator != (const DriverPooling& _rR) const { return !operator ==(_rR); }
49cdf0e10cSrcweir 	};
50cdf0e10cSrcweir 
51cdf0e10cSrcweir 	//====================================================================
52cdf0e10cSrcweir 	//= DriverPoolingSettings
53cdf0e10cSrcweir 	//====================================================================
54cdf0e10cSrcweir 	class DriverPoolingSettings
55cdf0e10cSrcweir 	{
56cdf0e10cSrcweir 	protected:
57cdf0e10cSrcweir 		DECLARE_STL_VECTOR( DriverPooling, DriverSettings );
58cdf0e10cSrcweir 		DriverSettings		m_aDrivers;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 	public:
61cdf0e10cSrcweir 		typedef ConstDriverSettingsIterator	const_iterator;
62cdf0e10cSrcweir 		typedef DriverSettingsIterator		iterator;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	public:
65cdf0e10cSrcweir 		DriverPoolingSettings();
66cdf0e10cSrcweir 
size() const67cdf0e10cSrcweir 		sal_Int32 size() const { return m_aDrivers.size(); }
68cdf0e10cSrcweir 
begin() const69cdf0e10cSrcweir 		const_iterator	begin() const	{ return m_aDrivers.begin(); }
end() const70cdf0e10cSrcweir 		const_iterator	end() const		{ return m_aDrivers.end(); }
71cdf0e10cSrcweir 
begin()72cdf0e10cSrcweir 		iterator		begin()		{ return m_aDrivers.begin(); }
end()73cdf0e10cSrcweir 		iterator		end()		{ return m_aDrivers.end(); }
74cdf0e10cSrcweir 
push_back(const DriverPooling & _rElement)75cdf0e10cSrcweir 		void push_back(const DriverPooling& _rElement) { m_aDrivers.push_back(_rElement); }
76cdf0e10cSrcweir 	};
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 	//====================================================================
79cdf0e10cSrcweir 	//= DriverPoolingSettingsItem
80cdf0e10cSrcweir 	//====================================================================
81cdf0e10cSrcweir 	class DriverPoolingSettingsItem : public SfxPoolItem
82cdf0e10cSrcweir 	{
83cdf0e10cSrcweir 	protected:
84cdf0e10cSrcweir 		DriverPoolingSettings	m_aSettings;
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 	public:
87cdf0e10cSrcweir 		TYPEINFO();
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 		DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings _rSettings );
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 		virtual int              operator==( const SfxPoolItem& ) const;
92cdf0e10cSrcweir 		virtual SfxPoolItem*     Clone( SfxItemPool *pPool = 0 ) const;
93cdf0e10cSrcweir 
getSettings() const94cdf0e10cSrcweir 		const DriverPoolingSettings& getSettings() const	{ return m_aSettings; }
95cdf0e10cSrcweir 	};
96cdf0e10cSrcweir 
97cdf0e10cSrcweir //........................................................................
98cdf0e10cSrcweir }	// namespace offapp
99cdf0e10cSrcweir //........................................................................
100cdf0e10cSrcweir 
101cdf0e10cSrcweir #endif // _OFFAPP_CONNPOOLSETTINGS_HXX_
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 
104