Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef __FRAMEWORK_XML_MENUCONFIGURATION_HXX_
30 : : #define __FRAMEWORK_XML_MENUCONFIGURATION_HXX_
31 : :
32 : : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 : : #include <com/sun/star/lang/WrappedTargetException.hpp>
34 : : #include <com/sun/star/io/XInputStream.hpp>
35 : : #include <com/sun/star/io/XOutputStream.hpp>
36 : : #include <com/sun/star/frame/XFrame.hpp>
37 : : #include <com/sun/star/container/XIndexContainer.hpp>
38 : : #include <com/sun/star/container/XIndexAccess.hpp>
39 : : #include <com/sun/star/frame/XDispatchProvider.hpp>
40 : : #include <framework/fwedllapi.h>
41 : :
42 : : #include <cppuhelper/weak.hxx>
43 : : #include <vcl/menu.hxx>
44 : : #include <vcl/toolbox.hxx>
45 : :
46 : : #define BOOKMARK_NEWMENU ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:menu_bookmark_new" ))
47 : : #define BOOKMARK_WIZARDMENU ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:menu_bookmark_wizard" ))
48 : :
49 : : // Prepare for inclusion by framework and sfx
50 : : // Please consider that there is a corresponding define also in sfxsids.hrc!! (SID_SFX_START)/(SID_ADDONS)
51 : : #define FWK_SID_SFX_START 5000
52 : : #define FWK_SID_ADDONS (FWK_SID_SFX_START+1678)
53 : : #define FWK_SID_ADDONHELP (FWK_SID_SFX_START+1684)
54 : :
55 : : const sal_uInt16 START_ITEMID_PICKLIST = 4500;
56 : : const sal_uInt16 END_ITEMID_PICKLIST = 4599;
57 : : const sal_uInt16 MAX_ITEMCOUNT_PICKLIST = 99; // difference between START_... & END_... for picklist / must be changed too, if these values are changed!
58 : : const sal_uInt16 START_ITEMID_WINDOWLIST = 4600;
59 : : const sal_uInt16 END_ITEMID_WINDOWLIST = 4699;
60 : : const sal_uInt16 ITEMID_ADDONLIST = FWK_SID_ADDONS;
61 : : const sal_uInt16 ITEMID_ADDONHELP = FWK_SID_ADDONHELP;
62 : :
63 : : namespace framework
64 : : {
65 : :
66 : : class FWE_DLLPUBLIC MenuConfiguration
67 : : {
68 : : public:
69 [ + - ]: 13248 : struct Attributes
70 : : {
71 [ + - ]: 32 : Attributes() {}
72 : 13248 : Attributes( const ::rtl::OUString& aFrame, const ::rtl::OUString& aImageIdStr ) :
73 [ + - ]: 13248 : aTargetFrame( aFrame ), aImageId( aImageIdStr ) {}
74 : :
75 : : ::rtl::OUString aTargetFrame;
76 : : ::rtl::OUString aImageId;
77 : : ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XDispatchProvider > xDispatchProvider;
78 : : sal_Int16 nStyle;
79 : : };
80 : :
81 : : MenuConfiguration(
82 : : // use const when giving a uno reference by reference
83 : : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
84 : :
85 : : virtual ~MenuConfiguration();
86 : :
87 : : ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > CreateMenuBarConfigurationFromXML(
88 : : ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream )
89 : : throw ( ::com::sun::star::lang::WrappedTargetException );
90 : :
91 : : PopupMenu* CreateBookmarkMenu(
92 : : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
93 : : const ::rtl::OUString& aURL )
94 : : throw ( ::com::sun::star::lang::WrappedTargetException );
95 : :
96 : : ToolBox* CreateToolBoxFromConfiguration(
97 : : ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream )
98 : : throw ( ::com::sun::star::lang::WrappedTargetException );
99 : :
100 : : void StoreMenuBarConfigurationToXML( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& rMenuBarConfiguration,
101 : : ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOutputStream )
102 : : throw ( ::com::sun::star::lang::WrappedTargetException );
103 : :
104 : : void StoreToolBox( ToolBox* pToolBox,
105 : : ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOutputStream )
106 : : throw ( ::com::sun::star::lang::WrappedTargetException );
107 : :
108 : : private:
109 : : // do not hold the uno reference by reference
110 : : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& m_rxServiceManager;
111 : : };
112 : :
113 : : }
114 : :
115 : : #endif // __FRAMEWORK_XML_MENUCONFIGURATION_HXX_
116 : :
117 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|