1*2503e1a5SAriel Constenla-Haile /************************************************************** 2*2503e1a5SAriel Constenla-Haile * 3*2503e1a5SAriel Constenla-Haile * Licensed to the Apache Software Foundation (ASF) under one 4*2503e1a5SAriel Constenla-Haile * or more contributor license agreements. See the NOTICE file 5*2503e1a5SAriel Constenla-Haile * distributed with this work for additional information 6*2503e1a5SAriel Constenla-Haile * regarding copyright ownership. The ASF licenses this file 7*2503e1a5SAriel Constenla-Haile * to you under the Apache License, Version 2.0 (the 8*2503e1a5SAriel Constenla-Haile * "License"); you may not use this file except in compliance 9*2503e1a5SAriel Constenla-Haile * with the License. You may obtain a copy of the License at 10*2503e1a5SAriel Constenla-Haile * 11*2503e1a5SAriel Constenla-Haile * http://www.apache.org/licenses/LICENSE-2.0 12*2503e1a5SAriel Constenla-Haile * 13*2503e1a5SAriel Constenla-Haile * Unless required by applicable law or agreed to in writing, 14*2503e1a5SAriel Constenla-Haile * software distributed under the License is distributed on an 15*2503e1a5SAriel Constenla-Haile * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*2503e1a5SAriel Constenla-Haile * KIND, either express or implied. See the License for the 17*2503e1a5SAriel Constenla-Haile * specific language governing permissions and limitations 18*2503e1a5SAriel Constenla-Haile * under the License. 19*2503e1a5SAriel Constenla-Haile * 20*2503e1a5SAriel Constenla-Haile *************************************************************/ 21*2503e1a5SAriel Constenla-Haile 22*2503e1a5SAriel Constenla-Haile #ifndef __FRAMEWORK_UIELEMENT_STATUSBARMERGER_HXX_ 23*2503e1a5SAriel Constenla-Haile #define __FRAMEWORK_UIELEMENT_STATUSBARMERGER_HXX_ 24*2503e1a5SAriel Constenla-Haile 25*2503e1a5SAriel Constenla-Haile #include <com/sun/star/beans/PropertyValue.hpp> 26*2503e1a5SAriel Constenla-Haile #include <rtl/ustring.hxx> 27*2503e1a5SAriel Constenla-Haile #include <uielement/statusbar.hxx> 28*2503e1a5SAriel Constenla-Haile 29*2503e1a5SAriel Constenla-Haile namespace framework 30*2503e1a5SAriel Constenla-Haile { 31*2503e1a5SAriel Constenla-Haile 32*2503e1a5SAriel Constenla-Haile struct AddonStatusbarItemData 33*2503e1a5SAriel Constenla-Haile { 34*2503e1a5SAriel Constenla-Haile rtl::OUString aLabel; 35*2503e1a5SAriel Constenla-Haile sal_uInt16 nItemBits; 36*2503e1a5SAriel Constenla-Haile }; 37*2503e1a5SAriel Constenla-Haile 38*2503e1a5SAriel Constenla-Haile struct AddonStatusbarItem 39*2503e1a5SAriel Constenla-Haile { 40*2503e1a5SAriel Constenla-Haile rtl::OUString aCommandURL; 41*2503e1a5SAriel Constenla-Haile rtl::OUString aLabel; 42*2503e1a5SAriel Constenla-Haile rtl::OUString aContext; 43*2503e1a5SAriel Constenla-Haile sal_uInt16 nItemBits; 44*2503e1a5SAriel Constenla-Haile sal_Int16 nWidth; 45*2503e1a5SAriel Constenla-Haile }; 46*2503e1a5SAriel Constenla-Haile 47*2503e1a5SAriel Constenla-Haile typedef ::std::vector< AddonStatusbarItem > AddonStatusbarItemContainer; 48*2503e1a5SAriel Constenla-Haile 49*2503e1a5SAriel Constenla-Haile class StatusbarMerger 50*2503e1a5SAriel Constenla-Haile { 51*2503e1a5SAriel Constenla-Haile public: 52*2503e1a5SAriel Constenla-Haile static bool IsCorrectContext( const ::rtl::OUString& aContext, 53*2503e1a5SAriel Constenla-Haile const ::rtl::OUString& aModuleIdentifier ); 54*2503e1a5SAriel Constenla-Haile 55*2503e1a5SAriel Constenla-Haile static bool ConvertSeqSeqToVector( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > &rSequence, 56*2503e1a5SAriel Constenla-Haile AddonStatusbarItemContainer& rContainer ); 57*2503e1a5SAriel Constenla-Haile 58*2503e1a5SAriel Constenla-Haile static sal_uInt16 FindReferencePos( StatusBar* pStatusbar, 59*2503e1a5SAriel Constenla-Haile const ::rtl::OUString& rReferencePoint ); 60*2503e1a5SAriel Constenla-Haile 61*2503e1a5SAriel Constenla-Haile static bool ProcessMergeOperation( StatusBar* pStatusbar, 62*2503e1a5SAriel Constenla-Haile sal_uInt16 nPos, 63*2503e1a5SAriel Constenla-Haile sal_uInt16& rItemId, 64*2503e1a5SAriel Constenla-Haile const ::rtl::OUString& rModuleIdentifier, 65*2503e1a5SAriel Constenla-Haile const ::rtl::OUString& rMergeCommand, 66*2503e1a5SAriel Constenla-Haile const ::rtl::OUString& rMergeCommandParameter, 67*2503e1a5SAriel Constenla-Haile const AddonStatusbarItemContainer& rItems ); 68*2503e1a5SAriel Constenla-Haile 69*2503e1a5SAriel Constenla-Haile static bool ProcessMergeFallback( StatusBar* pStatusbar, 70*2503e1a5SAriel Constenla-Haile sal_uInt16 nPos, 71*2503e1a5SAriel Constenla-Haile sal_uInt16& rItemId, 72*2503e1a5SAriel Constenla-Haile const ::rtl::OUString& rModuleIdentifier, 73*2503e1a5SAriel Constenla-Haile const ::rtl::OUString& rMergeCommand, 74*2503e1a5SAriel Constenla-Haile const ::rtl::OUString& rMergeFallback, 75*2503e1a5SAriel Constenla-Haile const AddonStatusbarItemContainer& rItems ); 76*2503e1a5SAriel Constenla-Haile 77*2503e1a5SAriel Constenla-Haile private: 78*2503e1a5SAriel Constenla-Haile StatusbarMerger(); 79*2503e1a5SAriel Constenla-Haile StatusbarMerger( const StatusbarMerger& ); 80*2503e1a5SAriel Constenla-Haile StatusbarMerger& operator=( const StatusbarMerger& ); 81*2503e1a5SAriel Constenla-Haile }; 82*2503e1a5SAriel Constenla-Haile 83*2503e1a5SAriel Constenla-Haile } 84*2503e1a5SAriel Constenla-Haile 85*2503e1a5SAriel Constenla-Haile #endif 86