1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _SV_XMLAUTOCORRECTIMPORT_HXX
28 #define _SV_XMLAUTOCORRECTIMPORT_HXX
29 
30 #ifndef _SVSTOR_HXX
31 #include <sot/storage.hxx>
32 #endif
33 #include <xmloff/xmlictxt.hxx>
34 #include <xmloff/xmlimp.hxx>
35 #include <xmloff/nmspmap.hxx>
36 #include <xmloff/xmlnmspe.hxx>
37 #include <editeng/svxacorr.hxx>
38 
39 class SvXMLAutoCorrectImport : public SvXMLImport
40 {
41 protected:
42 
43 	// This method is called after the namespace map has been updated, but
44 	// before a context for the current element has been pushed.
45 	virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
46 				  const ::rtl::OUString& rLocalName,
47 				  const ::com::sun::star::uno::Reference<
48 					::com::sun::star::xml::sax::XAttributeList > & xAttrList );
49 public:
50 	SvxAutocorrWordList		*pAutocorr_List;
51 	SvxAutoCorrect			&rAutoCorrect;
52     com::sun::star::uno::Reference < com::sun::star::embed::XStorage > xStorage;
53     //SvStorageRef            &rStorage;
54 
55 	// #110680#
56 	SvXMLAutoCorrectImport(
57 		const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
58 		SvxAutocorrWordList *pNewAutocorr_List,
59 		SvxAutoCorrect &rNewAutoCorrect,
60         const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rNewStorage);
61 
62 	~SvXMLAutoCorrectImport ( void ) throw ();
63 };
64 
65 class SvXMLWordListContext : public SvXMLImportContext
66 {
67 private:
68 	SvXMLAutoCorrectImport & rLocalRef;
69 public:
70 	SvXMLWordListContext ( SvXMLAutoCorrectImport& rImport,
71 						   sal_uInt16 nPrefix,
72 						   const rtl::OUString& rLocalName,
73 						   const ::com::sun::star::uno::Reference<
74 						   ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
75 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
76 						   const rtl::OUString& rLocalName,
77 						   const ::com::sun::star::uno::Reference<
78 						   ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
79 	~SvXMLWordListContext ( void );
80 };
81 
82 class SvXMLWordContext : public SvXMLImportContext
83 {
84 private:
85 	SvXMLAutoCorrectImport & rLocalRef;
86 public:
87 	SvXMLWordContext ( SvXMLAutoCorrectImport& rImport,
88 						   sal_uInt16 nPrefix,
89 						   const rtl::OUString& rLocalName,
90 						   const ::com::sun::star::uno::Reference<
91 						   ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
92 	~SvXMLWordContext ( void );
93 };
94 
95 
96 class SvXMLExceptionListImport : public SvXMLImport
97 {
98 protected:
99 
100 	// This method is called after the namespace map has been updated, but
101 	// before a context for the current element has been pushed.
102 	virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
103 				  const ::rtl::OUString& rLocalName,
104 				  const ::com::sun::star::uno::Reference<
105 					::com::sun::star::xml::sax::XAttributeList > & xAttrList );
106 public:
107 	SvStringsISortDtor 	&rList;
108 
109 	// #110680#
110 	SvXMLExceptionListImport(
111 		const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
112 		SvStringsISortDtor & rNewList );
113 
114 	~SvXMLExceptionListImport ( void ) throw ();
115 };
116 
117 class SvXMLExceptionListContext : public SvXMLImportContext
118 {
119 private:
120 	SvXMLExceptionListImport & rLocalRef;
121 public:
122 	SvXMLExceptionListContext ( SvXMLExceptionListImport& rImport,
123 						   sal_uInt16 nPrefix,
124 						   const rtl::OUString& rLocalName,
125 						   const ::com::sun::star::uno::Reference<
126 						   ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
127 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
128 						   const rtl::OUString& rLocalName,
129 						   const ::com::sun::star::uno::Reference<
130 						   ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
131 	~SvXMLExceptionListContext ( void );
132 };
133 
134 class SvXMLExceptionContext : public SvXMLImportContext
135 {
136 private:
137 	SvXMLExceptionListImport & rLocalRef;
138 public:
139 	SvXMLExceptionContext ( SvXMLExceptionListImport& rImport,
140 						   sal_uInt16 nPrefix,
141 						   const rtl::OUString& rLocalName,
142 						   const ::com::sun::star::uno::Reference<
143 						   ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
144 	~SvXMLExceptionContext ( void );
145 };
146 
147 
148 #endif
149