1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef SVX_DBREGISTERSETTING_HXX 29 #define SVX_DBREGISTERSETTING_HXX 30 31 #include <comphelper/stl_types.hxx> 32 #include <svl/poolitem.hxx> 33 34 //........................................................................ 35 namespace svx 36 { 37 //........................................................................ 38 39 struct DatabaseRegistration 40 { 41 ::rtl::OUString sLocation; 42 bool bReadOnly; 43 44 DatabaseRegistration() 45 :sLocation() 46 ,bReadOnly( true ) 47 { 48 } 49 50 DatabaseRegistration( const ::rtl::OUString& _rLocation, const sal_Bool _bReadOnly ) 51 :sLocation( _rLocation ) 52 ,bReadOnly( _bReadOnly ) 53 { 54 } 55 56 bool operator==( const DatabaseRegistration& _rhs ) const 57 { 58 return ( sLocation == _rhs.sLocation ); 59 // do not take the read-only-ness into account, this is not maintained everywhere, but only 60 // properly set when filling the struct from the XDatabaseRegistrations data 61 } 62 63 bool operator!=( const DatabaseRegistration& _rhs ) const 64 { 65 return !( this->operator==( _rhs ) ); 66 } 67 }; 68 69 typedef ::std::map< ::rtl::OUString, DatabaseRegistration, ::comphelper::UStringLess > DatabaseRegistrations; 70 71 //==================================================================== 72 //= DatabaseMapItem 73 //==================================================================== 74 class DatabaseMapItem : public SfxPoolItem 75 { 76 protected: 77 DatabaseRegistrations m_aRegistrations; 78 79 public: 80 TYPEINFO(); 81 82 DatabaseMapItem( sal_uInt16 _nId, const DatabaseRegistrations& _rRegistrations ); 83 84 virtual int operator==( const SfxPoolItem& ) const; 85 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 86 87 const DatabaseRegistrations& 88 getRegistrations() const { return m_aRegistrations; } 89 }; 90 91 //........................................................................ 92 } // namespace svx 93 //........................................................................ 94 #endif // SVX_DBREGISTERSETTING_HXX 95 96