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 :
20 : #ifndef _SV_MOREBTN_HXX
21 : #define _SV_MOREBTN_HXX
22 :
23 : #include <tools/solar.h>
24 : #include <vcl/dllapi.h>
25 : #include <vcl/mapmod.hxx>
26 : #include <vcl/button.hxx>
27 :
28 : struct ImplMoreButtonData;
29 :
30 : // --------------
31 : // - MoreButton -
32 : // --------------
33 :
34 : class VCL_DLLPUBLIC MoreButton : public PushButton
35 : {
36 : private:
37 : ImplMoreButtonData* mpMBData;
38 : sal_uLong mnDelta;
39 : MapUnit meUnit;
40 : sal_Bool mbState;
41 :
42 : // Copy assignment is forbidden and not implemented.
43 : SAL_DLLPRIVATE MoreButton( const MoreButton & );
44 : SAL_DLLPRIVATE MoreButton& operator=( const MoreButton & );
45 : SAL_DLLPRIVATE void ShowState();
46 :
47 : protected:
48 : using Window::ImplInit;
49 : SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
50 : SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
51 :
52 : public:
53 : MoreButton( Window* pParent, WinBits nStyle = 0 );
54 : MoreButton( Window* pParent, const ResId& rResId );
55 : ~MoreButton();
56 :
57 : void Click();
58 :
59 : void AddWindow( Window* pWindow );
60 :
61 0 : void SetDelta( sal_uLong nNewDelta ) { mnDelta = nNewDelta; }
62 : sal_uLong GetDelta() const { return mnDelta; }
63 :
64 : void SetMapUnit( MapUnit eNewUnit = MAP_PIXEL ) { meUnit = eNewUnit; }
65 : MapUnit GetMapUnit() const { return meUnit; }
66 :
67 : using PushButton::SetState;
68 : void SetState( sal_Bool bNewState = sal_True );
69 0 : sal_Bool GetState() const { return mbState; }
70 :
71 : void SetText( const XubString& rNewText );
72 : XubString GetText() const;
73 :
74 : void SetMoreText( const XubString& rNewText );
75 : void SetLessText( const XubString& rNewText );
76 : XubString GetMoreText() const;
77 : XubString GetLessText() const;
78 : };
79 :
80 0 : inline void MoreButton::SetState( sal_Bool bNewState )
81 : {
82 0 : if ( mbState != bNewState )
83 0 : Click();
84 0 : }
85 :
86 : #endif // _SV_MOREBTN_HXX
87 :
88 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|