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_COMPONENT_NAVIGATION_BAR_HXX
25 #define FORMS_COMPONENT_NAVIGATION_BAR_HXX
26 
27 #include "FormComponent.hxx"
28 #include <com/sun/star/io/XPersistObject.hpp>
29 #include <comphelper/proparrhlp.hxx>
30 #include <comphelper/propertycontainerhelper.hxx>
31 #include <cppuhelper/implbase1.hxx>
32 #include <cppuhelper/interfacecontainer.hxx>
33 #include <com/sun/star/container/XSet.hpp>
34 #include <com/sun/star/container/XContainer.hpp>
35 #include "formcontrolfont.hxx"
36 
37 #include <set>
38 
39 //.........................................................................
40 namespace frm
41 {
42 //.........................................................................
43 
44     //==================================================================
45     // ONavigationBarModel
46     //==================================================================
47     typedef ::cppu::ImplHelper1 <   ::com::sun::star::awt::XControlModel
48                                 > ONavigationBarModel_BASE;
49 
50     class ONavigationBarModel
51                         :public OControlModel
52                         ,public FontControlModel
53                         ,public OPropertyContainerHelper
54                         ,public ONavigationBarModel_BASE
55     {
56         // <properties>
57         ::com::sun::star::uno::Any          m_aTabStop;
58     	::com::sun::star::uno::Any          m_aBackgroundColor;
59         ::rtl::OUString                     m_sDefaultControl;
60         ::rtl::OUString                     m_sHelpText;
61         ::rtl::OUString                     m_sHelpURL;
62         sal_Int16                           m_nIconSize;
63         sal_Int16                           m_nBorder;
64         sal_Int32                           m_nDelay;
65         sal_Bool                            m_bEnabled;
66         sal_Bool                            m_bEnableVisible;
67         sal_Bool                            m_bShowPosition;
68         sal_Bool                            m_bShowNavigation;
69         sal_Bool                            m_bShowActions;
70         sal_Bool                            m_bShowFilterSort;
71         sal_Int16                           m_nWritingMode;
72         sal_Int16                           m_nContextWritingMode;
73         // </properties>
74 
75     public:
76         DECLARE_DEFAULT_LEAF_XTOR( ONavigationBarModel );
77 
78         // XServiceInfo - static version
79         static	::rtl::OUString	SAL_CALL getImplementationName_Static();
80         static	::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_Static();
81         static	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory );
82 
83     protected:
84         // UNO
85         DECLARE_UNO3_AGG_DEFAULTS( ONavigationBarModel, OControlModel );
86         virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException);
87 
88         // XServiceInfo
89         virtual ::rtl::OUString	SAL_CALL getImplementationName()  throw(::com::sun::star::uno::RuntimeException);
90         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()  throw(::com::sun::star::uno::RuntimeException);
91 
92         // XTypeProvider
93         DECLARE_XTYPEPROVIDER()
94 
95         // OComponentHelper
96         virtual void SAL_CALL disposing();
97 
98         // XPersistObject
99         virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException);
100         virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
101         virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
102 
103         // XPropertySet
104         virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
105         virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue,
106                                               sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
107                                             throw(::com::sun::star::lang::IllegalArgumentException);
108         virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw ( ::com::sun::star::uno::Exception);
109 
110         // XPropertyState
111         virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const;
112 
113         // OControlModel's property handling
114 	    virtual void describeFixedProperties(
115             ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps
116         ) const;
117 
118         // prevent method hiding
119         using OControlModel::disposing;
120         using OControlModel::getFastPropertyValue;
121 
122     protected:
123         DECLARE_XCLONEABLE();
124 
125     private:
126         void implInitPropertyContainer();
127     };
128 
129 //.........................................................................
130 }   // namespace frm
131 //.........................................................................
132 
133 #endif // FORMS_COMPONENT_NAVIGATION_BAR_HXX
134 
135