1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: actiontriggerhelper.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_HELPER_ACTIONTRIGGERHELPER_HXX_
32 #define __FRAMEWORK_HELPER_ACTIONTRIGGERHELPER_HXX_
34 #include <com/sun/star/container/XIndexContainer.hpp>
37 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
38 #include <vcl/menu.hxx>
43 class ActionTriggerHelper
46 // Fills the submitted menu with the structure contained in the second
47 // parameter rActionTriggerContainer
48 // @param pNewMenu = must be a valid and empty menu
49 // @param rActionTriggerContainer = must be an instance of service "com.sun.star.ui.ActionTriggerContaienr"
51 CreateMenuFromActionTriggerContainer(
53 const com::sun::star::uno::Reference
< com::sun::star::container::XIndexContainer
>& rActionTriggerContainer
);
55 // Creates a "com::sun::star::ui::ActionTriggerContainer" with the structure of the menu
56 // provided as a parameter. The implementation class stores the menu pointer
57 // to optimize the time of creation of a menu from a actiontrigger structure.
58 // IMPORTANT: The caller must ensure that the menu pointer is valid through the
59 // life time of the XIndexContainer object!!!
61 // @param pNewMenu = Must be a valid menu. Please be aware that this implementation is based on
62 // the above mentioned restriction!!!
65 static com::sun::star::uno::Reference
< com::sun::star::container::XIndexContainer
> CreateActionTriggerContainerFromMenu(
66 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceFactory
,
67 const Menu
* pMenu
, const ::rtl::OUString
* pMenuIdentifier
);
69 // Fills the submitted rActionTriggerContainer with the structure of the menu
70 // provided as the second parameter
71 // @param rActionTriggerContainer = must be an instance of service "com.sun.star.ui.ActionTriggerContainer"
72 // @param pNewMenu = must be a valid menu
74 FillActionTriggerContainerFromMenu(
75 com::sun::star::uno::Reference
< com::sun::star::container::XIndexContainer
>& rActionTriggerContainer
,
81 #endif // __FRAMEWORK_HELPER_ACTIONTRIGGERHELPER_HXX_