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 : : #include <uielement/statusbar.hxx>
30 : :
31 : : #include <vcl/svapp.hxx>
32 : :
33 : : namespace framework
34 : : {
35 : :
36 : 1741 : FrameworkStatusBar::FrameworkStatusBar(
37 : : Window* pParent,
38 : : WinBits nWinBits ) :
39 : : StatusBar( pParent, nWinBits ),
40 : 1741 : m_pMgr( NULL )
41 : : {
42 : : // set optimal size
43 [ + - ][ + - ]: 1741 : SetOutputSizePixel( CalcWindowSizePixel() );
44 : 1741 : }
45 : :
46 : 1650 : FrameworkStatusBar::~FrameworkStatusBar()
47 : : {
48 [ - + ]: 3300 : }
49 : :
50 : 1741 : void FrameworkStatusBar::SetStatusBarManager( StatusBarManager* pStatusBarManager )
51 : : {
52 [ + - ]: 1741 : SolarMutexGuard aSolarMutexGuard;
53 [ + - ]: 1741 : m_pMgr = pStatusBarManager;
54 : 1741 : }
55 : :
56 : 16169 : void FrameworkStatusBar::UserDraw(const UserDrawEvent& rUDEvt)
57 : : {
58 [ + - ]: 16169 : if ( m_pMgr )
59 : 16169 : m_pMgr->UserDraw( rUDEvt );
60 : 16169 : }
61 : :
62 : 0 : void FrameworkStatusBar::Command( const CommandEvent& rEvt )
63 : : {
64 [ # # ]: 0 : if ( m_pMgr )
65 : 0 : m_pMgr->Command( rEvt );
66 : 0 : }
67 : :
68 : 3912 : void FrameworkStatusBar::StateChanged( StateChangedType nType )
69 : : {
70 [ + - ]: 3912 : if ( m_pMgr )
71 : 3912 : m_pMgr->StateChanged( nType );
72 : 3912 : }
73 : :
74 : 6 : void FrameworkStatusBar::DataChanged( const DataChangedEvent& rDCEvt )
75 : : {
76 : 6 : StatusBar::DataChanged( rDCEvt );
77 [ + - ]: 6 : if ( m_pMgr )
78 : 6 : m_pMgr->DataChanged( rDCEvt );
79 : 6 : }
80 : :
81 : 0 : void FrameworkStatusBar::MouseMove( const MouseEvent& rMEvt )
82 : : {
83 : 0 : StatusBar::MouseMove( rMEvt );
84 [ # # ]: 0 : if ( m_pMgr )
85 : 0 : m_pMgr->MouseMove( rMEvt );
86 : 0 : }
87 : :
88 : 0 : void FrameworkStatusBar::MouseButtonDown( const MouseEvent& rMEvt )
89 : : {
90 : 0 : StatusBar::MouseButtonDown( rMEvt );
91 [ # # ]: 0 : if ( m_pMgr )
92 : 0 : m_pMgr->MouseButtonDown( rMEvt );
93 : 0 : }
94 : :
95 : 0 : void FrameworkStatusBar::MouseButtonUp( const MouseEvent& rMEvt )
96 : : {
97 : 0 : StatusBar::MouseButtonUp( rMEvt );
98 [ # # ]: 0 : if ( m_pMgr )
99 : 0 : m_pMgr->MouseButtonUp( rMEvt );
100 : 0 : }
101 : :
102 : : }
103 : :
104 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|