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: acceleratorconfigurationwriter.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_XML_ACCELERATORCONFIGURATIONWRITER_HXX_
32 #define _FRAMEWORK_XML_ACCELERATORCONFIGURATIONWRITER_HXX_
34 //_______________________________________________
37 #include <accelerators/acceleratorcache.hxx>
38 #include <accelerators/keymapping.hxx>
39 #include <threadhelp/threadhelpbase.hxx>
42 //_______________________________________________
45 #ifndef __COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_
46 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
49 //_______________________________________________
51 #include <salhelper/singletonref.hxx>
52 #include <rtl/ustring.hxx>
56 class AcceleratorConfigurationWriter
: private ThreadHelpBase
58 //-------------------------------------------
63 //---------------------------------------
64 /** @short needed to write the xml configuration. */
65 css::uno::Reference
< css::xml::sax::XDocumentHandler
> m_xConfig
;
67 //---------------------------------------
68 /** @short reference to the outside container, where this
69 writer must work on. */
70 const AcceleratorCache
& m_rContainer
;
72 //---------------------------------------
73 /** @short is used to map key codes to its
74 string representation.
76 @descr To perform this operatio is
77 created only one times and holded
79 ::salhelper::SingletonRef
< KeyMapping
> m_rKeyMapping
;
81 //-------------------------------------------
86 //---------------------------------------
87 /** @short connect this new writer instance
88 to an outside container, which should be
89 flushed to the underlying XML configuration.
92 a reference to the outside container.
95 used to write the configuration there.
97 AcceleratorConfigurationWriter(const AcceleratorCache
& rContainer
,
98 const css::uno::Reference
< css::xml::sax::XDocumentHandler
>& xConfig
);
100 //---------------------------------------
101 /** @short does nothing real ... */
102 virtual ~AcceleratorConfigurationWriter();
104 //---------------------------------------
106 virtual void flush();
108 //-------------------------------------------
113 //---------------------------------------
115 void impl_ts_writeKeyCommandPair(const css::awt::KeyEvent
& aKey
,
116 const ::rtl::OUString
& sCommand
,
117 const css::uno::Reference
< css::xml::sax::XDocumentHandler
>& xConfig
);
120 } // namespace framework
122 #endif // _FRAMEWORK_XML_ACCELERATORCONFIGURATIONWRITER_HXX_