change nodisplay of ring from false to true to fix TIVI-702
[profile/ivi/clock.git] / stopwatch / include / stopwatch.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __STOPWATCH_APP_COMMON_H__
18 #define __STOPWATCH_APP_COMMON_H__
19
20 #include <glib.h>
21 #include <Elementary.h>
22 #include <appcore-efl.h>
23 #include <vconf.h>
24 #include <vconf-keys.h>
25 #include <pmapi.h>
26 #include <utilX.h>
27 #include <Ecore_X.h>
28 #include "stopwatch_define.h"
29 #include "stopwatch_widget.h"
30 #include "clock_fwk_widget.h"
31 #include "stopwatch_lib.h"
32
33 typedef enum {
34         STW_STATE_TYPE_RESET = 0,
35         STW_STATE_TYPE_START,
36         STW_STATE_TYPE_STOP,
37         STW_STATE_TYPE_MAX,
38 } STW_STATE_TYPE;
39
40 typedef enum {
41         STW_PANEL_TYPE_WITHOUT_HOUR = 0,
42         STW_PANEL_TYPE_WITH_HOUR,
43 } STW_PANEL_TYPE;
44
45 // define data structure for lap
46 struct lap_data {
47         char index[32];         // to record the index of lap record
48         char lap_data[20];      // to record the time in UI at tapping "lap" button
49         char lap_data_small[10];        // to record the small time in UI at tapping "lap" button
50         char interval_data[20];   // to record the intarval time on the time pannel
51 };
52
53 // define data structure for application
54 struct appdata {
55         //
56         Evas_Object *win;
57         Evas_Object *layout_main;       // main layout
58         Evas_Object *ly_main;   // main layout of ly_main
59         Evas_Object *eo_panel;  // panel
60         Evas_Object *eo_btn_lft;        // lbtn
61         Evas_Object *eo_btn_rht;        // rbtn
62         Evas_Object *eo_btn_back;       //back button
63
64         Evas_Object *navi_bar;
65         Elm_Object_Item *ei_naviframe;
66         Evas_Object *parent;    // a object inputed from Clock
67         STW_STATE_TYPE cur_state;       //current state
68         STW_PANEL_TYPE cur_panel;       //current panel
69         /* add more variables here */
70         Ecore_Timer *timer;
71         struct timeval time_past;       // record time elapsed
72         //
73         double start_time;      //when start/restart
74         double elapsed_time;    //
75         double last_lap_time;   //
76         double last_record_time;        //
77         int lap_num;            // to record the number of lap records
78         Evas_Object *gl;        // to point genlist object
79
80         Evas_Object *controlbar;        // used for control bar
81         stopwatch_controlbar_visible controlbar_cb;
82 };
83
84 #endif                          /* __APP_COMMON_H__ */