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 _DBA_CORE_DATASETTINGS_HXX_
29 #define _DBA_CORE_DATASETTINGS_HXX_
30 
31 #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
32 #include <com/sun/star/uno/Sequence.hxx>
33 #endif
34 #ifndef _COM_SUN_STAR_BEANS_PROPERTY_HPP_
35 #include <com/sun/star/beans/Property.hpp>
36 #endif
37 #ifndef _COM_SUN_STAR_AWT_FONTDESCRIPTOR_HPP_
38 #include <com/sun/star/awt/FontDescriptor.hpp>
39 #endif
40 #ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP_
41 #include <com/sun/star/lang/IllegalArgumentException.hpp>
42 #endif
43 #ifndef _RTL_USTRING_HXX_
44 #include <rtl/ustring.hxx>
45 #endif
46 #ifndef COMPHELPER_PROPERTYSTATECONTAINER_HXX
47 #include <comphelper/propertystatecontainer.hxx>
48 #endif
49 
50 //........................................................................
51 namespace dbaccess
52 {
53 //........................................................................
54 
55 //==========================================================================
56 //= ODataSettings_Base - a base class which implements the property member
57 //=					for an object implementing the sdb::DataSettings
58 //=					service
59 //=	the properties have to to be registered when used
60 //==========================================================================
61 class ODataSettings_Base
62 {
63 public:
64 // <properties>
65 	::rtl::OUString								m_sFilter;
66 	::rtl::OUString								m_sHavingClause;
67 	::rtl::OUString								m_sGroupBy;
68 	::rtl::OUString								m_sOrder;
69 	sal_Bool									m_bApplyFilter;		// no BitField ! the base class needs a pointer to this member !
70 	::com::sun::star::awt::FontDescriptor		m_aFont;
71 	::com::sun::star::uno::Any					m_aRowHeight;
72 	::com::sun::star::uno::Any					m_aTextColor;
73 	::com::sun::star::uno::Any					m_aTextLineColor;
74 	sal_Int16									m_nFontEmphasis;
75 	sal_Int16									m_nFontRelief;
76 // </properties>
77 
78 protected:
79 	ODataSettings_Base();
80 	ODataSettings_Base(const ODataSettings_Base& _rSource);
81     ~ODataSettings_Base();
82 };
83 //==========================================================================
84 //= ODataSettings - a base class which implements the property handling
85 //=					for an object implementing the sdb::DataSettings
86 //=					service
87 //==========================================================================
88 
89 class ODataSettings : public ::comphelper::OPropertyStateContainer
90 					, public ODataSettings_Base
91 {
92 	sal_Bool m_bQuery;
93 protected:
94 	ODataSettings(::cppu::OBroadcastHelper& _rBHelper,sal_Bool _bQuery = sal_False);
95 	virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle, ::com::sun::star::uno::Any& _rDefault ) const;
96 
97 	/** register the properties from the param given. The parameter instance must be alive as long as tis object live.
98 		@param	_pItem
99 			The database settings, can be <br>this</br>
100 	*/
101 	void registerPropertiesFor(ODataSettings_Base* _pItem);
102 };
103 
104 //........................................................................
105 }	// namespace dbaccess
106 //........................................................................
107 
108 #endif // _DBA_CORE_DATASETTINGS_HXX_
109 
110