kpresenter

KPrLoadingInfo.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Laurent Montel <montel@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KPRLOADINGINFO_H
21#define KPRLOADINGINFO_H
22
23struct lstAnimation
24{
25 TQDomElement *element;
26 int order;
27};
28
30class KPrLoadingInfo
31{
32public:
33 KPrLoadingInfo( bool oldFormat = false)
34 : presSpeed( -1 )
35 , m_header( false )
36 , m_footer( false )
37 , m_headerFooterByPage( false )
38 , m_oldFormat( oldFormat )
39 {
40 m_animationsShowDict.setAutoDelete( true );
41 m_animationsHideDict.setAutoDelete( true );
42 }
43 ~KPrLoadingInfo() {}
44
45 lstAnimation* animationShowById( const TQString& id ) const {
46 return m_animationsShowDict[id]; // returns 0 if not found
47 }
48 void storePresentationShowAnimation( lstAnimation * element, const TQString& id ) {
49 m_animationsShowDict.insert( id , element );
50 }
51 void clearAnimationShowDict() {
52 TQDictIterator<lstAnimation> it( m_animationsShowDict ); // See TQDictIterator
53 for( ; it.current(); ++it )
54 {
55 delete it.current()->element;
56 }
57 m_animationsShowDict.clear();
58 }
59
60 lstAnimation* animationHideById( const TQString& id ) const {
61 return m_animationsHideDict[id]; // returns 0 if not found
62 }
63 void storePresentationHideAnimation( lstAnimation * element, const TQString& id ) {
64 m_animationsHideDict.insert( id , element );
65 }
66 void clearAnimationHideDict() {
67 TQDictIterator<lstAnimation> it( m_animationsHideDict ); // See TQDictIterator
68 for( ; it.current(); ++it )
69 {
70 delete it.current()->element;
71 }
72 m_animationsHideDict.clear();
73 }
74 bool oldFormat() const { return m_oldFormat; }
75 int presSpeed;
76 TQMap<TQString, KPrPage *> m_name2page;
77 bool m_header;
78 bool m_footer;
79 bool m_headerFooterByPage;
80private:
81 TQDict<lstAnimation> m_animationsShowDict;
82 TQDict<lstAnimation> m_animationsHideDict;
83 bool m_oldFormat;
84};
85
86#endif /* KPRLOADINGINFO_H */
87