2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiCtrl_FlickAnimation.h
20 * @brief This is the header file for the _FlickAnimation class.
22 * This header file contains the declarations of the _FlickAnimation class.
25 #ifndef _FUI_CTRL_INTERNAL_FLICKANIMATION_H_
26 #define _FUI_CTRL_INTERNAL_FLICKANIMATION_H_
28 const int DEVICE_SIZE_HORIZONTAL = 56; // LCD Width (mm)
29 const int DEVICE_SIZE_VERTICAL = 93; // LCD Hight (mm)
30 const int FLICK_ANIMATION_FPS_LIST = 300; // List FPS
31 const int FLICK_ANIMATION_SENSITIVITY_LIST = 150; // List Animation Sensitivity
32 const int FLICK_ANIMATION_FPS_ICONLIST = 60; // IconList FPS
33 const int FLICK_ANIMATION_SENSITIVITY_ICONLIST = 30;// IconList Animation Sensitivity
34 const int FLICK_ANIMATION_FPS_PANEL = 30; // Panel FPS
35 const int FLICK_ANIMATION_SENSITIVITY_PANEL = 30; // Panel Animation Sensitivity
38 namespace Tizen { namespace Ui { namespace Controls
45 FD_BOTH = FD_VERTICAL | FD_HORIZONTAL,
51 _FlickAnimation(void);
53 virtual ~_FlickAnimation(void);
55 // Functions for Setting Parameter
56 void SetSizeInformation(int resW, int resH, int mmW, int mmH);
58 void SetAlignInformation(int alignW, int alignH);
60 void SetSensitivity(int fps, int sensitivity);
62 void SetDirection(int dir);
64 void SetTensionEnable(bool enableX, bool enableY);
66 // Check Item Executable or not
67 bool IsItemExecutable(int flickX, int flickY);
69 // Functions For Initializeialization of Flick Animation
70 void CalculateInitializeVelocity(int flickX, int flickY, int flickTime, int* pFlkVelX, int* pFlkVelY);
72 int EstimateInitializeVelocity(int totalDist, int idx = 1);
74 // Functions For Flick Animation
75 void InitializeFlickAmount(int flkVelX, int flkVelY);
77 int CalculateNextMove(int* pMoveX, int* pMoveY);
79 // For Legacy : Functions For Flick Animation
80 void InitializeFlickAmount(int flkVel);
82 int CalculateNextMove(void);
84 bool StartTensionEffect(int pos, int end, int idx = 1);
86 // Functions for Getting State Value
87 int GetCurVelocity(int idx = 1) const;
89 int GetCurFriction(int idx = 1) const;
92 void InitializeFlick(int flkVelX, int flkVelY);
94 void InitializeFlickXY(int flkVel, int idx);
96 int CalculateNextMoveXY(int idx);
98 void InitializeTension(void);
102 static const int FLK_ANI_TIME_MIN_MSEC = 1500; // Minimum Animation Duration
103 static const int FLK_ANI_TIME_MAX_MSEC = 3000; // Maximum Animation Duration
104 static const int FLK_ANI_DEFAULT_ALIGN_RATIO = 6; // Default Item Counts for Virtual Align Height
105 static const int FLK_ANI_OVERSPEED_START_CNT = 1; // Overspeed starting draw count
106 static const int FLK_ANI_OVERSPEED_END_CNT = 14; // Overspeed ending draw count
107 static const int FLK_WEIGHT_VEL = 1; // Flick Velocity weight
108 static const int FLK_WEIGHT_DIST = 5;//20 // Flick Distance weight
109 static const int FLK_ALPHA_PER_MM = 240; // mm - Flick Coefficient
110 static const int FLK_ALPHA_PER_PIXEL = 3; // pixel - Flick Coefficient
111 static const int FLK_ANI_SPEED_MIN_RATIO = 5; // Flick Animation Minimum Speed Ratio (Vmin=Vmax/Ratio)
112 static const int FLK_SPEED_MIN = 400; // Minimum Flick Speed for Stage 1
113 static const int FLK_SPEED_THRES1 = 2400; // Flick Speed Threshold for Stage 2
114 static const int FLK_SPEED_THRES2 = 3000; // Flick Speed Threshold for Stage 3 (Overspeed applied)
115 static const int FLK_OVERSPEED_STEP = 800; // Acceleration Step for Overspeed
117 int __flickDirection; // Flick Direction
118 int __dimension[2]; // Width/Height Dimension (mm)
119 int __resolution[2]; // Width/Height Resolution (pixel)
120 int __align[2]; // Align Width/Height Resolution (pixel)
121 int __margin[2]; // Margin Width/Height Resolution (pixel)
123 int __flickAnimationFPS;
124 int __flickAnimationFPSRef;
125 int __flickAnimaionTimeMin;
126 int __flickAnimationTimeMax;
128 int __friction[2]; // Friction Coefficient
129 int __velocity[2]; // Animation Velocity
131 int __frictionMin[2]; // Minimum Friction Coefficient near Stop
132 int __velocityMin[2]; // Minimum Animation Velocity near Stop
134 int __acceleration[2]; // Animation Acceleration Coefficient
135 int __drawCount; // Drawing Count
145 __tensionStatus[2]; // Tension Effect Status
146 int __tensionDistMax[2]; // Maximum Distance for Tension Effect
147 }; // _FlickAnimation
149 }}} // Tizen::Ui::Controls
151 #endif // _FUI_CTRL_INTERNAL_FLICKANIMATION_H_