1 #ifndef _DESKTOP_CFGFILTER_HXX_
2 #define _DESKTOP_CFGFILTER_HXX_
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
38 typedef std::stack
< element
> element_stack
;
44 class CConfigFilter
: public cppu::WeakImplHelper3
<
45 NS_CSS::configuration::backend::XLayer
,
46 NS_CSS::configuration::backend::XLayerHandler
,
47 NS_CSS::lang::XInitialization
>
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
);
63 sal_Bool
checkElement(rtl::OUString aName
);
64 sal_Bool
checkCurrentElement();
67 CConfigFilter(const strings_v
* include
, const strings_v
* exclude
);
70 virtual void SAL_CALL
initialize(const NS_UNO::Sequence
< NS_UNO::Any
>& seqArgs
)
71 throw (NS_UNO::Exception
);
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
);
80 virtual void SAL_CALL
startLayer()
81 throw(::com::sun::star::lang::WrappedTargetException
);
83 virtual void SAL_CALL
endLayer()
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
,
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
)
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
)
108 ::com::sun::star::configuration::backend::MalformedDataException
,
109 ::com::sun::star::lang::WrappedTargetException
);
111 virtual void SAL_CALL
endNode()
113 ::com::sun::star::configuration::backend::MalformedDataException
,
114 ::com::sun::star::lang::WrappedTargetException
);
116 virtual void SAL_CALL
dropNode(
117 const rtl::OUString
& aName
)
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
,
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
)
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
)
141 ::com::sun::star::configuration::backend::MalformedDataException
,
142 ::com::sun::star::lang::WrappedTargetException
);
144 virtual void SAL_CALL
endProperty()
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
)
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
)
162 ::com::sun::star::configuration::backend::MalformedDataException
,
163 ::com::sun::star::lang::WrappedTargetException
);
167 } // namespace desktop