Update ooo320-m1
[ooovba.git] / framework / inc / xml / acceleratorconfigurationwriter.hxx
blob057a03f69c31c77dc8f0fb706e45a0b47774f0db
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: acceleratorconfigurationwriter.hxx,v $
10 * $Revision: 1.4 $
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 //_______________________________________________
35 // own includes
37 #include <accelerators/acceleratorcache.hxx>
38 #include <accelerators/keymapping.hxx>
39 #include <threadhelp/threadhelpbase.hxx>
40 #include <general.h>
42 //_______________________________________________
43 // interface includes
45 #ifndef __COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_
46 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
47 #endif
49 //_______________________________________________
50 // other includes
51 #include <salhelper/singletonref.hxx>
52 #include <rtl/ustring.hxx>
54 namespace framework{
56 class AcceleratorConfigurationWriter : private ThreadHelpBase
58 //-------------------------------------------
59 // member
61 private:
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
78 alive forever ...*/
79 ::salhelper::SingletonRef< KeyMapping > m_rKeyMapping;
81 //-------------------------------------------
82 // interface
84 public:
86 //---------------------------------------
87 /** @short connect this new writer instance
88 to an outside container, which should be
89 flushed to the underlying XML configuration.
91 @param rContainer
92 a reference to the outside container.
94 @param xConfig
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 //---------------------------------------
105 /** @short TODO */
106 virtual void flush();
108 //-------------------------------------------
109 // helper
111 private:
113 //---------------------------------------
114 /** @short TODO */
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_