recentfilesmenucontroller.hxx (f8e07b45) | recentfilesmenucontroller.hxx (6d5620bc) |
---|---|
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 --- 10 unchanged lines hidden (view full) --- 19 * 20 *************************************************************/ 21 22 23 24#ifndef __FRAMEWORK_UIELEMENT_RECENTFILESMENUCONTROLLER_HXX_ 25#define __FRAMEWORK_UIELEMENT_RECENTFILESMENUCONTROLLER_HXX_ 26 | 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 --- 10 unchanged lines hidden (view full) --- 19 * 20 *************************************************************/ 21 22 23 24#ifndef __FRAMEWORK_UIELEMENT_RECENTFILESMENUCONTROLLER_HXX_ 25#define __FRAMEWORK_UIELEMENT_RECENTFILESMENUCONTROLLER_HXX_ 26 |
27//_________________________________________________________________________________________________________________ 28// my own includes 29//_________________________________________________________________________________________________________________ 30 | 27#include <svtools/popupmenucontrollerbase.hxx> |
31#include <macros/xserviceinfo.hxx> | 28#include <macros/xserviceinfo.hxx> |
32#include <stdtypes.h> | |
33 | 29 |
34//_________________________________________________________________________________________________________________ 35// interface includes 36//_________________________________________________________________________________________________________________ 37#include <com/sun/star/lang/XServiceInfo.hpp> 38#include <com/sun/star/lang/XTypeProvider.hpp> 39#include <com/sun/star/lang/XInitialization.hpp> 40#include <com/sun/star/lang/XMultiServiceFactory.hpp> 41#include <com/sun/star/frame/XFrame.hpp> 42#include <com/sun/star/frame/XDispatchProvider.hpp> 43#include <com/sun/star/frame/XDispatch.hpp> 44#include <com/sun/star/frame/XStatusListener.hpp> 45#include <com/sun/star/frame/XPopupMenuController.hpp> 46#include <com/sun/star/beans/XPropertySet.hpp> 47 48//_________________________________________________________________________________________________________________ 49// includes of other projects 50//_________________________________________________________________________________________________________________ 51#include <svtools/popupmenucontrollerbase.hxx> 52#include <toolkit/awt/vclxmenu.hxx> 53#include <cppuhelper/weak.hxx> 54#include <rtl/ustring.hxx> 55 | |
56namespace framework 57{ 58 struct LoadRecentFile 59 { 60 ::com::sun::star::util::URL aTargetURL; 61 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgSeq; 62 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch; 63 }; 64 65 class RecentFilesMenuController : public svt::PopupMenuControllerBase 66 { 67 using svt::PopupMenuControllerBase::disposing; 68 69 public: 70 RecentFilesMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); 71 virtual ~RecentFilesMenuController(); | 30namespace framework 31{ 32 struct LoadRecentFile 33 { 34 ::com::sun::star::util::URL aTargetURL; 35 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgSeq; 36 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch; 37 }; 38 39 class RecentFilesMenuController : public svt::PopupMenuControllerBase 40 { 41 using svt::PopupMenuControllerBase::disposing; 42 43 public: 44 RecentFilesMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); 45 virtual ~RecentFilesMenuController(); |
72 | 46 |
73 // XServiceInfo 74 DECLARE_XSERVICEINFO 75 | 47 // XServiceInfo 48 DECLARE_XSERVICEINFO 49 |
76 // XPopupMenuController 77 virtual void SAL_CALL updatePopupMenu() throw (::com::sun::star::uno::RuntimeException); 78 | |
79 // XStatusListener 80 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ); 81 82 // XMenuListener 83 virtual void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); 84 virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); 85 86 // XDispatchProvider 87 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& sTarget, sal_Int32 nFlags ) throw( ::com::sun::star::uno::RuntimeException ); 88 89 // XDispatch 90 virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& seqProperties ) throw( ::com::sun::star::uno::RuntimeException ); | 50 // XStatusListener 51 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ); 52 53 // XMenuListener 54 virtual void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); 55 virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); 56 57 // XDispatchProvider 58 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& sTarget, sal_Int32 nFlags ) throw( ::com::sun::star::uno::RuntimeException ); 59 60 // XDispatch 61 virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& seqProperties ) throw( ::com::sun::star::uno::RuntimeException ); |
91 virtual void SAL_CALL addStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, const ::com::sun::star::util::URL& aURL ) throw( ::com::sun::star::uno::RuntimeException ); 92 virtual void SAL_CALL removeStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, const ::com::sun::star::util::URL& aURL ) throw( ::com::sun::star::uno::RuntimeException ); 93 | 62 |
94 // XEventListener 95 virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException ); 96 97 DECL_STATIC_LINK( RecentFilesMenuController, ExecuteHdl_Impl, LoadRecentFile* ); | 63 // XEventListener 64 virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException ); 65 66 DECL_STATIC_LINK( RecentFilesMenuController, ExecuteHdl_Impl, LoadRecentFile* ); |
98 | 67 |
99 private: 100 virtual void impl_setPopupMenu(); 101 struct RecentFile 102 { 103 rtl::OUString aURL; 104 rtl::OUString aFilter; 105 rtl::OUString aTitle; 106 rtl::OUString aPassword; 107 }; 108 109 void fillPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu ); 110 void executeEntry( sal_Int32 nIndex ); 111 112 std::vector< RecentFile > m_aRecentFilesItems; 113 sal_Bool m_bDisabled : 1; 114 }; 115} 116 117#endif // __FRAMEWORK_UIELEMENT_RECENTFILESMENUCONTROLLER_HXX_ | 68 private: 69 virtual void impl_setPopupMenu(); 70 struct RecentFile 71 { 72 rtl::OUString aURL; 73 rtl::OUString aFilter; 74 rtl::OUString aTitle; 75 rtl::OUString aPassword; 76 }; 77 78 void fillPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu ); 79 void executeEntry( sal_Int32 nIndex ); 80 81 std::vector< RecentFile > m_aRecentFilesItems; 82 sal_Bool m_bDisabled : 1; 83 }; 84} 85 86#endif // __FRAMEWORK_UIELEMENT_RECENTFILESMENUCONTROLLER_HXX_ |