1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_FRAMEWORK_ACTIONTRIGGERHELPER_HXX
21 #define INCLUDED_FRAMEWORK_ACTIONTRIGGERHELPER_HXX
23 #include <com/sun/star/container/XIndexContainer.hpp>
24 #include <vcl/menu.hxx>
25 #include <framework/fwedllapi.h>
30 class FWE_DLLPUBLIC ActionTriggerHelper
33 // Fills the submitted menu with the structure contained in the second
34 // parameter rActionTriggerContainer
35 // @param pNewMenu = must be a valid and empty menu
36 // @param rActionTriggerContainer = must be an instance of service "com.sun.star.ui.ActionTriggerContaienr"
38 CreateMenuFromActionTriggerContainer(
40 const com::sun::star::uno::Reference
< com::sun::star::container::XIndexContainer
>& rActionTriggerContainer
);
42 // Creates a "com::sun::star::ui::ActionTriggerContainer" with the structure of the menu
43 // provided as a parameter. The implementation class stores the menu pointer
44 // to optimize the time of creation of a menu from a actiontrigger structure.
45 // IMPORTANT: The caller must ensure that the menu pointer is valid through the
46 // life time of the XIndexContainer object!!!
47 // @param pNewMenu = Must be a valid menu. Please be aware that this implementation is based on
48 // the above mentioned restriction!!!
50 static com::sun::star::uno::Reference
< com::sun::star::container::XIndexContainer
> CreateActionTriggerContainerFromMenu(
51 const Menu
* pMenu
, const OUString
* pMenuIdentifier
);
53 // Fills the submitted rActionTriggerContainer with the structure of the menu
54 // provided as the second parameter
55 // @param rActionTriggerContainer = must be an instance of service "com.sun.star.ui.ActionTriggerContainer"
56 // @param pNewMenu = must be a valid menu
58 FillActionTriggerContainerFromMenu(
59 com::sun::star::uno::Reference
< com::sun::star::container::XIndexContainer
>& rActionTriggerContainer
,
65 #endif // INCLUDED_FRAMEWORK_ACTIONTRIGGERHELPER_HXX
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */