1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef __FRAMEWORK_UIELEMENT_STATUSBARITEM_HXX_
23 #define __FRAMEWORK_UIELEMENT_STATUSBARITEM_HXX_
24 
25 #include <com/sun/star/ui/XStatusbarItem.hpp>
26 #include <cppuhelper/compbase1.hxx>
27 #include <cppuhelper/basemutex.hxx>
28 
29 class StatusBar;
30 
31 namespace framework
32 {
33 
34 struct AddonStatusbarItemData;
35 
36 typedef cppu::WeakComponentImplHelper1< com::sun::star::ui::XStatusbarItem > StatusbarItem_Base;
37 
38 class StatusbarItem : protected cppu::BaseMutex,
39                       public StatusbarItem_Base
40 {
41 public:
42     explicit StatusbarItem(
43                             StatusBar              *pStatusBar,
44                             AddonStatusbarItemData *pItemData,
45                             sal_uInt16              nId,
46                             const rtl::OUString&   aCommand );
47     ~StatusbarItem();
48 
49     void SAL_CALL disposing();
50 
51     // com::sun::star::ui::XStatusbarItem Attributes
52     virtual ::rtl::OUString SAL_CALL getCommand() throw (::com::sun::star::uno::RuntimeException);
53     virtual ::sal_uInt16 SAL_CALL getItemId() throw (::com::sun::star::uno::RuntimeException);
54     virtual ::sal_uInt32 SAL_CALL getWidth() throw (::com::sun::star::uno::RuntimeException);
55     virtual ::sal_uInt16 SAL_CALL getStyle() throw (::com::sun::star::uno::RuntimeException);
56     virtual ::sal_Int32 SAL_CALL getOffset() throw (::com::sun::star::uno::RuntimeException);
57     virtual ::com::sun::star::awt::Rectangle SAL_CALL getItemRect() throw (::com::sun::star::uno::RuntimeException);
58     virtual ::rtl::OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException);
59     virtual void SAL_CALL setText( const rtl::OUString& rText ) throw (::com::sun::star::uno::RuntimeException);
60     virtual ::rtl::OUString SAL_CALL getHelpText() throw (::com::sun::star::uno::RuntimeException);
61     virtual void SAL_CALL setHelpText( const rtl::OUString& rHelpText ) throw (::com::sun::star::uno::RuntimeException);
62     virtual ::rtl::OUString SAL_CALL getQuickHelpText() throw (::com::sun::star::uno::RuntimeException);
63     virtual void SAL_CALL setQuickHelpText( const rtl::OUString& rQuickHelpText ) throw (::com::sun::star::uno::RuntimeException);
64     virtual ::rtl::OUString SAL_CALL getAccessibleName() throw (::com::sun::star::uno::RuntimeException);
65     virtual void SAL_CALL setAccessibleName( const rtl::OUString& rAccessibleName ) throw (::com::sun::star::uno::RuntimeException);
66     virtual ::sal_Bool SAL_CALL getVisible() throw (::com::sun::star::uno::RuntimeException);
67     virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw (::com::sun::star::uno::RuntimeException);
68 
69     // com::sun::star::ui::XStatusbarItem Methods
70     virtual void SAL_CALL repaint(  ) throw (::com::sun::star::uno::RuntimeException);
71 
72 private:
73     StatusBar              *m_pStatusBar;
74     AddonStatusbarItemData *m_pItemData;
75     sal_uInt16              m_nId;
76     sal_uInt16              m_nStyle;
77     rtl::OUString           m_aCommand;
78 
79 };
80 
81 }
82 
83 #endif
84