Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX
20 : #define INCLUDED_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX
21 :
22 : #include <toolkit/controls/unocontrolmodel.hxx>
23 : #include <toolkit/helper/servicenames.hxx>
24 : #include <toolkit/controls/unocontrolbase.hxx>
25 : #include <toolkit/helper/macros.hxx>
26 : #include <com/sun/star/awt/XScrollBar.hpp>
27 : #include <com/sun/star/awt/XAdjustmentListener.hpp>
28 : #include <com/sun/star/awt/AdjustmentType.hpp>
29 :
30 :
31 : namespace toolkit
32 : {
33 :
34 :
35 :
36 : //= UnoControlScrollBarModel
37 :
38 26 : class UnoControlScrollBarModel : public UnoControlModel
39 : {
40 : protected:
41 : ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const SAL_OVERRIDE;
42 : ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE;
43 :
44 : public:
45 : UnoControlScrollBarModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_factory );
46 2 : UnoControlScrollBarModel( const UnoControlScrollBarModel& rModel ) : UnoControlModel( rModel ) {;}
47 :
48 2 : UnoControlModel* Clone() const SAL_OVERRIDE { return new UnoControlScrollBarModel( *this ); }
49 :
50 : // ::com::sun::star::beans::XMultiPropertySet
51 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
52 :
53 : // ::com::sun::star::io::XPersistObject
54 : OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
55 :
56 : // XServiceInfo
57 : OUString SAL_CALL getImplementationName()
58 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
59 :
60 : css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
61 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
62 : };
63 :
64 :
65 : //= UnoControlScrollBarModel
66 :
67 4 : class UnoScrollBarControl : public UnoControlBase,
68 : public ::com::sun::star::awt::XAdjustmentListener,
69 : public ::com::sun::star::awt::XScrollBar
70 : {
71 : private:
72 : AdjustmentListenerMultiplexer maAdjustmentListeners;
73 :
74 : public:
75 : UnoScrollBarControl();
76 : OUString GetComponentServiceName() SAL_OVERRIDE;
77 :
78 34 : ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE { return UnoControlBase::queryInterface(rType); }
79 : ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
80 136 : void SAL_CALL acquire() throw() SAL_OVERRIDE { OWeakAggObject::acquire(); }
81 136 : void SAL_CALL release() throw() SAL_OVERRIDE { OWeakAggObject::release(); }
82 : void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
83 2 : void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE { UnoControlBase::disposing( Source ); }
84 : void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
85 :
86 : // ::com::sun::star::lang::XTypeProvider
87 : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
88 : ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
89 :
90 : // ::com::sun::star::awt::XAdjustmentListener
91 : void SAL_CALL adjustmentValueChanged( const ::com::sun::star::awt::AdjustmentEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
92 :
93 : // ::com::sun::star::awt::XScrollBar
94 : void SAL_CALL addAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& l ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
95 : void SAL_CALL removeAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& l ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
96 : void SAL_CALL setValue( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
97 : void SAL_CALL setValues( sal_Int32 nValue, sal_Int32 nVisible, sal_Int32 nMax ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
98 : sal_Int32 SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
99 : void SAL_CALL setMaximum( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
100 : sal_Int32 SAL_CALL getMaximum( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
101 : void SAL_CALL setLineIncrement( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
102 : sal_Int32 SAL_CALL getLineIncrement( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
103 : void SAL_CALL setBlockIncrement( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
104 : sal_Int32 SAL_CALL getBlockIncrement( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
105 : void SAL_CALL setVisibleSize( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
106 : sal_Int32 SAL_CALL getVisibleSize( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
107 : void SAL_CALL setOrientation( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
108 : sal_Int32 SAL_CALL getOrientation( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
109 :
110 : // ::com::sun::star::lang::XServiceInfo
111 : OUString SAL_CALL getImplementationName()
112 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
113 :
114 : css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
115 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
116 : };
117 :
118 :
119 :
120 :
121 : } // namespacetoolkit
122 :
123 :
124 : #endif // INCLUDED_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX
125 :
126 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|