Update ooo320-m1
[ooovba.git] / xmlsecurity / source / framework / elementcollector.hxx
blobdff0e1269b947c48596937c6af59453a5e9e18e6
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: elementcollector.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _ELEMENTCOLLECTOR_HXX
32 #define _ELEMENTCOLLECTOR_HXX
34 #include "elementmark.hxx"
35 #include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp>
36 #include <com/sun/star/xml/crypto/sax/ElementMarkPriority.hpp>
38 class ElementCollector : public ElementMark
39 /****** elementcollector.hxx/CLASS ElementCollector ***************************
41 * NAME
42 * ElementCollector -- Class to manipulate an element collector
44 * FUNCTION
45 * This class is derived from the ElementMark class. Beyond the function
46 * of the ElementMark class, this class also maintains the priority, and
47 * manages the notify process
49 * HISTORY
50 * 05.01.2004 - implemented
52 * AUTHOR
53 * Michael Mi
54 * Email: michael.mi@sun.com
55 ******************************************************************************/
57 private:
59 * the notify priority, is one of following values:
60 * AFTERMODIFY - this ElementCollector will notify after all
61 * internal modifications have finished.
62 * BEFOREMODIFY - this ElementCollector must notify before any
63 * internal modification happens.
65 com::sun::star::xml::crypto::sax::ElementMarkPriority m_nPriority;
68 * the modify flag, representing whether which elementcollector will
69 * modify its data.
71 bool m_bToModify;
73 /* the notify enable flag, see notifyListener method */
74 bool m_bAbleToNotify;
76 /* whether the listener has been notified */
77 bool m_bNotified;
79 /* the listener to be notified */
80 com::sun::star::uno::Reference<
81 com::sun::star::xml::crypto::sax::XReferenceResolvedListener > m_xReferenceResolvedListener;
83 public:
84 ElementCollector(
85 sal_Int32 nSecurityId,
86 sal_Int32 nBufferId,
87 com::sun::star::xml::crypto::sax::ElementMarkPriority nPriority,
88 bool bToModify,
89 const com::sun::star::uno::Reference<
90 com::sun::star::xml::crypto::sax::XReferenceResolvedListener >&
91 xReferenceResolvedListener);
92 virtual ~ElementCollector() {};
94 //bool isInternalNotificationSuppressed() const;
95 com::sun::star::xml::crypto::sax::ElementMarkPriority getPriority() const;
96 bool getModify() const;
97 void notifyListener();
98 bool isAbleToNotify() const;
99 void setReferenceResolvedListener(
100 const com::sun::star::uno::Reference<
101 com::sun::star::xml::crypto::sax::XReferenceResolvedListener >&
102 referenceResolvedListener);
103 void setSecurityId(sal_Int32 nSecurityId);
104 void doNotify();
105 ElementCollector* clone(
106 sal_Int32 nId,
107 com::sun::star::xml::crypto::sax::ElementMarkPriority nPriority ) const;
110 #endif