1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef __FRAMEWORK_CLASSES_STATUSBARCONFIGURATION_HXX_ 28 #define __FRAMEWORK_CLASSES_STATUSBARCONFIGURATION_HXX_ 29 30 #include <framework/fwedllapi.h> 31 #include <svl/svarray.hxx> 32 #include <tools/string.hxx> 33 #include <tools/stream.hxx> 34 #include <vcl/status.hxx> 35 #include <com/sun/star/lang/XMultiServiceFactory.hpp> 36 #include <com/sun/star/io/XInputStream.hpp> 37 #include <com/sun/star/io/XOutputStream.hpp> 38 #include <com/sun/star/container/XIndexAccess.hpp> 39 #include <com/sun/star/container/XIndexContainer.hpp> 40 41 namespace framework 42 { 43 44 struct FWE_DLLPUBLIC StatusBarItemDescriptor 45 { 46 String aURL; // URL command to dispatch 47 long nItemBits; // properties for this statusbar item (WinBits) 48 long nWidth; // width of a statusbar item 49 long nOffset; // offset 50 51 public: 52 53 StatusBarItemDescriptor() : nItemBits( SIB_CENTER | SIB_IN ) 54 ,nWidth( 0 ) 55 ,nOffset( STATUSBAR_OFFSET ) {} 56 }; 57 58 typedef StatusBarItemDescriptor* StatusBarItemDescriptorPtr; 59 SV_DECL_PTRARR_DEL( StatusBarDescriptor, StatusBarItemDescriptorPtr, 10, 2) 60 61 class FWE_DLLPUBLIC StatusBarConfiguration 62 { 63 public: 64 static sal_Bool LoadStatusBar( 65 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, 66 SvStream& rInStream, StatusBarDescriptor& aItems ); 67 68 static sal_Bool StoreStatusBar( 69 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, 70 SvStream& rOutStream, const StatusBarDescriptor& aItems ); 71 72 static sal_Bool LoadStatusBar( 73 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, 74 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInputStream, 75 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& rStatusbarConfiguration ); 76 77 static sal_Bool StoreStatusBar( 78 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, 79 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutputStream, 80 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& rStatusbarConfiguration ); 81 }; 82 83 } // namespace framework 84 85 #endif // __FRAMEWORK_CLASSES_STATUSBARCONFIGURATION_HXX_ 86