/src/libreoffice/toolkit/inc/controls/tkscrollbar.hxx
Line | Count | Source |
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 | | #pragma once |
20 | | |
21 | | #include <rtl/ref.hxx> |
22 | | #include <toolkit/controls/unocontrolmodel.hxx> |
23 | | #include <toolkit/controls/unocontrolbase.hxx> |
24 | | #include <com/sun/star/awt/XScrollBar.hpp> |
25 | | #include <com/sun/star/awt/XAdjustmentListener.hpp> |
26 | | |
27 | | |
28 | | namespace toolkit |
29 | | { |
30 | | |
31 | | |
32 | | //= UnoControlScrollBarModel |
33 | | |
34 | | class UnoControlScrollBarModel final : public UnoControlModel |
35 | | { |
36 | | css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; |
37 | | ::cppu::IPropertyArrayHelper& getInfoHelper() override; |
38 | | |
39 | | public: |
40 | | UnoControlScrollBarModel( const css::uno::Reference< css::uno::XComponentContext >& i_factory ); |
41 | 0 | UnoControlScrollBarModel( const UnoControlScrollBarModel& rModel ) : UnoControlModel( rModel ) {} |
42 | | |
43 | 0 | rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlScrollBarModel( *this ); } |
44 | | |
45 | | // css::beans::XMultiPropertySet |
46 | | css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
47 | | |
48 | | // css::io::XPersistObject |
49 | | OUString SAL_CALL getServiceName() override; |
50 | | |
51 | | // XServiceInfo |
52 | | OUString SAL_CALL getImplementationName() override; |
53 | | |
54 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
55 | | }; |
56 | | |
57 | | |
58 | | //= UnoControlScrollBarModel |
59 | | |
60 | | class UnoScrollBarControl final : public UnoControlBase, |
61 | | public css::awt::XAdjustmentListener, |
62 | | public css::awt::XScrollBar |
63 | | { |
64 | | private: |
65 | | AdjustmentListenerMultiplexer maAdjustmentListeners; |
66 | | |
67 | | public: |
68 | | UnoScrollBarControl(); |
69 | | OUString GetComponentServiceName() const override; |
70 | | |
71 | 0 | css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoControlBase::queryInterface(rType); } |
72 | | css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; |
73 | 0 | void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); } |
74 | 0 | void SAL_CALL release() noexcept override { OWeakAggObject::release(); } |
75 | | void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override; |
76 | 0 | void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoControlBase::disposing( Source ); } |
77 | | void SAL_CALL dispose( ) override; |
78 | | |
79 | | // css::lang::XTypeProvider |
80 | | css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; |
81 | | css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; |
82 | | |
83 | | // css::awt::XAdjustmentListener |
84 | | void SAL_CALL adjustmentValueChanged( const css::awt::AdjustmentEvent& rEvent ) override; |
85 | | |
86 | | // css::awt::XScrollBar |
87 | | void SAL_CALL addAdjustmentListener( const css::uno::Reference< css::awt::XAdjustmentListener >& l ) override; |
88 | | void SAL_CALL removeAdjustmentListener( const css::uno::Reference< css::awt::XAdjustmentListener >& l ) override; |
89 | | void SAL_CALL setValue( sal_Int32 n ) override; |
90 | | void SAL_CALL setValues( sal_Int32 nValue, sal_Int32 nVisible, sal_Int32 nMax ) override; |
91 | | sal_Int32 SAL_CALL getValue( ) override; |
92 | | void SAL_CALL setMaximum( sal_Int32 n ) override; |
93 | | sal_Int32 SAL_CALL getMaximum( ) override; |
94 | | void SAL_CALL setLineIncrement( sal_Int32 n ) override; |
95 | | sal_Int32 SAL_CALL getLineIncrement( ) override; |
96 | | void SAL_CALL setBlockIncrement( sal_Int32 n ) override; |
97 | | sal_Int32 SAL_CALL getBlockIncrement( ) override; |
98 | | void SAL_CALL setVisibleSize( sal_Int32 n ) override; |
99 | | sal_Int32 SAL_CALL getVisibleSize( ) override; |
100 | | void SAL_CALL setOrientation( sal_Int32 n ) override; |
101 | | sal_Int32 SAL_CALL getOrientation( ) override; |
102 | | |
103 | | // css::lang::XServiceInfo |
104 | | OUString SAL_CALL getImplementationName() override; |
105 | | |
106 | | css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; |
107 | | }; |
108 | | |
109 | | |
110 | | } // namespacetoolkit |
111 | | |
112 | | |
113 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |