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