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: stmenu.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 ************************************************************************/
36 #ifndef _MENU_HXX //autogen
37 #include <vcl/menu.hxx>
41 #include <com/sun/star/smarttags/XSmartTagAction.hpp>
43 #ifndef _COM_SUN_STAR_SMARTTAGS_XSTRINGKEYMAP_HPP_
44 #include <com/sun/star/container/XStringKeyMap.hpp>
46 #include <com/sun/star/text/XTextRange.hpp>
50 /** Class: SwSmartTagPopup
52 This class contains the implementation of the smarttag popup
53 menu that is opened if a user clicks on an underlined word.
55 The menu is built in the constructor and the actions for each
56 menu entry are invoked in the excute-method.
59 class SwSmartTagPopup
: public PopupMenu
62 com::sun::star::uno::Reference
< com::sun::star::text::XTextRange
> mxTextRange
;
66 com::sun::star::uno::Reference
< com::sun::star::smarttags::XSmartTagAction
> mxAction
;
67 com::sun::star::uno::Reference
< com::sun::star::container::XStringKeyMap
> mxSmartTagProperties
;
68 sal_uInt32 mnActionID
;
69 InvokeAction( com::sun::star::uno::Reference
< com::sun::star::smarttags::XSmartTagAction
> xAction
,
70 com::sun::star::uno::Reference
< com::sun::star::container::XStringKeyMap
> xSmartTagProperties
,
71 sal_uInt32 nActionID
) : mxAction( xAction
), mxSmartTagProperties( xSmartTagProperties
), mnActionID( nActionID
) {}
74 std::vector
< InvokeAction
> maInvokeActions
;
76 using PopupMenu::Execute
;
79 SwSmartTagPopup( SwView
* _pSwView
,
80 ::com::sun::star::uno::Sequence
< rtl::OUString
>& rSmartTagTypes
,
81 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::container::XStringKeyMap
> >& rStringKeyMaps
,
82 ::com::sun::star::uno::Reference
< com::sun::star::text::XTextRange
> xTextRange
);
84 sal_uInt16
Execute( const Rectangle
& rPopupPos
, Window
* pWin
);