xref: /trunk/main/framework/inc/framework/statusbarconfiguration.hxx (revision b5da552ccefc4034e06a43bfae43fb8a8b64a7ad)
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 #ifndef __FRAMEWORK_CLASSES_STATUSBARCONFIGURATION_HXX_
24 #define __FRAMEWORK_CLASSES_STATUSBARCONFIGURATION_HXX_
25 
26 #include <framework/fwedllapi.h>
27 #include <svl/svarray.hxx>
28 #include <tools/string.hxx>
29 #include <tools/stream.hxx>
30 #include <vcl/status.hxx>
31 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
32 #include <com/sun/star/io/XInputStream.hpp>
33 #include <com/sun/star/io/XOutputStream.hpp>
34 #include <com/sun/star/container/XIndexAccess.hpp>
35 #include <com/sun/star/container/XIndexContainer.hpp>
36 
37 namespace framework
38 {
39 
40 struct FWE_DLLPUBLIC StatusBarItemDescriptor
41 {
42     String  aURL;                       // URL command to dispatch
43     long    nItemBits;                  // properties for this statusbar item (WinBits)
44     long    nWidth;                     // width of a statusbar item
45     long    nOffset;                    // offset
46 
47     public:
48 
49         StatusBarItemDescriptor() : nItemBits( SIB_CENTER | SIB_IN )
50                                     ,nWidth( 0 )
51                                     ,nOffset( STATUSBAR_OFFSET ) {}
52 };
53 
54 typedef StatusBarItemDescriptor* StatusBarItemDescriptorPtr;
55 SV_DECL_PTRARR_DEL( StatusBarDescriptor, StatusBarItemDescriptorPtr, 10, 2)
56 
57 class FWE_DLLPUBLIC StatusBarConfiguration
58 {
59     public:
60         static sal_Bool LoadStatusBar(
61             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
62             SvStream& rInStream, StatusBarDescriptor& aItems );
63 
64         static sal_Bool StoreStatusBar(
65             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
66             SvStream& rOutStream, const StatusBarDescriptor& aItems );
67 
68         static sal_Bool LoadStatusBar(
69             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
70             const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInputStream,
71             const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& rStatusbarConfiguration );
72 
73         static sal_Bool StoreStatusBar(
74             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
75             const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutputStream,
76             const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& rStatusbarConfiguration );
77 };
78 
79 } // namespace framework
80 
81 #endif // __FRAMEWORK_CLASSES_STATUSBARCONFIGURATION_HXX_
82