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