xref: /aoo42x/main/forms/source/component/Pattern.hxx (revision 2d785d7e)
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 _FORMS_PATTERN_HXX_
25 #define _FORMS_PATTERN_HXX_
26 
27 #include "EditBase.hxx"
28 
29 #include <connectivity/formattedcolumnvalue.hxx>
30 
31 #include <memory>
32 
33 //.........................................................................
34 namespace frm
35 {
36 //.........................................................................
37 
38 //==================================================================
39 //= OPatternModel
40 //==================================================================
41 class OPatternModel
42                 :public OEditBaseModel
43 {
44 private:
45     ::com::sun::star::uno::Any  m_aLastKnownValue;
46     ::std::auto_ptr< ::dbtools::FormattedColumnValue >
47                                 m_pFormattedValue;
48 
49 protected:
50     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
51 
52 public:
53     DECLARE_DEFAULT_LEAF_XTOR( OPatternModel );
54 
55     // ::com::sun::star::lang::XServiceInfo
56     IMPLEMENTATION_NAME(OPatternModel);
57     virtual StringSequence SAL_CALL getSupportedServiceNames() throw();
58 
59     // ::com::sun::star::io::XPersistObject
60     virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException);
61 
62     // OControlModel's property handling
63     virtual void describeFixedProperties(
64         ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps
65     ) const;
66 
67 protected:
68     // OBoundControlModel overridables
69     virtual ::com::sun::star::uno::Any
70                             translateDbColumnToControlValue( );
71     virtual sal_Bool        commitControlValueToDbColumn( bool _bPostReset );
72     virtual void            onConnectedDbColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxForm );
73     virtual void            onDisconnectedDbColumn();
74 
75     virtual ::com::sun::star::uno::Any
76                             getDefaultForReset() const;
77 	virtual void            resetNoBroadcast();
78 
79 protected:
80     DECLARE_XCLONEABLE();
81 };
82 
83 //==================================================================
84 //= OPatternControl
85 //==================================================================
86 class OPatternControl: public OBoundControl
87 {
88 protected:
89     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
90 
91 public:
92     OPatternControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
93 
94     // ::com::sun::star::lang::XServiceInfo
95     IMPLEMENTATION_NAME(OPatternControl);
96     virtual StringSequence SAL_CALL getSupportedServiceNames() throw();
97 };
98 
99 //.........................................................................
100 }   // namespace frm
101 //.........................................................................
102 
103 #endif // _FORMS_PATTERN_HXX_
104 
105