Removing space in app name - Fix for TC-1404
[profile/ivi/Modello_Homescreen.git] / js / predefAppModel.js
1 /**
2  * Contains area definitions for applications radial menu and apps definitions.
3  * @class predefAppModel
4  * @module HomescreenApplication
5  **/
6 /**
7  * Define center point of radial menu
8  * @property centerPoint
9  * @type Object
10  * @default {x: 360, y: 675}
11  * @static
12  **/
13 var centerPoint = {x: 360, y: 675};
14
15 /**
16  * Definitions of radial pie.
17  * Possible properties in contained Objects:
18  * name, id, action, sectorID, iconPath, shape, sc, lc, sa, la
19  * @property areasDefinitions
20  * @type Array
21  **/
22 /**
23  * Name of an application
24  * @property name
25  * @type string
26  **/
27 /**
28  * Id of an application
29  * @property id
30  * @type string
31  **/
32 /**
33  * Action after click to defined area.
34  * @property action
35  * @type function
36  **/
37 /**
38  * Sector id in context to homescreen pie sectors
39  * @property sectorID
40  * @type int
41  **/
42 /**
43  * Path to app icon
44  * @property iconPath
45  * @type string
46  **/
47 /**
48  * Define shape of clicking area
49  * @property shape
50  * @type string
51  **/
52 /**
53  * Small circle - define distance from center, where pie sector starts (influence only if shape is pieWithoutCenter)
54  * @property sc
55  * @type int
56  **/
57 /**
58  * Large circle - define distance from center, where pie sector ends
59  * @property lc
60  * @type int
61  **/
62 /**
63  * Start angle - define starting ange of pie sector. Angle is based on zero angle(zero angle has a line, which is horizontal and starts in the center point) (influence only if shape is pieWithoutCenter).
64  * @property sa
65  * @type int
66  **/
67 /**
68  * End angle - define ending angle of pie sector (influence only if shape is pieWithoutCenter).
69  * @property la
70  * @type int
71  **/
72
73 var areasDefinitions = [ {
74         name: 'center',
75         id: null,
76         action: function () {
77                 "use strict";
78                 $("#homeScrAppGridView").fadeIn();
79         },
80         sectorId: 0,
81         lc: 70,
82         shape: 'cenerCircle'
83 }, {
84         name: 'navigation',
85         iconPath: '../icons/Navigation_icon.png',
86         sectorId: 1,
87         sc: 104,
88         lc: 497,
89         sa:     61,
90         la:     117,
91         shape: 'pieWithoutCenter'
92 }, {
93         name: "airconditioning",
94         iconPath: '../icons/Dashboard_icon.png',
95         sectorId: 2,
96         sc: 94,         //small circle border
97         lc: 437,        //large circle border
98         sa:     11,             //smaller angle based on horizontal line which starts in center and continue right (right border)
99         la:     55,             //larger angle (left border)
100         shape: 'pieWithoutCenter'
101 }, {
102         name: 'MultimediaPlayer',
103         iconPath: '../icons/Multimedia_Player_icon.png',
104         sectorId: 3,
105         sc: 80,
106         lc: 392,
107         sa:     321,
108         la:     359.9,
109         shape: 'pieWithoutCenter'
110 }, {
111         name: 'SmartDeviceLink',
112         iconPath: '../icons/SmartDeviceLink_icon.png',
113         sectorId: 4,
114         sc: 80,
115         lc: 384,
116         sa:     268,
117         la:     306,
118         shape: 'pieWithoutCenter'
119 }, {
120         name: 'phone',
121         iconPath: '../apps/Phone_icon.png',
122         sectorId: 5,
123         sc: 82,
124         lc: 364,
125         sa:     217,
126         la:     264,
127         shape: 'pieWithoutCenter'
128 }, {
129         name: 'store',
130         iconPath: '../icons/AppManager_icon.png',
131         sectorId: 6,
132         sc: 82,
133         lc: 364,
134         sa:     170,
135         la:     212,
136         shape: 'pieWithoutCenter'
137 }, {
138         name: 'dashboard',
139         iconPath: '../icons/Dashboard_icon.png',
140         sectorId: 7,
141         sc: 105,
142         lc: 433,
143         sa:     126,
144         la:     160,
145         shape: 'pieWithoutCenter'
146 } ];
147
148 function fillAppIDs (appList)
149 {
150     for (i = 0; i < appList.length; i++)
151     {
152         var app = appList[i];
153         if (app.name.indexOf('Modello') >= 0)
154         {
155             switch (app.name)
156             {
157                 case "ModelloNavigation":
158                     areasDefinitions[1].id = app.id;
159                 break;
160
161                 case "ModelloHVAC":
162                     areasDefinitions[2].id = app.id;
163                 break;
164
165                 case "ModelloMultimediaPlayer":
166                     areasDefinitions[3].id = app.id;
167                 break;
168
169                 case "ModelloSmartDeviceLink":
170                     areasDefinitions[4].id = app.id;
171                 break;
172
173                 case "ModelloPhone":
174                     areasDefinitions[5].id = app.id;
175                 break;
176
177                 case "ModelloAppManager":
178                     areasDefinitions[6].id = app.id;
179                 break;
180
181                 case "ModelloDashboard":
182                     areasDefinitions[7].id = app.id;
183                 break;
184             }
185         }
186     }
187 }
188
189 function setPieAppIDs ()
190 {
191     tizen.application.getAppsInfo(fillAppIDs, function(err) {
192         console.log("Modello failed to get app IDs for center icons");
193     });
194 }