Update ooo320-m1
[ooovba.git] / slideshow / source / inc / transitioninfo.hxx
blob671c759b999b3cbcac7d9fae09714ec3c557028b
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: transitioninfo.hxx,v $
10 * $Revision: 1.5 $
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 #if ! defined INCLUDED_SLIDESHOW_TRANSITIONINFO_HXX
32 #define INCLUDED_SLIDESHOW_TRANSITIONINFO_HXX
34 #include <sal/types.h>
37 namespace slideshow {
38 namespace internal {
40 struct TransitionInfo
42 // the following two member serve as the search key
43 // for an incoming XTransitionFilter node
45 // {
47 sal_Int16 mnTransitionType;
48 sal_Int16 mnTransitionSubType;
50 // }
53 /** This enum classifies a transition type
55 enum TransitionClass
57 /// Invalid type
58 TRANSITION_INVALID,
60 /// Transition expressed by parametric clip polygon
61 TRANSITION_CLIP_POLYPOLYGON,
63 /// Transition expressed by hand-crafted function
64 TRANSITION_SPECIAL
67 /// class of effect handling
68 TransitionClass meTransitionClass;
70 /// Rotation angle of clip polygon
71 double mnRotationAngle;
73 /// X scaling of clip polygon (negative values mirror)
74 double mnScaleX;
76 /// Y scaling of clip polygon (negative values mirror)
77 double mnScaleY;
79 /** This enum determines the method how to reverse
80 a parametric clip polygon transition.
82 A reversed transition runs in the geometrically
83 opposite direction. For a left-to-right bar wipe, the
84 reversed transition is a right-to-left wipe, whereas
85 for an iris transition, the reversed mode will show
86 the target in the outer area (instead of in the inner
87 area, as in normal mode).
89 enum ReverseMethod
91 /** Ignore direction attribute altogether
92 (if it has no sensible meaning for this transition)
94 REVERSEMETHOD_IGNORE,
96 /** Revert by changing the direction of the parameter sweep
97 (from 1->0 instead of 0->1)
99 REVERSEMETHOD_INVERT_SWEEP,
101 /** Revert by subtracting the generated polygon from the
102 target bound rect
104 REVERSEMETHOD_SUBTRACT_POLYGON,
106 /** Combination of REVERSEMETHOD_INVERT_SWEEP and
107 REVERSEMETHOD_SUBTRACT_POLYGON.
109 REVERSEMETHOD_SUBTRACT_AND_INVERT,
111 /// Reverse by rotating polygon 180 degrees
112 REVERSEMETHOD_ROTATE_180,
114 /// Reverse by flipping polygon at the y (!) axis
115 REVERSEMETHOD_FLIP_X,
117 /// Reverse by flipping polygon at the x (!) axis
118 REVERSEMETHOD_FLIP_Y
121 /** Indicating the method to use when transition
122 should be 'reversed'.
124 @see ReverseMethod
126 ReverseMethod meReverseMethod;
128 /** When true, transition 'out' effects are realized
129 by inverting the parameter sweep direction (1->0
130 instead of 0->1). Otherwise, 'out' effects are
131 realized by changing inside and outside areas of
132 the parametric poly-polygon.
134 bool mbOutInvertsSweep;
136 /** when true, scale clip polygon isotrophically to
137 target size. when false, scale is
138 anisotrophically.
140 bool mbScaleIsotrophically;
143 /// Compare against type and subtype
144 class Comparator
146 sal_Int16 mnTransitionType;
147 sal_Int16 mnTransitionSubType;
148 public:
149 Comparator( sal_Int16 nTransitionType,
150 sal_Int16 nTransitionSubType )
151 : mnTransitionType( nTransitionType ),
152 mnTransitionSubType( nTransitionSubType ) {}
153 bool operator()( const TransitionInfo& rEntry ) const {
154 return rEntry.mnTransitionType == mnTransitionType &&
155 rEntry.mnTransitionSubType == mnTransitionSubType;
160 } // namespace internal
161 } // namespace presentation
163 #endif /* INCLUDED_SLIDESHOW_TRANSITIONINFO_HXX */