LibreOffice Module slideshow (master) 1
basecontainernode.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_BASECONTAINERNODE_HXX
20#define INCLUDED_SLIDESHOW_SOURCE_INC_BASECONTAINERNODE_HXX
21
22#include "basenode.hxx"
23
24namespace slideshow::internal {
25
26class BaseContainerNode;
27typedef ::std::shared_ptr< BaseContainerNode > BaseContainerNodeSharedPtr;
28
29
34{
35public:
37 css::uno::Reference<css::animations::XAnimationNode> const& xNode,
38 BaseContainerNodeSharedPtr const& pParent,
39 NodeContext const& rContext );
40
43 void appendChildNode( AnimationNodeSharedPtr const& pNode );
44
45#if defined(DBG_UTIL)
46 virtual void showState() const override;
47 virtual const char* getDescription() const override { return "BaseContainerNode"; }
48#endif
49
50protected:
51 // overrides from BaseNode
52 virtual void dispose() override;
53
54private:
55 virtual bool init_st() override;
56 bool init_children();
57 virtual void deactivate_st( NodeState eDestState ) override;
58 virtual bool hasPendingAnimation() const override;
59 // force to be implemented by derived class:
60 virtual void activate_st() override = 0;
61 virtual void notifyDeactivating(
62 AnimationNodeSharedPtr const& rNotifier ) override = 0;
63
64protected:
66
67 bool isChildNode( AnimationNodeSharedPtr const& pNode ) const;
68
70 bool notifyDeactivatedChild( AnimationNodeSharedPtr const& pChildNode );
71
72 void repeat();
73
74 template <typename FuncT>
75 void forEachChildNode( FuncT func,
76 int nodeStateMask ) const
77 {
78 for (AnimationNodeSharedPtr const& pNode : maChildren) {
79 if (nodeStateMask != -1 && (pNode->getState() & nodeStateMask) == 0)
80 continue;
81 func(pNode);
82 }
83 }
84
85 typedef ::std::vector<AnimationNodeSharedPtr> VectorOfNodes;
87 ::std::size_t mnFinishedChildren;
89
90private:
92 const bool mbRestart;
94};
95
96} // namespace presentation::interface
97
98#endif
99
100/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
NodeState
The current state of this AnimationNode.
This interface extends BaseNode with child handling methods.
bool notifyDeactivatedChild(AnimationNodeSharedPtr const &pChildNode)
virtual void activate_st() override=0
bool isChildNode(AnimationNodeSharedPtr const &pNode) const
void appendChildNode(AnimationNodeSharedPtr const &pNode)
Add given child node to this container.
void forEachChildNode(FuncT func, int nodeStateMask) const
virtual void notifyDeactivating(AnimationNodeSharedPtr const &rNotifier) override=0
Called to notify another AnimationNode's deactivation.
virtual const char * getDescription() const override
virtual void deactivate_st(NodeState eDestState) override
virtual void showState() const override
virtual bool hasPendingAnimation() const override
Query node whether it has an animation pending.
::std::vector< AnimationNodeSharedPtr > VectorOfNodes
BaseContainerNode(css::uno::Reference< css::animations::XAnimationNode > const &xNode, BaseContainerNodeSharedPtr const &pParent, NodeContext const &rContext)
virtual void dispose() override
Dispose all object references.
This interface extends AnimationNode with some file-private accessor methods.
Definition: basenode.hxx:83
::std::shared_ptr< BaseContainerNode > BaseContainerNodeSharedPtr
::std::shared_ptr< AnimationNode > AnimationNodeSharedPtr
Context for every node.
Definition: basenode.hxx:45