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