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 "toolkit/awt/xthrobber.hxx"
30 : : #include "toolkit/helper/property.hxx"
31 : : #include <toolkit/helper/tkresmgr.hxx>
32 : :
33 : : #include "xthrobber.hrc"
34 : : #include <tools/debug.hxx>
35 : : #include <vcl/fixed.hxx>
36 : : #include <vcl/timer.hxx>
37 : : #include <vcl/svapp.hxx>
38 : : #include <vcl/throbber.hxx>
39 : :
40 : : //........................................................................
41 : : namespace toolkit
42 : : {
43 : : //........................................................................
44 : :
45 : : using namespace ::com::sun::star;
46 : :
47 : : //====================================================================
48 : : //= XThrobber
49 : : //====================================================================
50 : : DBG_NAME( XThrobber )
51 : :
52 : : //--------------------------------------------------------------------
53 : 0 : XThrobber::XThrobber()
54 : : {
55 : : DBG_CTOR( XThrobber, NULL );
56 : 0 : }
57 : :
58 : : //--------------------------------------------------------------------
59 : 0 : XThrobber::~XThrobber()
60 : : {
61 : : DBG_DTOR( XThrobber, NULL );
62 [ # # ]: 0 : }
63 : :
64 : : //--------------------------------------------------------------------
65 : 0 : void SAL_CALL XThrobber::start() throw ( uno::RuntimeException )
66 : : {
67 [ # # ]: 0 : SolarMutexGuard aGuard;
68 [ # # ]: 0 : Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
69 [ # # ]: 0 : if ( pThrobber != NULL)
70 [ # # ][ # # ]: 0 : pThrobber->start();
71 : 0 : }
72 : :
73 : : //--------------------------------------------------------------------
74 : 0 : void SAL_CALL XThrobber::stop() throw ( uno::RuntimeException )
75 : : {
76 [ # # ]: 0 : SolarMutexGuard aGuard;
77 [ # # ]: 0 : Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
78 [ # # ]: 0 : if ( pThrobber != NULL)
79 [ # # ][ # # ]: 0 : pThrobber->stop();
80 : 0 : }
81 : :
82 : : //--------------------------------------------------------------------
83 : 0 : void XThrobber::SetWindow( Window* pWindow )
84 : : {
85 : 0 : XThrobber_Base::SetWindow( pWindow );
86 : 0 : InitImageList();
87 : 0 : }
88 : :
89 : : //--------------------------------------------------------------------
90 : 0 : void SAL_CALL XThrobber::InitImageList()
91 : : throw( uno::RuntimeException )
92 : : {
93 [ # # ]: 0 : SolarMutexGuard aGuard;
94 : :
95 [ # # ]: 0 : Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
96 [ # # ]: 0 : if ( pThrobber == NULL)
97 : 0 : return;
98 : :
99 [ # # ]: 0 : uno::Sequence< uno::Reference< graphic::XGraphic > > aImageList(12);
100 : 0 : sal_uInt16 nIconIdStart = RID_TK_ICON_THROBBER_START;
101 : :
102 [ # # ]: 0 : for ( sal_uInt16 i=0; i<12; i++ )
103 : : {
104 [ # # ]: 0 : Image aImage = TK_RES_IMAGE( nIconIdStart + i );
105 [ # # ][ # # ]: 0 : aImageList[i] = aImage.GetXGraphic();
[ # # ]
106 [ # # ]: 0 : }
107 : :
108 [ # # ][ # # ]: 0 : pThrobber->setImageList( aImageList );
[ # # ][ # # ]
109 : : }
110 : :
111 : : //........................................................................
112 : : } // namespace toolkit
113 : : //........................................................................
114 : :
115 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|