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 23 24 #ifndef _FRAMEWORK_UIELEMENT_PROGRESSBARWRAPPER_HXX_ 25 #define _FRAMEWORK_UIELEMENT_PROGRESSBARWRAPPER_HXX_ 26 27 //_________________________________________________________________________________________________________________ 28 // my own includes 29 //_________________________________________________________________________________________________________________ 30 31 #include <helper/uielementwrapperbase.hxx> 32 #include <threadhelp/threadhelpbase.hxx> 33 #include <macros/generic.hxx> 34 #include <macros/xinterface.hxx> 35 #include <macros/xtypeprovider.hxx> 36 #include <macros/debug.hxx> 37 38 //_________________________________________________________________________________________________________________ 39 // interface includes 40 //_________________________________________________________________________________________________________________ 41 #include <com/sun/star/task/XStatusIndicator.hpp> 42 #include <com/sun/star/awt/XWindow.hpp> 43 44 //_________________________________________________________________________________________________________________ 45 // other includes 46 //_________________________________________________________________________________________________________________ 47 #include <cppuhelper/weak.hxx> 48 #include <cppuhelper/weakref.hxx> 49 50 //_________________________________________________________________________________________________________________ 51 // namespace 52 //_________________________________________________________________________________________________________________ 53 54 namespace framework{ 55 56 class ProgressBarWrapper : public UIElementWrapperBase 57 { 58 public: 59 //--------------------------------------------------------------------------------------------------------- 60 // constructor / destructor 61 //--------------------------------------------------------------------------------------------------------- 62 ProgressBarWrapper(); 63 virtual ~ProgressBarWrapper(); 64 65 // public interfaces 66 void setStatusBar( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& rStatusBar, sal_Bool bOwnsInstance = sal_False ); 67 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > getStatusBar() const; 68 69 // wrapped methods of ::com::sun::star::task::XStatusIndicator 70 void start( const ::rtl::OUString& Text, ::sal_Int32 Range ) throw (::com::sun::star::uno::RuntimeException); 71 void end() throw (::com::sun::star::uno::RuntimeException); 72 void setText( const ::rtl::OUString& Text ) throw (::com::sun::star::uno::RuntimeException); 73 void setValue( ::sal_Int32 Value ) throw (::com::sun::star::uno::RuntimeException); 74 void reset() throw (::com::sun::star::uno::RuntimeException); 75 76 // UNO interfaces 77 // XComponent 78 virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException); 79 80 // XInitialization 81 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 82 83 // XUpdatable 84 virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException); 85 86 // XUIElement 87 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getRealInterface() throw (::com::sun::star::uno::RuntimeException); 88 89 //------------------------------------------------------------------------------------------------------------- 90 // variables 91 // (should be private everyway!) 92 //------------------------------------------------------------------------------------------------------------- 93 private: 94 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xStatusBar; // Reference to our status bar XWindow 95 ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface > m_xProgressBarIfacWrapper; 96 sal_Bool m_bOwnsInstance; // Indicator that we are owner of the XWindow 97 sal_Int32 m_nRange; 98 sal_Int32 m_nValue; 99 rtl::OUString m_aText; 100 }; // class ProgressBarWrapper 101 102 } // namespace framework 103 104 #endif // _FRAMEWORK_UIELEMENT_PROGRESSBARWRAPPER_HXX_ 105