Branch data Line data Source code
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 : :
20 : : #ifndef INCLUDED_SLIDESHOW_TRANSITIONINFO_HXX
21 : : #define INCLUDED_SLIDESHOW_TRANSITIONINFO_HXX
22 : :
23 : : #include <sal/types.h>
24 : :
25 : :
26 : : namespace slideshow {
27 : : namespace internal {
28 : :
29 : : struct TransitionInfo
30 : : {
31 : : // the following two member serve as the search key
32 : : // for an incoming XTransitionFilter node
33 : : //
34 : : // {
35 : :
36 : : sal_Int16 mnTransitionType;
37 : : sal_Int16 mnTransitionSubType;
38 : :
39 : : // }
40 : : //
41 : :
42 : : /** This enum classifies a transition type
43 : : */
44 : : enum TransitionClass
45 : : {
46 : : /// Invalid type
47 : : TRANSITION_INVALID,
48 : :
49 : : /// Transition expressed by parametric clip polygon
50 : : TRANSITION_CLIP_POLYPOLYGON,
51 : :
52 : : /// Transition expressed by hand-crafted function
53 : : TRANSITION_SPECIAL
54 : : };
55 : :
56 : : /// class of effect handling
57 : : TransitionClass meTransitionClass;
58 : :
59 : : /// Rotation angle of clip polygon
60 : : double mnRotationAngle;
61 : :
62 : : /// X scaling of clip polygon (negative values mirror)
63 : : double mnScaleX;
64 : :
65 : : /// Y scaling of clip polygon (negative values mirror)
66 : : double mnScaleY;
67 : :
68 : : /** This enum determines the method how to reverse
69 : : a parametric clip polygon transition.
70 : :
71 : : A reversed transition runs in the geometrically
72 : : opposite direction. For a left-to-right bar wipe, the
73 : : reversed transition is a right-to-left wipe, whereas
74 : : for an iris transition, the reversed mode will show
75 : : the target in the outer area (instead of in the inner
76 : : area, as in normal mode).
77 : : */
78 : : enum ReverseMethod
79 : : {
80 : : /** Ignore direction attribute altogether
81 : : (if it has no sensible meaning for this transition)
82 : : */
83 : : REVERSEMETHOD_IGNORE,
84 : :
85 : : /** Revert by changing the direction of the parameter sweep
86 : : (from 1->0 instead of 0->1)
87 : : */
88 : : REVERSEMETHOD_INVERT_SWEEP,
89 : :
90 : : /** Revert by subtracting the generated polygon from the
91 : : target bound rect
92 : : */
93 : : REVERSEMETHOD_SUBTRACT_POLYGON,
94 : :
95 : : /** Combination of REVERSEMETHOD_INVERT_SWEEP and
96 : : REVERSEMETHOD_SUBTRACT_POLYGON.
97 : : */
98 : : REVERSEMETHOD_SUBTRACT_AND_INVERT,
99 : :
100 : : /// Reverse by rotating polygon 180 degrees
101 : : REVERSEMETHOD_ROTATE_180,
102 : :
103 : : /// Reverse by flipping polygon at the y (!) axis
104 : : REVERSEMETHOD_FLIP_X,
105 : :
106 : : /// Reverse by flipping polygon at the x (!) axis
107 : : REVERSEMETHOD_FLIP_Y
108 : : };
109 : :
110 : : /** Indicating the method to use when transition
111 : : should be 'reversed'.
112 : :
113 : : @see ReverseMethod
114 : : */
115 : : ReverseMethod meReverseMethod;
116 : :
117 : : /** When true, transition 'out' effects are realized
118 : : by inverting the parameter sweep direction (1->0
119 : : instead of 0->1). Otherwise, 'out' effects are
120 : : realized by changing inside and outside areas of
121 : : the parametric poly-polygon.
122 : : */
123 : : bool mbOutInvertsSweep;
124 : :
125 : : /** when true, scale clip polygon isotrophically to
126 : : target size. when false, scale is
127 : : anisotrophically.
128 : : */
129 : : bool mbScaleIsotrophically;
130 : :
131 : :
132 : : /// Compare against type and subtype
133 : : class Comparator
134 : : {
135 : : sal_Int16 mnTransitionType;
136 : : sal_Int16 mnTransitionSubType;
137 : : public:
138 : 0 : Comparator( sal_Int16 nTransitionType,
139 : : sal_Int16 nTransitionSubType )
140 : : : mnTransitionType( nTransitionType ),
141 : 0 : mnTransitionSubType( nTransitionSubType ) {}
142 : 0 : bool operator()( const TransitionInfo& rEntry ) const {
143 : : return rEntry.mnTransitionType == mnTransitionType &&
144 : 0 : rEntry.mnTransitionSubType == mnTransitionSubType;
145 : : }
146 : : };
147 : : };
148 : :
149 : : } // namespace internal
150 : : } // namespace presentation
151 : :
152 : : #endif /* INCLUDED_SLIDESHOW_TRANSITIONINFO_HXX */
153 : :
154 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|