Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SV_MOREBTN_HXX
30 : : #define _SV_MOREBTN_HXX
31 : :
32 : : #include <tools/solar.h>
33 : : #include <vcl/dllapi.h>
34 : : #include <vcl/mapmod.hxx>
35 : : #include <vcl/button.hxx>
36 : :
37 : : struct ImplMoreButtonData;
38 : :
39 : : // --------------
40 : : // - MoreButton -
41 : : // --------------
42 : :
43 : : class VCL_DLLPUBLIC MoreButton : public PushButton
44 : : {
45 : : private:
46 : : ImplMoreButtonData* mpMBData;
47 : : sal_uLong mnDelta;
48 : : MapUnit meUnit;
49 : : sal_Bool mbState;
50 : :
51 : : // Copy assignment is forbidden and not implemented.
52 : : SAL_DLLPRIVATE MoreButton( const MoreButton & );
53 : : SAL_DLLPRIVATE MoreButton& operator=( const MoreButton & );
54 : : SAL_DLLPRIVATE void ShowState();
55 : :
56 : : protected:
57 : : using Window::ImplInit;
58 : : SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
59 : : SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
60 : :
61 : : public:
62 : : MoreButton( Window* pParent, WinBits nStyle = 0 );
63 : : MoreButton( Window* pParent, const ResId& rResId );
64 : : ~MoreButton();
65 : :
66 : : void Click();
67 : :
68 : : void AddWindow( Window* pWindow );
69 : :
70 : 0 : void SetDelta( sal_uLong nNewDelta ) { mnDelta = nNewDelta; }
71 : : sal_uLong GetDelta() const { return mnDelta; }
72 : :
73 : : void SetMapUnit( MapUnit eNewUnit = MAP_PIXEL ) { meUnit = eNewUnit; }
74 : : MapUnit GetMapUnit() const { return meUnit; }
75 : :
76 : : using PushButton::SetState;
77 : : void SetState( sal_Bool bNewState = sal_True );
78 : 0 : sal_Bool GetState() const { return mbState; }
79 : :
80 : : void SetText( const XubString& rNewText );
81 : : XubString GetText() const;
82 : :
83 : : void SetMoreText( const XubString& rNewText );
84 : : void SetLessText( const XubString& rNewText );
85 : : XubString GetMoreText() const;
86 : : XubString GetLessText() const;
87 : : };
88 : :
89 : 0 : inline void MoreButton::SetState( sal_Bool bNewState )
90 : : {
91 [ # # ]: 0 : if ( mbState != bNewState )
92 : 0 : Click();
93 : 0 : }
94 : :
95 : : #endif // _SV_MOREBTN_HXX
96 : :
97 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|