cid#1640468 Dereference after null check
[LibreOffice.git] / xmlsecurity / source / framework / elementcollector.hxx
blob29447e882bba9574297c872aefc8e6783d4065c6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include "elementmark.hxx"
23 #include <com/sun/star/xml/crypto/sax/ElementMarkPriority.hpp>
24 #include <com/sun/star/uno/Reference.hxx>
26 namespace com::sun::star::xml::crypto::sax { class XReferenceResolvedListener; }
28 class ElementCollector : public ElementMark
29 /****** elementcollector.hxx/CLASS ElementCollector ***************************
31 * NAME
32 * ElementCollector -- Class to manipulate an element collector
34 * FUNCTION
35 * This class is derived from the ElementMark class. Beyond the function
36 * of the ElementMark class, this class also maintains the priority, and
37 * manages the notify process
38 ******************************************************************************/
40 private:
42 * the notify priority, is one of following values:
43 * AFTERMODIFY - this ElementCollector will notify after all
44 * internal modifications have finished.
45 * BEFOREMODIFY - this ElementCollector must notify before any
46 * internal modification happens.
48 css::xml::crypto::sax::ElementMarkPriority const m_nPriority;
51 * the modify flag, representing whether which elementcollector will
52 * modify its data.
54 bool const m_bToModify;
56 /* the notify enable flag, see notifyListener method */
57 bool m_bAbleToNotify;
59 /* whether the listener has been notified */
60 bool m_bNotified;
62 /* the listener to be notified */
63 css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > m_xReferenceResolvedListener;
65 public:
66 ElementCollector(
67 sal_Int32 nBufferId,
68 css::xml::crypto::sax::ElementMarkPriority nPriority,
69 bool bToModify,
70 css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > xReferenceResolvedListener);
72 css::xml::crypto::sax::ElementMarkPriority getPriority() const { return m_nPriority;}
73 bool getModify() const { return m_bToModify;}
74 void notifyListener();
75 void setReferenceResolvedListener(
76 const css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener >& referenceResolvedListener);
77 void doNotify();
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */