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 : #include <uielement/toolbar.hxx>
21 : #include <uielement/toolbarmanager.hxx>
22 : #include <rtl/logfile.hxx>
23 :
24 : namespace framework
25 : {
26 :
27 731 : ToolBar::ToolBar( Window* pParent, WinBits nWinBits ) :
28 : ToolBox( pParent, nWinBits )
29 731 : , m_pToolBarManager( 0 )
30 : {
31 731 : }
32 :
33 380 : ToolBar::~ToolBar()
34 : {
35 380 : }
36 :
37 731 : void ToolBar::SetToolBarManager( ToolBarManager* pTbMgr )
38 : {
39 731 : m_pToolBarManager = pTbMgr;
40 731 : }
41 :
42 0 : void ToolBar::Command( const CommandEvent& rCEvt )
43 : {
44 0 : if ( m_aCommandHandler.IsSet() )
45 0 : m_aCommandHandler.Call( (void *)( &rCEvt ));
46 0 : ToolBox::Command( rCEvt );
47 0 : }
48 :
49 1956 : void ToolBar::StateChanged( StateChangedType nType )
50 : {
51 1956 : ToolBox::StateChanged( nType );
52 1956 : if ( m_aStateChangedHandler.IsSet() )
53 1956 : m_aStateChangedHandler.Call( &nType );
54 1956 : }
55 :
56 288 : void ToolBar::DataChanged( const DataChangedEvent& rDCEvt )
57 : {
58 288 : ToolBox::DataChanged( rDCEvt );
59 288 : if ( m_aDataChangedHandler.IsSet() )
60 288 : m_aDataChangedHandler.Call( (void*)&rDCEvt );
61 288 : }
62 :
63 : }
64 :
65 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|