1*ec61c6edSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ec61c6edSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ec61c6edSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ec61c6edSAndrew Rist  * distributed with this work for additional information
6*ec61c6edSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ec61c6edSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ec61c6edSAndrew Rist  * "License"); you may not use this file except in compliance
9*ec61c6edSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*ec61c6edSAndrew Rist  *
11*ec61c6edSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ec61c6edSAndrew Rist  *
13*ec61c6edSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ec61c6edSAndrew Rist  * software distributed under the License is distributed on an
15*ec61c6edSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ec61c6edSAndrew Rist  * KIND, either express or implied.  See the License for the
17*ec61c6edSAndrew Rist  * specific language governing permissions and limitations
18*ec61c6edSAndrew Rist  * under the License.
19*ec61c6edSAndrew Rist  *
20*ec61c6edSAndrew Rist  *************************************************************/
21*ec61c6edSAndrew Rist 
22*ec61c6edSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _ELEMENTCOLLECTOR_HXX
25cdf0e10cSrcweir #define _ELEMENTCOLLECTOR_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "elementmark.hxx"
28cdf0e10cSrcweir #include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp>
29cdf0e10cSrcweir #include <com/sun/star/xml/crypto/sax/ElementMarkPriority.hpp>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir class ElementCollector : public ElementMark
32cdf0e10cSrcweir /****** elementcollector.hxx/CLASS ElementCollector ***************************
33cdf0e10cSrcweir  *
34cdf0e10cSrcweir  *   NAME
35cdf0e10cSrcweir  *	ElementCollector -- Class to manipulate an element collector
36cdf0e10cSrcweir  *
37cdf0e10cSrcweir  *   FUNCTION
38cdf0e10cSrcweir  *	This class is derived from the ElementMark class. Beyond the function
39cdf0e10cSrcweir  *	of the ElementMark class, this class also maintains the priority, and
40cdf0e10cSrcweir  *	manages the notify process
41cdf0e10cSrcweir  *
42cdf0e10cSrcweir  *   HISTORY
43cdf0e10cSrcweir  *	05.01.2004 -	implemented
44cdf0e10cSrcweir  *
45cdf0e10cSrcweir  *   AUTHOR
46cdf0e10cSrcweir  *	Michael Mi
47cdf0e10cSrcweir  *	Email: michael.mi@sun.com
48cdf0e10cSrcweir  ******************************************************************************/
49cdf0e10cSrcweir {
50cdf0e10cSrcweir private:
51cdf0e10cSrcweir 	/*
52cdf0e10cSrcweir 	 * the notify priority, is one of following values:
53cdf0e10cSrcweir 	 * AFTERMODIFY  - this ElementCollector will notify after all
54cdf0e10cSrcweir 	 *                    internal modifications have finished.
55cdf0e10cSrcweir 	 * BEFOREMODIFY - this ElementCollector must notify before any
56cdf0e10cSrcweir 	 *                    internal modification happens.
57cdf0e10cSrcweir 	 */
58cdf0e10cSrcweir 	com::sun::star::xml::crypto::sax::ElementMarkPriority m_nPriority;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 	/*
61cdf0e10cSrcweir 	 * the modify flag, representing whether which elementcollector will
62cdf0e10cSrcweir 	 * modify its data.
63cdf0e10cSrcweir 	 */
64cdf0e10cSrcweir 	bool m_bToModify;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	/* the notify enable flag, see notifyListener method */
67cdf0e10cSrcweir 	bool m_bAbleToNotify;
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 	/* whether the listener has been notified */
70cdf0e10cSrcweir 	bool m_bNotified;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 	/* the listener to be notified */
73cdf0e10cSrcweir 	com::sun::star::uno::Reference<
74cdf0e10cSrcweir 		com::sun::star::xml::crypto::sax::XReferenceResolvedListener > m_xReferenceResolvedListener;
75cdf0e10cSrcweir 
76cdf0e10cSrcweir public:
77cdf0e10cSrcweir 	ElementCollector(
78cdf0e10cSrcweir 		sal_Int32 nSecurityId,
79cdf0e10cSrcweir 		sal_Int32 nBufferId,
80cdf0e10cSrcweir 		com::sun::star::xml::crypto::sax::ElementMarkPriority nPriority,
81cdf0e10cSrcweir 		bool bToModify,
82cdf0e10cSrcweir 		const com::sun::star::uno::Reference<
83cdf0e10cSrcweir 			com::sun::star::xml::crypto::sax::XReferenceResolvedListener >&
84cdf0e10cSrcweir 			xReferenceResolvedListener);
~ElementCollector()85cdf0e10cSrcweir 	virtual ~ElementCollector() {};
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 	//bool isInternalNotificationSuppressed() const;
88cdf0e10cSrcweir 	com::sun::star::xml::crypto::sax::ElementMarkPriority getPriority() const;
89cdf0e10cSrcweir 	bool getModify() const;
90cdf0e10cSrcweir 	void notifyListener();
91cdf0e10cSrcweir 	bool isAbleToNotify() const;
92cdf0e10cSrcweir 	void setReferenceResolvedListener(
93cdf0e10cSrcweir 		const com::sun::star::uno::Reference<
94cdf0e10cSrcweir 			com::sun::star::xml::crypto::sax::XReferenceResolvedListener >&
95cdf0e10cSrcweir 			referenceResolvedListener);
96cdf0e10cSrcweir 	void setSecurityId(sal_Int32 nSecurityId);
97cdf0e10cSrcweir 	void doNotify();
98cdf0e10cSrcweir 	ElementCollector* clone(
99cdf0e10cSrcweir 		sal_Int32 nId,
100cdf0e10cSrcweir 		com::sun::star::xml::crypto::sax::ElementMarkPriority nPriority ) const;
101cdf0e10cSrcweir };
102cdf0e10cSrcweir 
103cdf0e10cSrcweir #endif
104cdf0e10cSrcweir 
105