LibreOffice Module framework (master) 1
actiontriggerhelper.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <framework/fwkdllapi.h>
23#include <com/sun/star/uno/Reference.hxx>
24
25namespace com::sun::star::awt { class XPopupMenu; }
26namespace com::sun::star::container { class XIndexContainer; }
27
28namespace framework
29{
31 {
32 public:
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.ActionTriggerContainer"
37 static void
38 CreateMenuFromActionTriggerContainer(
39 const css::uno::Reference<css::awt::XPopupMenu>& rNewMenu,
40 const css::uno::Reference<css::container::XIndexContainer>& rActionTriggerContainer);
41
42 // Creates a "css::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 an 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 rMenu = Must be a valid menu. Please be aware that this implementation is based on
48 // the above mentioned restriction!!!
49
50 static css::uno::Reference< css::container::XIndexContainer > CreateActionTriggerContainerFromMenu(
51 const css::uno::Reference<css::awt::XPopupMenu>& rMenu, const OUString* pMenuIdentifier );
52
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 rMenu = must be a valid menu
57 static void
58 FillActionTriggerContainerFromMenu(
59 css::uno::Reference< css::container::XIndexContainer > const & rActionTriggerContainer,
60 const css::uno::Reference<css::awt::XPopupMenu>& rMenu);
61
62 };
63}
64
65/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define FWK_DLLPUBLIC
Definition: fwkdllapi.h:19