Update ooo320-m1
[ooovba.git] / desktop / source / migration / cfgfilter.hxx
blob7970ed7dbb971b7e35409267cb28be6e40b097ce
1 #ifndef _DESKTOP_CFGFILTER_HXX_
2 #define _DESKTOP_CFGFILTER_HXX_
4 #include <stack>
6 #include <sal/types.h>
7 #include <rtl/ustring.hxx>
9 #include <cppuhelper/implbase2.hxx>
10 #include <cppuhelper/implbase3.hxx>
12 #include <com/sun/star/uno/Reference.hxx>
13 #include <com/sun/star/uno/Any.hxx>
14 #include <com/sun/star/uno/Type.hxx>
16 #include <com/sun/star/lang/XInitialization.hpp>
17 #include <com/sun/star/configuration/backend/XLayer.hpp>
18 #include <com/sun/star/configuration/backend/XLayerHandler.hpp>
19 #include <com/sun/star/configuration/backend/TemplateIdentifier.hpp>
22 #include "migration_impl.hxx"
24 #define NS_CSS com::sun::star
25 #define NS_UNO com::sun::star::uno
28 namespace desktop {
30 struct element
32 rtl::OUString name;
33 rtl::OUString path;
34 sal_Bool use;
38 typedef std::stack< element > element_stack;
40 // XInitialization:
41 // -> Source : XLayer
42 // XLayer
43 // XLayerHandler
44 class CConfigFilter : public cppu::WeakImplHelper3<
45 NS_CSS::configuration::backend::XLayer,
46 NS_CSS::configuration::backend::XLayerHandler,
47 NS_CSS::lang::XInitialization>
50 private:
51 NS_UNO::Reference< NS_CSS::configuration::backend::XLayerHandler > m_xLayerHandler;
52 NS_UNO::Reference< NS_CSS::configuration::backend::XLayer > m_xSourceLayer;
54 rtl::OUString m_aCurrentComponent;
56 const strings_v *m_pvInclude;
57 const strings_v *m_pvExclude;
59 element_stack m_elementStack;
61 void pushElement(rtl::OUString aName, sal_Bool bUse = sal_True);
62 void popElement();
63 sal_Bool checkElement(rtl::OUString aName);
64 sal_Bool checkCurrentElement();
66 public:
67 CConfigFilter(const strings_v* include, const strings_v* exclude);
69 // XInitialization
70 virtual void SAL_CALL initialize(const NS_UNO::Sequence< NS_UNO::Any >& seqArgs)
71 throw (NS_UNO::Exception);
73 // XLayer
74 virtual void SAL_CALL readData(
75 const NS_UNO::Reference< NS_CSS::configuration::backend::XLayerHandler >& layerHandler)
76 throw (NS_CSS::lang::NullPointerException, NS_CSS::lang::WrappedTargetException,
77 NS_CSS::configuration::backend::MalformedDataException);
79 // XLayerHandler
80 virtual void SAL_CALL startLayer()
81 throw(::com::sun::star::lang::WrappedTargetException);
83 virtual void SAL_CALL endLayer()
84 throw(
85 ::com::sun::star::configuration::backend::MalformedDataException,
86 ::com::sun::star::lang::WrappedTargetException );
88 virtual void SAL_CALL overrideNode(
89 const rtl::OUString& aName,
90 sal_Int16 aAttributes,
91 sal_Bool bClear)
92 throw(
93 ::com::sun::star::configuration::backend::MalformedDataException,
94 ::com::sun::star::lang::WrappedTargetException );
96 virtual void SAL_CALL addOrReplaceNode(
97 const rtl::OUString& aName,
98 sal_Int16 aAttributes)
99 throw(
100 ::com::sun::star::configuration::backend::MalformedDataException,
101 ::com::sun::star::lang::WrappedTargetException );
103 virtual void SAL_CALL addOrReplaceNodeFromTemplate(
104 const rtl::OUString& aName,
105 const NS_CSS::configuration::backend::TemplateIdentifier& aTemplate,
106 sal_Int16 aAttributes )
107 throw(
108 ::com::sun::star::configuration::backend::MalformedDataException,
109 ::com::sun::star::lang::WrappedTargetException );
111 virtual void SAL_CALL endNode()
112 throw(
113 ::com::sun::star::configuration::backend::MalformedDataException,
114 ::com::sun::star::lang::WrappedTargetException );
116 virtual void SAL_CALL dropNode(
117 const rtl::OUString& aName )
118 throw(
119 ::com::sun::star::configuration::backend::MalformedDataException,
120 ::com::sun::star::lang::WrappedTargetException );
122 virtual void SAL_CALL overrideProperty(
123 const rtl::OUString& aName,
124 sal_Int16 aAttributes,
125 const NS_UNO::Type& aType,
126 sal_Bool bClear )
127 throw(
128 ::com::sun::star::configuration::backend::MalformedDataException,
129 ::com::sun::star::lang::WrappedTargetException );
131 virtual void SAL_CALL setPropertyValue(
132 const NS_UNO::Any& aValue )
133 throw(
134 ::com::sun::star::configuration::backend::MalformedDataException,
135 ::com::sun::star::lang::WrappedTargetException );
137 virtual void SAL_CALL setPropertyValueForLocale(
138 const NS_UNO::Any& aValue,
139 const rtl::OUString& aLocale )
140 throw(
141 ::com::sun::star::configuration::backend::MalformedDataException,
142 ::com::sun::star::lang::WrappedTargetException );
144 virtual void SAL_CALL endProperty()
145 throw(
146 ::com::sun::star::configuration::backend::MalformedDataException,
147 ::com::sun::star::lang::WrappedTargetException );
149 virtual void SAL_CALL addProperty(
150 const rtl::OUString& aName,
151 sal_Int16 aAttributes,
152 const NS_UNO::Type& aType )
153 throw(
154 ::com::sun::star::configuration::backend::MalformedDataException,
155 ::com::sun::star::lang::WrappedTargetException );
157 virtual void SAL_CALL addPropertyWithValue(
158 const rtl::OUString& aName,
159 sal_Int16 aAttributes,
160 const NS_UNO::Any& aValue )
161 throw(
162 ::com::sun::star::configuration::backend::MalformedDataException,
163 ::com::sun::star::lang::WrappedTargetException );
167 } // namespace desktop
168 #undef NS_CSS
169 #undef NS_UNO
171 #endif