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 EXTENSIONS_PROPCTRLR_PUSHBUTTONNAVIGATION_HXX
25 #define EXTENSIONS_PROPCTRLR_PUSHBUTTONNAVIGATION_HXX
26 
27 #include <com/sun/star/beans/XPropertySet.hpp>
28 #include <com/sun/star/beans/PropertyState.hpp>
29 
30 //............................................................................
31 namespace pcr
32 {
33 //............................................................................
34 
35     //========================================================================
36     //= PushButtonNavigation
37     //========================================================================
38     class PushButtonNavigation
39     {
40     protected:
41         ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
42                     m_xControlModel;
43         sal_Bool    m_bIsPushButton;
44 
45     public:
46         /** ctor
47             @param _rxControlModel
48                 the control model which is or will be bound
49         */
50         PushButtonNavigation(
51             const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel
52         );
53 
54         /** returns the current value of the "ButtonType" property, taking into account
55             the "virtual" button types such as "move-to-next-record button".
56         */
57         ::com::sun::star::uno::Any
58                 getCurrentButtonType() const SAL_THROW(());
59 
60         /** sets the current value of the "ButtonType" property, taking into account
61             the "virtual" button types such as "move-to-next-record button".
62         */
63         void    setCurrentButtonType( const ::com::sun::star::uno::Any& _rValue ) const SAL_THROW(());
64 
65         /** retrieves the current state of the "ButtonType" property, taking into account
66             the "virtual" button types such as "move-to-next-record button".
67         */
68         ::com::sun::star::beans::PropertyState
69                 getCurrentButtonTypeState( ) const SAL_THROW(());
70 
71         /** returns the current value of the "TargetURL" property, taking into account
72             that some URLs are special values caused by "virtual" ButtonTypes
73         */
74         ::com::sun::star::uno::Any
75                 getCurrentTargetURL() const SAL_THROW(());
76 
77         /** sets the current value of the "TargetURL" property, taking into account
78             that some URLs are special values caused by "virtual" ButtonTypes
79         */
80         void    setCurrentTargetURL( const ::com::sun::star::uno::Any& _rValue ) const SAL_THROW(());
81 
82         /** retrieves the current state of the "TargetURL" property, taking into account
83             that some URLs are special values caused by "virtual" ButtonTypes
84         */
85         ::com::sun::star::beans::PropertyState
86                 getCurrentTargetURLState( ) const SAL_THROW(());
87 
88         /** determines whether the current button tpye is FormButtonType_URL
89         */
90         bool    currentButtonTypeIsOpenURL() const;
91 
92         /** determines whether the TargetURL property does currently denote a non-empty string
93         */
94         bool    hasNonEmptyCurrentTargetURL() const;
95 
96     private:
97         sal_Int32 implGetCurrentButtonType() const SAL_THROW(( ::com::sun::star::uno::Exception ));
98     };
99 
100 //............................................................................
101 }   // namespace pcr
102 //............................................................................
103 
104 #endif // EXTENSIONS_PROPCTRLR_PUSHBUTTONNAVIGATION_HXX
105