update credits
[LibreOffice.git] / framework / inc / uielement / statusbarmerger.hxx
blob618791394b60f1d7fc05cabcce78dde88507050c
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 #ifndef __FRAMEWORK_UIELEMENT_STATUSBARMERGER_HXX_
19 #define __FRAMEWORK_UIELEMENT_STATUSBARMERGER_HXX_
21 #include <com/sun/star/beans/PropertyValue.hpp>
22 #include <rtl/ustring.hxx>
23 #include <uielement/statusbar.hxx>
25 namespace framework
28 struct AddonStatusbarItemData
30 rtl::OUString aLabel;
31 sal_uInt16 nItemBits;
34 struct AddonStatusbarItem
36 rtl::OUString aCommandURL;
37 rtl::OUString aLabel;
38 rtl::OUString aContext;
39 sal_uInt16 nItemBits;
40 sal_Int16 nWidth;
43 typedef ::std::vector< AddonStatusbarItem > AddonStatusbarItemContainer;
45 class StatusbarMerger
47 public:
48 static bool IsCorrectContext( const ::rtl::OUString& aContext,
49 const ::rtl::OUString& aModuleIdentifier );
51 static bool ConvertSeqSeqToVector( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > &rSequence,
52 AddonStatusbarItemContainer& rContainer );
54 static sal_uInt16 FindReferencePos( StatusBar* pStatusbar,
55 const ::rtl::OUString& rReferencePoint );
57 static bool ProcessMergeOperation( StatusBar* pStatusbar,
58 sal_uInt16 nPos,
59 sal_uInt16& rItemId,
60 const ::rtl::OUString& rModuleIdentifier,
61 const ::rtl::OUString& rMergeCommand,
62 const ::rtl::OUString& rMergeCommandParameter,
63 const AddonStatusbarItemContainer& rItems );
65 static bool ProcessMergeFallback( StatusBar* pStatusbar,
66 sal_uInt16 nPos,
67 sal_uInt16& rItemId,
68 const ::rtl::OUString& rModuleIdentifier,
69 const ::rtl::OUString& rMergeCommand,
70 const ::rtl::OUString& rMergeFallback,
71 const AddonStatusbarItemContainer& rItems );
73 private:
74 StatusbarMerger();
75 StatusbarMerger( const StatusbarMerger& );
76 StatusbarMerger& operator=( const StatusbarMerger& );
81 #endif