1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SV_XMLAUTOCORRECTIMPORT_HXX
24 #define _SV_XMLAUTOCORRECTIMPORT_HXX
25 
26 #ifndef _SVSTOR_HXX
27 #include <sot/storage.hxx>
28 #endif
29 #include <xmloff/xmlictxt.hxx>
30 #include <xmloff/xmlimp.hxx>
31 #include <xmloff/nmspmap.hxx>
32 #include <xmloff/xmlnmspe.hxx>
33 #include <editeng/svxacorr.hxx>
34 
35 class SvXMLAutoCorrectImport : public SvXMLImport
36 {
37 protected:
38 
39 	// This method is called after the namespace map has been updated, but
40 	// before a context for the current element has been pushed.
41 	virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
42 				  const ::rtl::OUString& rLocalName,
43 				  const ::com::sun::star::uno::Reference<
44 					::com::sun::star::xml::sax::XAttributeList > & xAttrList );
45 public:
46 	SvxAutocorrWordList		*pAutocorr_List;
47 	SvxAutoCorrect			&rAutoCorrect;
48     com::sun::star::uno::Reference < com::sun::star::embed::XStorage > xStorage;
49     //SvStorageRef            &rStorage;
50 
51 	// #110680#
52 	SvXMLAutoCorrectImport(
53 		const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
54 		SvxAutocorrWordList *pNewAutocorr_List,
55 		SvxAutoCorrect &rNewAutoCorrect,
56         const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rNewStorage);
57 
58 	~SvXMLAutoCorrectImport ( void ) throw ();
59 };
60 
61 class SvXMLWordListContext : public SvXMLImportContext
62 {
63 private:
64 	SvXMLAutoCorrectImport & rLocalRef;
65 public:
66 	SvXMLWordListContext ( SvXMLAutoCorrectImport& rImport,
67 						   sal_uInt16 nPrefix,
68 						   const rtl::OUString& rLocalName,
69 						   const ::com::sun::star::uno::Reference<
70 						   ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
71 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
72 						   const rtl::OUString& rLocalName,
73 						   const ::com::sun::star::uno::Reference<
74 						   ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
75 	~SvXMLWordListContext ( void );
76 };
77 
78 class SvXMLWordContext : public SvXMLImportContext
79 {
80 private:
81 	SvXMLAutoCorrectImport & rLocalRef;
82 public:
83 	SvXMLWordContext ( SvXMLAutoCorrectImport& rImport,
84 						   sal_uInt16 nPrefix,
85 						   const rtl::OUString& rLocalName,
86 						   const ::com::sun::star::uno::Reference<
87 						   ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
88 	~SvXMLWordContext ( void );
89 };
90 
91 
92 class SvXMLExceptionListImport : public SvXMLImport
93 {
94 protected:
95 
96 	// This method is called after the namespace map has been updated, but
97 	// before a context for the current element has been pushed.
98 	virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
99 				  const ::rtl::OUString& rLocalName,
100 				  const ::com::sun::star::uno::Reference<
101 					::com::sun::star::xml::sax::XAttributeList > & xAttrList );
102 public:
103 	SvStringsISortDtor 	&rList;
104 
105 	// #110680#
106 	SvXMLExceptionListImport(
107 		const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
108 		SvStringsISortDtor & rNewList );
109 
110 	~SvXMLExceptionListImport ( void ) throw ();
111 };
112 
113 class SvXMLExceptionListContext : public SvXMLImportContext
114 {
115 private:
116 	SvXMLExceptionListImport & rLocalRef;
117 public:
118 	SvXMLExceptionListContext ( SvXMLExceptionListImport& rImport,
119 						   sal_uInt16 nPrefix,
120 						   const rtl::OUString& rLocalName,
121 						   const ::com::sun::star::uno::Reference<
122 						   ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
123 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
124 						   const rtl::OUString& rLocalName,
125 						   const ::com::sun::star::uno::Reference<
126 						   ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
127 	~SvXMLExceptionListContext ( void );
128 };
129 
130 class SvXMLExceptionContext : public SvXMLImportContext
131 {
132 private:
133 	SvXMLExceptionListImport & rLocalRef;
134 public:
135 	SvXMLExceptionContext ( SvXMLExceptionListImport& rImport,
136 						   sal_uInt16 nPrefix,
137 						   const rtl::OUString& rLocalName,
138 						   const ::com::sun::star::uno::Reference<
139 						   ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
140 	~SvXMLExceptionContext ( void );
141 };
142 
143 
144 #endif
145