1*aaef562fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*aaef562fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*aaef562fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*aaef562fSAndrew Rist  * distributed with this work for additional information
6*aaef562fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*aaef562fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*aaef562fSAndrew Rist  * "License"); you may not use this file except in compliance
9*aaef562fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*aaef562fSAndrew Rist  *
11*aaef562fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*aaef562fSAndrew Rist  *
13*aaef562fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*aaef562fSAndrew Rist  * software distributed under the License is distributed on an
15*aaef562fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*aaef562fSAndrew Rist  * KIND, either express or implied.  See the License for the
17*aaef562fSAndrew Rist  * specific language governing permissions and limitations
18*aaef562fSAndrew Rist  * under the License.
19*aaef562fSAndrew Rist  *
20*aaef562fSAndrew Rist  *************************************************************/
21*aaef562fSAndrew Rist 
22*aaef562fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #if ! defined INCLUDED_SLIDESHOW_TRANSITIONINFO_HXX
25cdf0e10cSrcweir #define INCLUDED_SLIDESHOW_TRANSITIONINFO_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <sal/types.h>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir 
30cdf0e10cSrcweir namespace slideshow {
31cdf0e10cSrcweir namespace internal {
32cdf0e10cSrcweir 
33cdf0e10cSrcweir struct TransitionInfo
34cdf0e10cSrcweir {
35cdf0e10cSrcweir     // the following two member serve as the search key
36cdf0e10cSrcweir     // for an incoming XTransitionFilter node
37cdf0e10cSrcweir     //
38cdf0e10cSrcweir     // {
39cdf0e10cSrcweir 
40cdf0e10cSrcweir     sal_Int16       mnTransitionType;
41cdf0e10cSrcweir     sal_Int16       mnTransitionSubType;
42cdf0e10cSrcweir 
43cdf0e10cSrcweir     // }
44cdf0e10cSrcweir     //
45cdf0e10cSrcweir 
46cdf0e10cSrcweir     /** This enum classifies a transition type
47cdf0e10cSrcweir      */
48cdf0e10cSrcweir     enum TransitionClass
49cdf0e10cSrcweir     {
50cdf0e10cSrcweir         /// Invalid type
51cdf0e10cSrcweir         TRANSITION_INVALID,
52cdf0e10cSrcweir 
53cdf0e10cSrcweir         /// Transition expressed by parametric clip polygon
54cdf0e10cSrcweir         TRANSITION_CLIP_POLYPOLYGON,
55cdf0e10cSrcweir 
56cdf0e10cSrcweir         /// Transition expressed by hand-crafted function
57cdf0e10cSrcweir         TRANSITION_SPECIAL
58cdf0e10cSrcweir     };
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     /// class of effect handling
61cdf0e10cSrcweir     TransitionClass meTransitionClass;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     /// Rotation angle of clip polygon
64cdf0e10cSrcweir     double          mnRotationAngle;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     /// X scaling of clip polygon (negative values mirror)
67cdf0e10cSrcweir     double          mnScaleX;
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     /// Y scaling of clip polygon (negative values mirror)
70cdf0e10cSrcweir     double          mnScaleY;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     /** This enum determines the method how to reverse
73cdf0e10cSrcweir         a parametric clip polygon transition.
74cdf0e10cSrcweir 
75cdf0e10cSrcweir         A reversed transition runs in the geometrically
76cdf0e10cSrcweir         opposite direction. For a left-to-right bar wipe, the
77cdf0e10cSrcweir         reversed transition is a right-to-left wipe, whereas
78cdf0e10cSrcweir         for an iris transition, the reversed mode will show
79cdf0e10cSrcweir         the target in the outer area (instead of in the inner
80cdf0e10cSrcweir         area, as in normal mode).
81cdf0e10cSrcweir     */
82cdf0e10cSrcweir     enum ReverseMethod
83cdf0e10cSrcweir     {
84cdf0e10cSrcweir         /** Ignore direction attribute altogether
85cdf0e10cSrcweir             (if it has no sensible meaning for this transition)
86cdf0e10cSrcweir         */
87cdf0e10cSrcweir         REVERSEMETHOD_IGNORE,
88cdf0e10cSrcweir 
89cdf0e10cSrcweir         /** Revert by changing the direction of the parameter sweep
90cdf0e10cSrcweir             (from 1->0 instead of 0->1)
91cdf0e10cSrcweir         */
92cdf0e10cSrcweir         REVERSEMETHOD_INVERT_SWEEP,
93cdf0e10cSrcweir 
94cdf0e10cSrcweir         /** Revert by subtracting the generated polygon from the
95cdf0e10cSrcweir             target bound rect
96cdf0e10cSrcweir         */
97cdf0e10cSrcweir         REVERSEMETHOD_SUBTRACT_POLYGON,
98cdf0e10cSrcweir 
99cdf0e10cSrcweir         /** Combination of REVERSEMETHOD_INVERT_SWEEP and
100cdf0e10cSrcweir             REVERSEMETHOD_SUBTRACT_POLYGON.
101cdf0e10cSrcweir         */
102cdf0e10cSrcweir         REVERSEMETHOD_SUBTRACT_AND_INVERT,
103cdf0e10cSrcweir 
104cdf0e10cSrcweir         /// Reverse by rotating polygon 180 degrees
105cdf0e10cSrcweir         REVERSEMETHOD_ROTATE_180,
106cdf0e10cSrcweir 
107cdf0e10cSrcweir         /// Reverse by flipping polygon at the y (!) axis
108cdf0e10cSrcweir         REVERSEMETHOD_FLIP_X,
109cdf0e10cSrcweir 
110cdf0e10cSrcweir         /// Reverse by flipping polygon at the x (!) axis
111cdf0e10cSrcweir         REVERSEMETHOD_FLIP_Y
112cdf0e10cSrcweir     };
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     /** Indicating the method to use when transition
115cdf0e10cSrcweir         should be 'reversed'.
116cdf0e10cSrcweir 
117cdf0e10cSrcweir         @see ReverseMethod
118cdf0e10cSrcweir     */
119cdf0e10cSrcweir     ReverseMethod   meReverseMethod;
120cdf0e10cSrcweir 
121cdf0e10cSrcweir     /** When true, transition 'out' effects are realized
122cdf0e10cSrcweir         by inverting the parameter sweep direction (1->0
123cdf0e10cSrcweir         instead of 0->1). Otherwise, 'out' effects are
124cdf0e10cSrcweir         realized by changing inside and outside areas of
125cdf0e10cSrcweir         the parametric poly-polygon.
126cdf0e10cSrcweir     */
127cdf0e10cSrcweir     bool            mbOutInvertsSweep;
128cdf0e10cSrcweir 
129cdf0e10cSrcweir     /** when true, scale clip polygon isotrophically to
130cdf0e10cSrcweir         target size.  when false, scale is
131cdf0e10cSrcweir         anisotrophically.
132cdf0e10cSrcweir     */
133cdf0e10cSrcweir     bool            mbScaleIsotrophically;
134cdf0e10cSrcweir 
135cdf0e10cSrcweir 
136cdf0e10cSrcweir     /// Compare against type and subtype
137cdf0e10cSrcweir     class Comparator
138cdf0e10cSrcweir     {
139cdf0e10cSrcweir         sal_Int16 mnTransitionType;
140cdf0e10cSrcweir         sal_Int16 mnTransitionSubType;
141cdf0e10cSrcweir     public:
Comparator(sal_Int16 nTransitionType,sal_Int16 nTransitionSubType)142cdf0e10cSrcweir         Comparator( sal_Int16 nTransitionType,
143cdf0e10cSrcweir                     sal_Int16 nTransitionSubType )
144cdf0e10cSrcweir             : mnTransitionType( nTransitionType ),
145cdf0e10cSrcweir               mnTransitionSubType( nTransitionSubType ) {}
operator ()(const TransitionInfo & rEntry) const146cdf0e10cSrcweir         bool operator()( const TransitionInfo& rEntry ) const {
147cdf0e10cSrcweir             return rEntry.mnTransitionType == mnTransitionType &&
148cdf0e10cSrcweir                 rEntry.mnTransitionSubType == mnTransitionSubType;
149cdf0e10cSrcweir         }
150cdf0e10cSrcweir     };
151cdf0e10cSrcweir };
152cdf0e10cSrcweir 
153cdf0e10cSrcweir } // namespace internal
154cdf0e10cSrcweir } // namespace presentation
155cdf0e10cSrcweir 
156cdf0e10cSrcweir #endif /* INCLUDED_SLIDESHOW_TRANSITIONINFO_HXX */
157