1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SD_SLIDESORTER_VISUAL_STATE_HXX
25 #define SD_SLIDESORTER_VISUAL_STATE_HXX
26 
27 #include <sal/types.h>
28 #include <tools/gen.hxx>
29 #include <boost/function.hpp>
30 
31 namespace sd { namespace slidesorter { namespace model {
32 
33 class PageDescriptor;
34 
35 /** This class gives access to values related to the visualization of page
36     objects.  This includes animation state when blending from one state to
37     another.
38 */
39 class VisualState
40 {
41 public:
42     enum State {
43         VS_Selected,
44         VS_Focused,
45         VS_Current,
46         VS_Excluded,
47         VS_None };
48 
49     VisualState (const sal_Int32 nPageId);
50     ~VisualState (void);
51 
52     State GetCurrentVisualState (void) const;
53     State GetOldVisualState (void) const;
54     void SetVisualState (const State eState);
55     double GetVisualStateBlend (void) const;
56     void SetVisualStateBlend (const double nBlend);
57 
58     void UpdateVisualState (const PageDescriptor& rDescriptor);
59 
60     void SetMouseOverState (const bool bIsMouseOver);
61 
62     sal_Int32 GetStateAnimationId (void) const;
63     void SetStateAnimationId (const sal_Int32 nAnimationId);
64 
65     Point GetLocationOffset (void) const;
66     bool SetLocationOffset (const Point& rPoint);
67     sal_Int32 GetLocationAnimationId (void) const;
68     void SetLocationAnimationId (const sal_Int32 nAnimationId);
69 
70     double GetButtonAlpha (void) const;
71     void SetButtonAlpha (const double nAlpha);
72     double GetButtonBarAlpha (void) const;
73     void SetButtonBarAlpha (const double nAlpha);
74     sal_Int32 GetButtonAlphaAnimationId (void) const;
75     void SetButtonAlphaAnimationId (const sal_Int32 nAnimationId);
76 
77     sal_Int32 mnPageId; // For debugging
78 
79 private:
80     State meCurrentVisualState;
81     State meOldVisualState;
82     double mnVisualStateBlend;
83     sal_Int32 mnStateAnimationId;
84     bool mbOldMouseOverState;
85     bool mbCurrentMouseOverState;
86 
87     Point maLocationOffset;
88     sal_Int32 mnLocationAnimationId;
89 
90     double mnButtonAlpha;
91     double mnButtonBarAlpha;
92     sal_Int32 mnButtonAlphaAnimationId;
93 };
94 
95 } } } // end of namespace ::sd::slidesorter::model
96 
97 #endif
98